AttributeUsageAttribute Constructor
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Initializes a new instance of the AttributeUsageAttribute class with the specified list of AttributeTargets, the AllowMultiple value, and the Inherited value.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- validOn
- Type: System.AttributeTargets
The set of values combined using a bitwise OR operation to indicate which program elements are valid.
You can combine several AttributeTargets values using a bitwise OR operation to get the desired combination of valid program elements.
For default property values, see the ValidOn, AllowMultiple, and Inherited properties.
The definition of the DispId attribute illustrates the use of a bitwise OR operation to combine several AttributeTargets values.
Imports System <AttributeUsage(AttributeTargets.Method _ Or AttributeTargets.Field _ Or AttributeTargets.Property)> _ Public Class DispIdAttribute Inherits System.Attribute Public Sub New(ByVal value As Integer) ' . . . End Sub Public ReadOnly Property Value() As Integer Get ' . . . Return 0 End Get End Property End Class