MemberInfoExtensions.HasMetadataToken(MemberInfo) MemberInfoExtensions.HasMetadataToken(MemberInfo) MemberInfoExtensions.HasMetadataToken(MemberInfo) MemberInfoExtensions.HasMetadataToken(MemberInfo) Method

定义

返回表示元数据令牌是否可用于指定的成员的值。Returns a value that indicates whether a metadata token is available for the specified member.

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

参数

member
MemberInfo MemberInfo MemberInfo MemberInfo

要分析的作为 reftype 的成员。The member to analyze, as reftype.

返回

如果为给定成员提供可用的元数据令牌,则为 true;否则为 falsetrue if there is a metadata token available for the given member; otherwise, false.

注解

GetMetadataToken如果元数据标记不适用于指定的成员, 则引发异常。GetMetadataToken throws an exception if a metadata token is not available for the specified member. 因此, 请使用此方法在调用GetMetadataToken之前确定元数据令牌是否可用。So use this method to determine whether a metadata token is available before calling GetMetadataToken.

适用于