-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy .NET 9 attribute sources from
dotnet/runtime
.
- Loading branch information
1 parent
d519f71
commit 32ac9c8
Showing
6 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...beddedResources/RuntimeSupported/System.Diagnostics.CodeAnalysis.FeatureGuardAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Diagnostics.CodeAnalysis | ||
{ | ||
/// <summary> | ||
/// Indicates that the specified public static boolean get-only property | ||
/// guards access to the specified feature. | ||
/// </summary> | ||
/// <remarks> | ||
/// Analyzers can use this to prevent warnings on calls to code that is | ||
/// annotated as requiring that feature, when the callsite is guarded by a | ||
/// call to the property. | ||
/// </remarks> | ||
[AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = true)] | ||
#if SYSTEM_PRIVATE_CORELIB | ||
public | ||
#else | ||
internal | ||
#endif | ||
sealed class FeatureGuardAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="FeatureGuardAttribute"/> class | ||
/// with the specified feature type. | ||
/// </summary> | ||
/// <param name="featureType"> | ||
/// The type that represents the feature guarded by the property. | ||
/// </param> | ||
public FeatureGuardAttribute(Type featureType) | ||
{ | ||
FeatureType = featureType; | ||
} | ||
|
||
/// <summary> | ||
/// The type that represents the feature guarded by the property. | ||
/// </summary> | ||
public Type FeatureType { get; } | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...rces/RuntimeSupported/System.Diagnostics.CodeAnalysis.FeatureSwitchDefinitionAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Diagnostics.CodeAnalysis | ||
{ | ||
/// <summary> | ||
/// Indicates that the specified public static boolean get-only property | ||
/// corresponds to the feature switch specified by name. | ||
/// </summary> | ||
/// <remarks> | ||
/// IL rewriters and compilers can use this to substitute the return value | ||
/// of the specified property with the value of the feature switch. | ||
/// </remarks> | ||
[AttributeUsage(AttributeTargets.Property, Inherited = false)] | ||
#if SYSTEM_PRIVATE_CORELIB | ||
public | ||
#else | ||
internal | ||
#endif | ||
sealed class FeatureSwitchDefinitionAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="FeatureSwitchDefinitionAttribute"/> class | ||
/// with the specified feature switch name. | ||
/// </summary> | ||
/// <param name="switchName"> | ||
/// The name of the feature switch that provides the value for the specified property. | ||
/// </param> | ||
public FeatureSwitchDefinitionAttribute(string switchName) | ||
{ | ||
SwitchName = switchName; | ||
} | ||
|
||
/// <summary> | ||
/// The name of the feature switch that provides the value for the specified property. | ||
/// </summary> | ||
public string SwitchName { get; } | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...es/RuntimeSupported/System.Diagnostics.DebuggerDisableUserUnhandledExceptionsAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Diagnostics | ||
{ | ||
/// <summary> | ||
/// If a .NET Debugger is attached which supports the Debugger.BreakForUserUnhandledException(Exception) API, | ||
/// this attribute will prevent the debugger from breaking on user-unhandled exceptions when the | ||
/// exception is caught by a method with this attribute, unless BreakForUserUnhandledException is called. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Method)] | ||
public sealed class DebuggerDisableUserUnhandledExceptionsAttribute : Attribute | ||
{ | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...edResources/RuntimeSupported/System.Runtime.InteropServices.WasmImportLinkageAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Runtime.InteropServices | ||
{ | ||
/// <summary> | ||
/// Specifies that the P/Invoke marked with this attribute should be linked in as a WASM import. | ||
/// </summary> | ||
/// <remarks> | ||
/// See https://webassembly.github.io/spec/core/syntax/modules.html#imports. | ||
/// </remarks> | ||
[AttributeUsage(AttributeTargets.Method, Inherited = false)] | ||
public sealed class WasmImportLinkageAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// Instance constructor. | ||
/// </summary> | ||
public WasmImportLinkageAttribute() { } | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
.../EmbeddedResources/System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
/// <summary> | ||
/// Specifies the priority of a member in overload resolution. When unspecified, the default priority is 0. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] | ||
public sealed class OverloadResolutionPriorityAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="OverloadResolutionPriorityAttribute"/> class. | ||
/// </summary> | ||
/// <param name="priority">The priority of the attributed member. Higher numbers are prioritized, lower numbers are deprioritized. 0 is the default if no attribute is present.</param> | ||
public OverloadResolutionPriorityAttribute(int priority) | ||
{ | ||
Priority = priority; | ||
} | ||
|
||
/// <summary> | ||
/// The priority of the member. | ||
/// </summary> | ||
public int Priority { get; } | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...eGenerators/EmbeddedResources/System.Runtime.CompilerServices.ParamCollectionAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
/// <summary> | ||
/// Indicates that a method will allow a variable number of arguments in its invocation. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)] | ||
public sealed class ParamCollectionAttribute : Attribute | ||
{ | ||
} | ||
} |