MemberInfoExtensions.GetMetadataToken(MemberInfo) Method

Definition

Gets a metadata token for the given member, if available.Gets a metadata token for the given member, if available.

public:
[System::Runtime::CompilerServices::Extension]
 static int GetMetadataToken(System::Reflection::MemberInfo ^ member);
public static int GetMetadataToken (this System.Reflection.MemberInfo member);
static member GetMetadataToken : System.Reflection.MemberInfo -> int
<Extension()>
Public Function GetMetadataToken (member As MemberInfo) As Integer

Parameters

member
MemberInfo

The member from which to retrieve the token, as reftype.The member from which to retrieve the token, as reftype.

Returns

Int32

An integer representing the metadata token.An integer representing the metadata token. The returned token is never nil.The returned token is never nil. If unavailable, an exception is thrown.If unavailable, an exception is thrown.

Exceptions

There is no metadata token available.There is no metadata token available.

Remarks

Этот метод создает исключение, если маркер метаданных недоступен для указанного элемента.This method throws an exception if a metadata token is not available for the specified member. Можно вызвать HasMetadataToken, чтобы определить, доступен ли маркер метаданных перед вызовом этого метода.You can call HasMetadataToken to determine whether a metadata token is available before calling this method.

Applies to