System.Attribute

Represents the base class for custom attributes.


Inherits from: System.Object

Properties

Property Name Property Type Description
TypeId System.Object When implemented in a derived class, gets a unique identifier for this attribute.

Methods

Method Name Description
Equals(obj As Object) As Boolean Returns a value that indicates whether this instance is equal to a specified object.
Parameters
obj
          Type: Object
          An to compare with this instance or null.
GetCustomAttribute(element As MemberInfo, attributeType As Type) As Attribute Retrieves a custom attribute applied to a member of a type. Parameters specify the member, and the type of the custom attribute to search for.
Parameters
element
          Type: MemberInfo
          An object derived from the class that describes a constructor, event, field, method, or property member of a class.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
GetCustomAttribute(element As MemberInfo, attributeType As Type, inherit As Boolean) As Attribute Retrieves a custom attribute applied to a member of a type. Parameters specify the member, the type of the custom attribute to search for, and whether to search ancestors of the member.
Parameters
element
          Type: MemberInfo
          An object derived from the class that describes a constructor, event, field, method, or property member of a class.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
 
inherit
          Type: Boolean
          If true, specifies to also search the ancestors of for custom attributes.
GetCustomAttribute(element As ParameterInfo, attributeType As Type) As Attribute Retrieves a custom attribute applied to a method parameter. Parameters specify the method parameter, and the type of the custom attribute to search for.
Parameters
element
          Type: ParameterInfo
          An object derived from the class that describes a parameter of a member of a class.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
GetCustomAttribute(element As ParameterInfo, attributeType As Type, inherit As Boolean) As Attribute Retrieves a custom attribute applied to a method parameter. Parameters specify the method parameter, the type of the custom attribute to search for, and whether to search ancestors of the method parameter.
Parameters
element
          Type: ParameterInfo
          An object derived from the class that describes a parameter of a member of a class.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
 
inherit
          Type: Boolean
          If true, specifies to also search the ancestors of for custom attributes.
GetCustomAttribute(element As Module, attributeType As Type) As Attribute Retrieves a custom attribute applied to a module. Parameters specify the module, and the type of the custom attribute to search for.
Parameters
element
          Type: Module
          An object derived from the class that describes a portable executable file.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
GetCustomAttribute(element As Module, attributeType As Type, inherit As Boolean) As Attribute Retrieves a custom attribute applied to a module. Parameters specify the module, the type of the custom attribute to search for, and an ignored search option.
Parameters
element
          Type: Module
          An object derived from the class that describes a portable executable file.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
 
inherit
          Type: Boolean
          This parameter is ignored, and does not affect the operation of this method.
GetCustomAttribute(element As Assembly, attributeType As Type) As Attribute Retrieves a custom attribute applied to a specified assembly. Parameters specify the assembly and the type of the custom attribute to search for.
Parameters
element
          Type: Assembly
          An object derived from the class that describes a reusable collection of modules.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
GetCustomAttribute(element As Assembly, attributeType As Type, inherit As Boolean) As Attribute Retrieves a custom attribute applied to an assembly. Parameters specify the assembly, the type of the custom attribute to search for, and an ignored search option.
Parameters
element
          Type: Assembly
          An object derived from the class that describes a reusable collection of modules.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
 
inherit
          Type: Boolean
          This parameter is ignored, and does not affect the operation of this method.
GetCustomAttributes(element As MemberInfo, type As Type) As Attribute()() Retrieves an array of the custom attributes applied to a member of a type. Parameters specify the member, and the type of the custom attribute to search for.
Parameters
element
          Type: MemberInfo
          An object derived from the class that describes a constructor, event, field, method, or property member of a class.
 
type
          Type: Type
          The type, or a base type, of the custom attribute to search for.
GetCustomAttributes(element As MemberInfo, type As Type, inherit As Boolean) As Attribute()() Retrieves an array of the custom attributes applied to a member of a type. Parameters specify the member, the type of the custom attribute to search for, and whether to search ancestors of the member.
Parameters
element
          Type: MemberInfo
          An object derived from the class that describes a constructor, event, field, method, or property member of a class.
 
