MethodBuilder.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 method.
Overloads
GetCustomAttributes(Boolean) |
Returns all the custom attributes defined for this method. |
GetCustomAttributes(Type, Boolean) |
Returns the custom attributes identified by the given type. |
GetCustomAttributes(Boolean)
- Source:
- MethodBuilder.cs
Returns all the custom attributes defined for this method.
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 custom attributes.
Returns
Returns an array of objects representing all the custom attributes of this method.
Exceptions
This method is not currently supported. Retrieve the method using GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) and call GetCustomAttributes(Boolean) on the returned MethodInfo.
Applies to
GetCustomAttributes(Type, Boolean)
- Source:
- MethodBuilder.cs
Returns the custom attributes identified by the given 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 custom attribute type.
- inherit
- Boolean
Specifies whether to search this member's inheritance chain to find the custom attributes.
Returns
Returns an array of objects representing the attributes of this method that are of type attributeType
.
Exceptions
This method is not currently supported. Retrieve the method using GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) and call GetCustomAttributes(Boolean) on the returned MethodInfo.