AttributeUsageAttribute Constructor
.NET Framework 2.0
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)
Assembly: mscorlib (in mscorlib.dll)
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.
namespace System.Runtime.InteropServices { [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] public class DispIdAttribute: System.Attribute { public DispIdAttribute(int value) { // . . . } public int Value { get { // . . . return 0; } } } }
/** @attribute AttributeUsage(AttributeTargets.Method | AttributeTargets.Field |
AttributeTargets.Property)
*/
public class DispIdAttribute extends System.Attribute
{
public DispIdAttribute(int value)
{
//. . .
} //DispIdAttribute
/** @property
*/
public int get_Value()
{
//. . .
return 0;
}//get_Value
} //DispIdAttribute
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.