type
          Type: Type
          The type, or a base type, of the custom attribute to search for.
 
inherit
          Type: Boolean
          If true, specifies to also search the ancestors of for custom attributes.
GetCustomAttributes(element As MemberInfo) As Attribute()() Retrieves an array of the custom attributes applied to a member of a type. A parameter specifies the member.
Parameters
element
          Type: MemberInfo
          An object derived from the class that describes a constructor, event, field, method, or property member of a class.
GetCustomAttributes(element As MemberInfo, inherit As Boolean) As Attribute()() Retrieves an array of the custom attributes applied to a member of a type. Parameters specify the member, the type of the custom attribute to search for, and whether to search ancestors of the member.
Parameters
element
          Type: MemberInfo
          An object derived from the class that describes a constructor, event, field, method, or property member of a class.
 
inherit
          Type: Boolean
          If true, specifies to also search the ancestors of for custom attributes.
GetCustomAttributes(element As ParameterInfo) As Attribute()() Retrieves an array of the custom attributes applied to a method parameter. A parameter specifies the method parameter.
Parameters
element
          Type: ParameterInfo
          An object derived from the class that describes a parameter of a member of a class.
GetCustomAttributes(element As ParameterInfo, attributeType As Type) As Attribute()() Retrieves an array of the custom attributes applied to a method parameter. Parameters specify the method parameter, and the type of the custom attribute to search for.
Parameters
element
          Type: ParameterInfo
          An object derived from the class that describes a parameter of a member of a class.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
GetCustomAttributes(element As ParameterInfo, attributeType As Type, inherit As Boolean) As Attribute()() Retrieves an array of the custom attributes applied to a method parameter. Parameters specify the method parameter, the type of the custom attribute to search for, and whether to search ancestors of the method parameter.
Parameters
element
          Type: ParameterInfo
          An object derived from the class that describes a parameter of a member of a class.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
 
inherit
          Type: Boolean
          If true, specifies to also search the ancestors of for custom attributes.
GetCustomAttributes(element As ParameterInfo, inherit As Boolean) As Attribute()() Retrieves an array of the custom attributes applied to a method parameter. Parameters specify the method parameter, and whether to search ancestors of the method parameter.
Parameters
element
          Type: ParameterInfo
          An object derived from the class that describes a parameter of a member of a class.
 
inherit
          Type: Boolean
          If true, specifies to also search the ancestors of for custom attributes.
GetCustomAttributes(element As Module, attributeType As Type) As Attribute()() Retrieves an array of the custom attributes applied to a module. Parameters specify the module, and the type of the custom attribute to search for.
Parameters
element
          Type: Module
          An object derived from the class that describes a portable executable file.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
GetCustomAttributes(element As Module) As Attribute()() Retrieves an array of the custom attributes applied to a module. A parameter specifies the module.
Parameters
element
          Type: Module
          An object derived from the class that describes a portable executable file.
GetCustomAttributes(element As Module, inherit As Boolean) As Attribute()() Retrieves an array of the custom attributes applied to a module. Parameters specify the module, and an ignored search option.
Parameters
element
          Type: Module
          An object derived from the class that describes a portable executable file.
 
inherit
          Type: Boolean
          This parameter is ignored, and does not affect the operation of this method.
GetCustomAttributes(element As Module, attributeType As Type, inherit As Boolean) As Attribute()() Retrieves an array of the custom attributes applied to a module. Parameters specify the module, the type of the custom attribute to search for, and an ignored search option.
Parameters
element
          Type: Module
          An object derived from the class that describes a portable executable file.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
 
inherit
          Type: Boolean
          This parameter is ignored, and does not affect the operation of this method.
GetCustomAttributes(element As Assembly, attributeType As Type) As Attribute()() Retrieves an array of the custom attributes applied to an assembly. Parameters specify the assembly, and the type of the custom attribute to search for.
Parameters
element
          Type: Assembly
          An object derived from the class that describes a reusable collection of modules.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
