Skip to content

Commit 145046f

Browse files
authored
Add FeatureSwitchDefinitionAttribute
1 parent d58a69c commit 145046f

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

src/Consume/Consume.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class Consume
5050
type = typeof(CallerArgumentExpressionAttribute);
5151
type = typeof(IsExternalInit);
5252
type = typeof(FeatureGuardAttribute);
53+
type = typeof(FeatureSwitchDefinitionAttribute);
5354
type = typeof(ModuleInitializerAttribute);
5455
type = typeof(RequiredMemberAttribute);
5556
type = typeof(SetsRequiredMembersAttribute);
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// <auto-generated />
2+
#pragma warning disable
3+
4+
#if !NET9_0_OR_GREATER
5+
6+
namespace System.Diagnostics.CodeAnalysis;
7+
8+
using Diagnostics;
9+
using Diagnostics.CodeAnalysis;
10+
using Link = ComponentModel.DescriptionAttribute;
11+
12+
13+
/// <summary>
14+
/// [AttributeUsage(AttributeTargets.Property, Inherited = false)]
15+
/// </summary>
16+
[ExcludeFromCodeCoverage]
17+
[DebuggerNonUserCode]
18+
[AttributeUsage(AttributeTargets.Property, Inherited = false)]
19+
//Link:https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.featureswitchdefinitionattribute
20+
#if PolyPublic
21+
public
22+
#endif
23+
sealed class FeatureSwitchDefinitionAttribute : Attribute
24+
{
25+
/// <summary>
26+
/// Initializes a new instance of the <see cref="FeatureSwitchDefinitionAttribute"/> class
27+
/// with the specified feature switch name.
28+
/// </summary>
29+
/// <param name="switchName">
30+
/// The name of the feature switch that provides the value for the specified property.
31+
/// </param>
32+
public FeatureSwitchDefinitionAttribute(string switchName)
33+
{
34+
SwitchName = switchName;
35+
}
36+
37+
/// <summary>
38+
/// The name of the feature switch that provides the value for the specified property.
39+
/// </summary>
40+
public string SwitchName { get; }
41+
}
42+
43+
#endif

0 commit comments

Comments
 (0)