AttributeUsageAttribute Constructor
Collapse the table of content
Expand the table of content

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.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Sub New ( _
	validOn As AttributeTargets _
)

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


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft