Class AttributeUsageAttribute
Specifies the usage of another attribute class. This class cannot be inherited.
Inherited Members
Namespace: System
Assembly: mscorlib.dll
Syntax
[AttributeUsage(AttributeTargets.Class)]
public sealed class AttributeUsageAttribute : Attribute
Constructors
| Improve this Doc View SourceAttributeUsageAttribute(AttributeTargets)
Initializes a new instance of the AttributeUsageAttribute class with the specified list of AttributeTargets, the AllowMultiple value, and the Inherited value.
Declaration
public AttributeUsageAttribute(AttributeTargets validOn)
Parameters
Type | Name | Description |
---|---|---|
AttributeTargets | validOn | The set of values combined using a bitwise OR operation to indicate which program elements are valid. |
Properties
| Improve this Doc View SourceAllowMultiple
Gets or sets a Boolean value indicating whether more than one instance of the indicated attribute can be specified for a single program element.
Declaration
public bool AllowMultiple { get; set; }
Property Value
Type | Description |
---|---|
Boolean | true if more than one instance is allowed to be specified; otherwise, false. The default is false. |
Inherited
Gets or sets a Boolean value that determines whether the indicated attribute is inherited by derived classes and overriding members.
Declaration
public bool Inherited { get; set; }
Property Value
Type | Description |
---|---|
Boolean | true if the attribute can be inherited by derived classes and overriding members; otherwise, false. The default is true. |
ValidOn
Gets a set of values identifying which program elements that the indicated attribute can be applied to.
Declaration
public AttributeTargets ValidOn { get; }
Property Value
Type | Description |
---|---|
AttributeTargets | One or several AttributeTargets values. The default is All. |