GetCustomAttributes(element As Assembly, attributeType As Type, inherit As Boolean) As Attribute()() Retrieves an array of the custom attributes applied to an assembly. Parameters specify the assembly, the type of the custom attribute to search for, and an ignored search option.
Parameters
element
          Type: Assembly
          An object derived from the class that describes a reusable collection of modules.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
 
inherit
          Type: Boolean
          This parameter is ignored, and does not affect the operation of this method.
GetCustomAttributes(element As Assembly) As Attribute()() Retrieves an array of the custom attributes applied to an assembly. A parameter specifies the assembly.
Parameters
element
          Type: Assembly
          An object derived from the class that describes a reusable collection of modules.
GetCustomAttributes(element As Assembly, inherit As Boolean) As Attribute()() Retrieves an array of the custom attributes applied to an assembly. Parameters specify the assembly, and an ignored search option.
Parameters
element
          Type: Assembly
          An object derived from the class that describes a reusable collection of modules.
 
inherit
          Type: Boolean
          This parameter is ignored, and does not affect the operation of this method.
GetHashCode() As Int32 Returns the hash code for this instance.
IsDefaultAttribute() As Boolean When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
IsDefined(element As MemberInfo, attributeType As Type) As Boolean Determines whether any custom attributes are applied to a member of a type. Parameters specify the member, and the type of the custom attribute to search for.
Parameters
element
          Type: MemberInfo
          An object derived from the class that describes a constructor, event, field, method, type, or property member of a class.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
IsDefined(element As MemberInfo, attributeType As Type, inherit As Boolean) As Boolean Determines whether any custom attributes are applied to a member of a type. Parameters specify the member, the type of the custom attribute to search for, and whether to search ancestors of the member.
Parameters
element
          Type: MemberInfo
          An object derived from the class that describes a constructor, event, field, method, type, or property member of a class.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
 
inherit
          Type: Boolean
          If true, specifies to also search the ancestors of for custom attributes.
IsDefined(element As ParameterInfo, attributeType As Type) As Boolean Determines whether any custom attributes are applied to a method parameter. Parameters specify the method parameter, and the type of the custom attribute to search for.
Parameters
element
          Type: ParameterInfo
          An object derived from the class that describes a parameter of a member of a class.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
IsDefined(element As ParameterInfo, attributeType As Type, inherit As Boolean) As Boolean Determines whether any custom attributes are applied to a method parameter. Parameters specify the method parameter, the type of the custom attribute to search for, and whether to search ancestors of the method parameter.
Parameters
element
          Type: ParameterInfo
          An object derived from the class that describes a parameter of a member of a class.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
 
inherit
          Type: Boolean
          If true, specifies to also search the ancestors of for custom attributes.
IsDefined(element As Module, attributeType As Type) As Boolean Determines whether any custom attributes of a specified type are applied to a module. Parameters specify the module, and the type of the custom attribute to search for.
Parameters
element
          Type: Module
          An object derived from the class that describes a portable executable file.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
IsDefined(element As Module, attributeType As Type, inherit As Boolean) As Boolean Determines whether any custom attributes are applied to a module. Parameters specify the module, the type of the custom attribute to search for, and an ignored search option.
Parameters
element
          Type: Module
          An object derived from the class that describes a portable executable file.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
 
inherit
          Type: Boolean
          This parameter is ignored, and does not affect the operation of this method.
IsDefined(element As Assembly, attributeType As Type) As Boolean Determines whether any custom attributes are applied to an assembly. Parameters specify the assembly, and the type of the custom attribute to search for.
Parameters
element
          Type: Assembly
          An object derived from the class that describes a reusable collection of modules.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
IsDefined(element As Assembly, attributeType As Type, inherit As Boolean) As Boolean Determines whether any custom attributes are applied to an assembly. Parameters specify the assembly, the type of the custom attribute to search for, and an ignored search option.
Parameters
element
          Type: Assembly
          An object derived from the class that describes a reusable collection of modules.
 
attributeType
          Type: Type
          The type, or a base type, of the custom attribute to search for.
 
inherit
          Type: Boolean
          This parameter is ignored, and does not affect the operation of this method.
Match(obj As Object) As Boolean When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
Parameters
obj
          Type: Object
          An to compare with this instance of .