TypeBuilder.GetCustomAttributes Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the custom attributes defined for this type.
Overloads
GetCustomAttributes(Boolean) |
Returns all the custom attributes defined for this type. |
GetCustomAttributes(Type, Boolean) |
Returns all the custom attributes of the current type that are assignable to a specified type. |
GetCustomAttributes(Boolean)
- Source:
- TypeBuilder.cs
Returns all the custom attributes defined for this type.
public:
override cli::array <System::Object ^> ^ GetCustomAttributes(bool inherit);
public override object[] GetCustomAttributes (bool inherit);
override this.GetCustomAttributes : bool -> obj[]
Public Overrides Function GetCustomAttributes (inherit As Boolean) As Object()
Parameters
- inherit
- Boolean
Specifies whether to search this member's inheritance chain to find the attributes.
Returns
Returns an array of objects representing all the custom attributes of this type.
Exceptions
This method is not currently supported for incomplete types. Retrieve the type using GetType() and call GetCustomAttributes(Boolean) on the returned Type.
Applies to
GetCustomAttributes(Type, Boolean)
- Source:
- TypeBuilder.cs
Returns all the custom attributes of the current type that are assignable to a specified type.
public:
override cli::array <System::Object ^> ^ GetCustomAttributes(Type ^ attributeType, bool inherit);
public override object[] GetCustomAttributes (Type attributeType, bool inherit);
override this.GetCustomAttributes : Type * bool -> obj[]
Public Overrides Function GetCustomAttributes (attributeType As Type, inherit As Boolean) As Object()
Parameters
- attributeType
- Type
The type of attribute to search for. Only attributes that are assignable to this type are returned.
- inherit
- Boolean
Specifies whether to search this member's inheritance chain to find the attributes.
Returns
An array of custom attributes defined on the current type.
Exceptions
This method is not currently supported for incomplete types. Retrieve the type using GetType() and call GetCustomAttributes(Boolean) on the returned Type.
attributeType
is null
.
The type must be a type provided by the underlying runtime system.