DynamicMethod.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 applied to the method.
Overloads
GetCustomAttributes(Boolean) |
Returns all the custom attributes defined for the method. |
GetCustomAttributes(Type, Boolean) |
Returns the custom attributes of the specified type that have been applied to the method. |
GetCustomAttributes(Boolean)
- Source:
- DynamicMethod.cs
- Source:
- DynamicMethod.cs
- Source:
- DynamicMethod.cs
Returns all the custom attributes defined for the 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
true
to search the method's inheritance chain to find the custom attributes; false
to check only the current method.
Returns
An array of objects representing all the custom attributes of the method.
Remarks
For dynamic methods, specifying true
for inherit
has no effect, because the method is not declared in a type.
Note
Custom attributes are not currently supported on dynamic methods. The only attribute returned is MethodImplAttribute; you can get the method implementation flags more easily using the GetMethodImplementationFlags method.
See also
Applies to
GetCustomAttributes(Type, Boolean)
- Source:
- DynamicMethod.cs
- Source:
- DynamicMethod.cs
- Source:
- DynamicMethod.cs
Returns the custom attributes of the specified type that have been applied to the method.
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
- inherit
- Boolean
true
to search the method's inheritance chain to find the custom attributes; false
to check only the current method.
Returns
An array of objects representing the attributes of the method that are of type attributeType
or derive from type attributeType
.
Exceptions
attributeType
is null
.
Remarks
For dynamic methods, specifying true
for inherit
has no effect, because the method is not declared in a type.
Note
Custom attributes are not currently supported on dynamic methods. The only attribute returned is MethodImplAttribute; you can get the method implementation flags more easily using the GetMethodImplementationFlags method.
See also
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기