diff --git a/Refit.GeneratorTests/Fixture.cs b/Refit.GeneratorTests/Fixture.cs index affae8dab..3b779981f 100644 --- a/Refit.GeneratorTests/Fixture.cs +++ b/Refit.GeneratorTests/Fixture.cs @@ -33,7 +33,7 @@ public static class Fixture .Where(a => !a.IsDynamic) .ToArray(); - public static Task VerifyForBody(string body) + public static Task VerifyForBody(string body, bool ignoreNonInterfaces = true) { var source = $$""" @@ -54,7 +54,7 @@ public interface IGeneratedClient } """; - return VerifyGenerator(source); + return VerifyGenerator(source, ignoreNonInterfaces); } public static Task VerifyForType(string declarations) @@ -120,7 +120,7 @@ private static CSharpCompilation CreateLibrary(params string[] source) return compilation; } - private static Task VerifyGenerator(string source) + private static Task VerifyGenerator(string source, bool ignoreNonInterfaces = true) { var compilation = CreateLibrary(source); @@ -129,7 +129,13 @@ private static Task VerifyGenerator(string source) var ranDriver = driver.RunGenerators(compilation); var settings = new VerifySettings(); - var verify = VerifyXunit.Verifier.Verify(ranDriver, settings); + if (ignoreNonInterfaces) + { + settings.IgnoreGeneratedResult(x => x.HintName.Contains("PreserveAttribute.g.cs", StringComparison.Ordinal)); + settings.IgnoreGeneratedResult(x => x.HintName.Contains("Generated.g.cs", StringComparison.Ordinal)); + } + + var verify = Verify(ranDriver, settings); return verify.ToTask(); } } diff --git a/Refit.GeneratorTests/GeneratedTest.cs b/Refit.GeneratorTests/GeneratedTest.cs new file mode 100644 index 000000000..b75ce1571 --- /dev/null +++ b/Refit.GeneratorTests/GeneratedTest.cs @@ -0,0 +1,14 @@ +namespace Refit.GeneratorTests; + +public class GeneratedTest +{ + [Fact] + public Task ShouldEmitAllFiles() + { + return Fixture.VerifyForBody( + """ + [Get("/users")] + Task Get(); + """, false); + } +} diff --git a/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#Generated.g.verified.cs b/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#Generated.g.verified.cs similarity index 100% rename from Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#Generated.g.verified.cs rename to Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#Generated.g.verified.cs diff --git a/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs b/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs new file mode 100644 index 000000000..19a9fc649 --- /dev/null +++ b/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs @@ -0,0 +1,66 @@ +//HintName: IGeneratedClient.g.cs +#nullable disable +#pragma warning disable +namespace Refit.Implementation +{ + + partial class Generated + { + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [global::System.Diagnostics.DebuggerNonUserCode] + [global::RefitInternalGenerated.PreserveAttribute] + [global::System.Reflection.Obfuscation(Exclude=true)] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + partial class RefitGeneratorTestIGeneratedClient + : global::RefitGeneratorTest.IGeneratedClient + + { + /// + public global::System.Net.Http.HttpClient Client { get; } + readonly global::Refit.IRequestBuilder requestBuilder; + + /// + public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient client, global::Refit.IRequestBuilder requestBuilder) + { + Client = client; + this.requestBuilder = requestBuilder; + } + + + + /// + public async global::System.Threading.Tasks.Task Get() + { + var ______arguments = global::System.Array.Empty(); + var ______func = requestBuilder.BuildRestResultFuncForMethod("Get", global::System.Array.Empty() ); + try + { + return await ((global::System.Threading.Tasks.Task)______func(this.Client, ______arguments)).ConfigureAwait(false); + } + catch (global::System.Exception ______ex) + { + throw ______ex; + } + } + + /// + async global::System.Threading.Tasks.Task global::RefitGeneratorTest.IGeneratedClient.Get() + { + var ______arguments = global::System.Array.Empty(); + var ______func = requestBuilder.BuildRestResultFuncForMethod("Get", global::System.Array.Empty() ); + try + { + return await ((global::System.Threading.Tasks.Task)______func(this.Client, ______arguments)).ConfigureAwait(false); + } + catch (global::System.Exception ______ex) + { + throw ______ex; + } + } + } + } +} + +#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#PreserveAttribute.g.verified.cs b/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#PreserveAttribute.g.verified.cs similarity index 100% rename from Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#PreserveAttribute.g.verified.cs rename to Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#PreserveAttribute.g.verified.cs diff --git a/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitGeneratedAndPreserve.DotNet6_0#IGeneratedClient.g.received.cs b/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitGeneratedAndPreserve.DotNet6_0#IGeneratedClient.g.received.cs new file mode 100644 index 000000000..19a9fc649 --- /dev/null +++ b/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitGeneratedAndPreserve.DotNet6_0#IGeneratedClient.g.received.cs @@ -0,0 +1,66 @@ +//HintName: IGeneratedClient.g.cs +#nullable disable +#pragma warning disable +namespace Refit.Implementation +{ + + partial class Generated + { + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [global::System.Diagnostics.DebuggerNonUserCode] + [global::RefitInternalGenerated.PreserveAttribute] + [global::System.Reflection.Obfuscation(Exclude=true)] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + partial class RefitGeneratorTestIGeneratedClient + : global::RefitGeneratorTest.IGeneratedClient + + { + /// + public global::System.Net.Http.HttpClient Client { get; } + readonly global::Refit.IRequestBuilder requestBuilder; + + /// + public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient client, global::Refit.IRequestBuilder requestBuilder) + { + Client = client; + this.requestBuilder = requestBuilder; + } + + + + /// + public async global::System.Threading.Tasks.Task Get() + { + var ______arguments = global::System.Array.Empty(); + var ______func = requestBuilder.BuildRestResultFuncForMethod("Get", global::System.Array.Empty() ); + try + { + return await ((global::System.Threading.Tasks.Task)______func(this.Client, ______arguments)).ConfigureAwait(false); + } + catch (global::System.Exception ______ex) + { + throw ______ex; + } + } + + /// + async global::System.Threading.Tasks.Task global::RefitGeneratorTest.IGeneratedClient.Get() + { + var ______arguments = global::System.Array.Empty(); + var ______func = requestBuilder.BuildRestResultFuncForMethod("Get", global::System.Array.Empty() ); + try + { + return await ((global::System.Threading.Tasks.Task)______func(this.Client, ______arguments)).ConfigureAwait(false); + } + catch (global::System.Exception ______ex) + { + throw ______ex; + } + } + } + } +} + +#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedNonRefitInterfaceTest#Generated.g.verified.cs b/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedNonRefitInterfaceTest#Generated.g.verified.cs deleted file mode 100644 index 4470d5d71..000000000 --- a/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedNonRefitInterfaceTest#Generated.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: Generated.g.cs - -#pragma warning disable -namespace Refit.Implementation -{ - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::RefitInternalGenerated.PreserveAttribute] - [global::System.Reflection.Obfuscation(Exclude=true)] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static partial class Generated - { -#if NET5_0_OR_GREATER - [System.Runtime.CompilerServices.ModuleInitializer] - [System.Diagnostics.CodeAnalysis.DynamicDependency(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All, typeof(global::Refit.Implementation.Generated))] - public static void Initialize() - { - } -#endif - } -} -#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedNonRefitInterfaceTest#PreserveAttribute.g.verified.cs b/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedNonRefitInterfaceTest#PreserveAttribute.g.verified.cs deleted file mode 100644 index 71b34929f..000000000 --- a/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedNonRefitInterfaceTest#PreserveAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: PreserveAttribute.g.cs - -#pragma warning disable -namespace RefitInternalGenerated -{ - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - [global::System.AttributeUsage (global::System.AttributeTargets.Class | global::System.AttributeTargets.Struct | global::System.AttributeTargets.Enum | global::System.AttributeTargets.Constructor | global::System.AttributeTargets.Method | global::System.AttributeTargets.Property | global::System.AttributeTargets.Field | global::System.AttributeTargets.Event | global::System.AttributeTargets.Interface | global::System.AttributeTargets.Delegate)] - sealed class PreserveAttribute : global::System.Attribute - { - // - // Fields - // - public bool AllMembers; - - public bool Conditional; - } -} -#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedRefitInterfaceTest#Generated.g.verified.cs b/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedRefitInterfaceTest#Generated.g.verified.cs deleted file mode 100644 index 4470d5d71..000000000 --- a/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedRefitInterfaceTest#Generated.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: Generated.g.cs - -#pragma warning disable -namespace Refit.Implementation -{ - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::RefitInternalGenerated.PreserveAttribute] - [global::System.Reflection.Obfuscation(Exclude=true)] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static partial class Generated - { -#if NET5_0_OR_GREATER - [System.Runtime.CompilerServices.ModuleInitializer] - [System.Diagnostics.CodeAnalysis.DynamicDependency(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All, typeof(global::Refit.Implementation.Generated))] - public static void Initialize() - { - } -#endif - } -} -#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedRefitInterfaceTest#PreserveAttribute.g.verified.cs b/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedRefitInterfaceTest#PreserveAttribute.g.verified.cs deleted file mode 100644 index 71b34929f..000000000 --- a/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedRefitInterfaceTest#PreserveAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: PreserveAttribute.g.cs - -#pragma warning disable -namespace RefitInternalGenerated -{ - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - [global::System.AttributeUsage (global::System.AttributeTargets.Class | global::System.AttributeTargets.Struct | global::System.AttributeTargets.Enum | global::System.AttributeTargets.Constructor | global::System.AttributeTargets.Method | global::System.AttributeTargets.Property | global::System.AttributeTargets.Field | global::System.AttributeTargets.Event | global::System.AttributeTargets.Interface | global::System.AttributeTargets.Delegate)] - sealed class PreserveAttribute : global::System.Attribute - { - // - // Fields - // - public bool AllMembers; - - public bool Conditional; - } -} -#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#Generated.g.verified.cs b/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#Generated.g.verified.cs deleted file mode 100644 index 4470d5d71..000000000 --- a/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#Generated.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: Generated.g.cs - -#pragma warning disable -namespace Refit.Implementation -{ - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::RefitInternalGenerated.PreserveAttribute] - [global::System.Reflection.Obfuscation(Exclude=true)] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static partial class Generated - { -#if NET5_0_OR_GREATER - [System.Runtime.CompilerServices.ModuleInitializer] - [System.Diagnostics.CodeAnalysis.DynamicDependency(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All, typeof(global::Refit.Implementation.Generated))] - public static void Initialize() - { - } -#endif - } -} -#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#PreserveAttribute.g.verified.cs b/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#PreserveAttribute.g.verified.cs deleted file mode 100644 index 71b34929f..000000000 --- a/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#PreserveAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: PreserveAttribute.g.cs - -#pragma warning disable -namespace RefitInternalGenerated -{ - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - [global::System.AttributeUsage (global::System.AttributeTargets.Class | global::System.AttributeTargets.Struct | global::System.AttributeTargets.Enum | global::System.AttributeTargets.Constructor | global::System.AttributeTargets.Method | global::System.AttributeTargets.Property | global::System.AttributeTargets.Field | global::System.AttributeTargets.Event | global::System.AttributeTargets.Interface | global::System.AttributeTargets.Delegate)] - sealed class PreserveAttribute : global::System.Attribute - { - // - // Fields - // - public bool AllMembers; - - public bool Conditional; - } -} -#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#Generated.g.verified.cs b/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#Generated.g.verified.cs deleted file mode 100644 index 4470d5d71..000000000 --- a/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#Generated.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: Generated.g.cs - -#pragma warning disable -namespace Refit.Implementation -{ - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::RefitInternalGenerated.PreserveAttribute] - [global::System.Reflection.Obfuscation(Exclude=true)] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static partial class Generated - { -#if NET5_0_OR_GREATER - [System.Runtime.CompilerServices.ModuleInitializer] - [System.Diagnostics.CodeAnalysis.DynamicDependency(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All, typeof(global::Refit.Implementation.Generated))] - public static void Initialize() - { - } -#endif - } -} -#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#PreserveAttribute.g.verified.cs b/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#PreserveAttribute.g.verified.cs deleted file mode 100644 index 71b34929f..000000000 --- a/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#PreserveAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: PreserveAttribute.g.cs - -#pragma warning disable -namespace RefitInternalGenerated -{ - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - [global::System.AttributeUsage (global::System.AttributeTargets.Class | global::System.AttributeTargets.Struct | global::System.AttributeTargets.Enum | global::System.AttributeTargets.Constructor | global::System.AttributeTargets.Method | global::System.AttributeTargets.Property | global::System.AttributeTargets.Field | global::System.AttributeTargets.Event | global::System.AttributeTargets.Interface | global::System.AttributeTargets.Delegate)] - sealed class PreserveAttribute : global::System.Attribute - { - // - // Fields - // - public bool AllMembers; - - public bool Conditional; - } -} -#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#Generated.g.verified.cs b/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#Generated.g.verified.cs deleted file mode 100644 index 4470d5d71..000000000 --- a/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#Generated.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: Generated.g.cs - -#pragma warning disable -namespace Refit.Implementation -{ - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::RefitInternalGenerated.PreserveAttribute] - [global::System.Reflection.Obfuscation(Exclude=true)] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static partial class Generated - { -#if NET5_0_OR_GREATER - [System.Runtime.CompilerServices.ModuleInitializer] - [System.Diagnostics.CodeAnalysis.DynamicDependency(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All, typeof(global::Refit.Implementation.Generated))] - public static void Initialize() - { - } -#endif - } -} -#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#PreserveAttribute.g.verified.cs b/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#PreserveAttribute.g.verified.cs deleted file mode 100644 index 71b34929f..000000000 --- a/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#PreserveAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: PreserveAttribute.g.cs - -#pragma warning disable -namespace RefitInternalGenerated -{ - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - [global::System.AttributeUsage (global::System.AttributeTargets.Class | global::System.AttributeTargets.Struct | global::System.AttributeTargets.Enum | global::System.AttributeTargets.Constructor | global::System.AttributeTargets.Method | global::System.AttributeTargets.Property | global::System.AttributeTargets.Field | global::System.AttributeTargets.Event | global::System.AttributeTargets.Interface | global::System.AttributeTargets.Delegate)] - sealed class PreserveAttribute : global::System.Attribute - { - // - // Fields - // - public bool AllMembers; - - public bool Conditional; - } -} -#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#Generated.g.verified.cs b/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#Generated.g.verified.cs deleted file mode 100644 index 4470d5d71..000000000 --- a/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#Generated.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: Generated.g.cs - -#pragma warning disable -namespace Refit.Implementation -{ - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::RefitInternalGenerated.PreserveAttribute] - [global::System.Reflection.Obfuscation(Exclude=true)] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static partial class Generated - { -#if NET5_0_OR_GREATER - [System.Runtime.CompilerServices.ModuleInitializer] - [System.Diagnostics.CodeAnalysis.DynamicDependency(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All, typeof(global::Refit.Implementation.Generated))] - public static void Initialize() - { - } -#endif - } -} -#pragma warning restore diff --git a/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#PreserveAttribute.g.verified.cs b/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#PreserveAttribute.g.verified.cs deleted file mode 100644 index 71b34929f..000000000 --- a/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#PreserveAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: PreserveAttribute.g.cs - -#pragma warning disable -namespace RefitInternalGenerated -{ - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - [global::System.AttributeUsage (global::System.AttributeTargets.Class | global::System.AttributeTargets.Struct | global::System.AttributeTargets.Enum | global::System.AttributeTargets.Constructor | global::System.AttributeTargets.Method | global::System.AttributeTargets.Property | global::System.AttributeTargets.Field | global::System.AttributeTargets.Event | global::System.AttributeTargets.Interface | global::System.AttributeTargets.Delegate)] - sealed class PreserveAttribute : global::System.Attribute - { - // - // Fields - // - public bool AllMembers; - - public bool Conditional; - } -} -#pragma warning restore