MethodBase MethodBase MethodBase MethodBase Class

定義

提供有關方法和建構函式的資訊。Provides information about methods and constructors.

public ref class MethodBase abstract : System::Reflection::MemberInfo, System::Runtime::InteropServices::_MethodBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public abstract class MethodBase : System.Reflection.MemberInfo, System.Runtime.InteropServices._MethodBase
type MethodBase = class
    inherit MemberInfo
    interface _MethodBase
Public MustInherit Class MethodBase
Inherits MemberInfo
Implements _MethodBase
繼承
衍生
屬性
實作

備註

MethodBaseMethodInfoConstructorInfo的基類。MethodBase is the base class of MethodInfo and ConstructorInfo.

給繼承者的注意事項

當您繼承自MethodBase時,您必須覆寫下列成員GetParameters()Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)GetMethodImplementationFlags()MethodHandleAttributesNameDeclaringTypeMemberType ReflectedType、、 GetCustomAttributes(Boolean) 、、 GetCustomAttributes(Type, Boolean)和。IsDefined(Type, Boolean)When you inherit from MethodBase, you must override the following members: GetParameters(), Invoke(Object, BindingFlags, Binder, Object[], CultureInfo), GetMethodImplementationFlags(), MethodHandle, Attributes, Name, DeclaringType, MemberType, ReflectedType, GetCustomAttributes(Boolean), GetCustomAttributes(Type, Boolean), and IsDefined(Type, Boolean).

建構函式

MethodBase() MethodBase() MethodBase() MethodBase()

初始化 MethodBase 類別的新執行個體。Initializes a new instance of the MethodBase class.

屬性

Attributes Attributes Attributes Attributes

取得與這個方法相關的屬性 (Attribute)。Gets the attributes associated with this method.

CallingConvention CallingConvention CallingConvention CallingConvention

取得值,指出這個方法的呼叫慣例。Gets a value indicating the calling conventions for this method.

ContainsGenericParameters ContainsGenericParameters ContainsGenericParameters ContainsGenericParameters

取得值,指出泛型方法是否包含未指派的泛型型別參數。Gets a value indicating whether the generic method contains unassigned generic type parameters.

CustomAttributes CustomAttributes CustomAttributes CustomAttributes

取得包含此成員之自訂屬性的集合。Gets a collection that contains this member's custom attributes.

(Inherited from MemberInfo)
DeclaringType DeclaringType DeclaringType DeclaringType

取得宣告這個成員的類別。Gets the class that declares this member.

(Inherited from MemberInfo)
IsAbstract IsAbstract IsAbstract IsAbstract

取得值,指出方法是否為抽象。Gets a value indicating whether the method is abstract.

IsAssembly IsAssembly IsAssembly IsAssembly

取得值,指出 Assembly 是否描述此方法或建構函式 (Constructor) 的潛在可視性;亦即,最多只有相同組件 (Assembly) 中的其他型別可以看見該方法或建構函式,組件外部的衍生型別 (Derived Type) 則看不見它們。Gets a value indicating whether the potential visibility of this method or constructor is described by Assembly; that is, the method or constructor is visible at most to other types in the same assembly, and is not visible to derived types outside the assembly.

IsCollectible IsCollectible IsCollectible IsCollectible

取得指出此 MemberInfo 物件是否為可回收 AssemblyLoadContext 中保存之組件一部分的值。Gets a value that indicates whether this MemberInfo object is part of an assembly held in a collectible AssemblyLoadContext.

(Inherited from MemberInfo)
IsConstructedGenericMethod IsConstructedGenericMethod IsConstructedGenericMethod IsConstructedGenericMethod
IsConstructor IsConstructor IsConstructor IsConstructor

取得值,指出方法是否為建構函示。Gets a value indicating whether the method is a constructor.

IsFamily IsFamily IsFamily IsFamily

取得值,指出 Family 是否描述此方法或建構函式的可視性;亦即,您只能在其類別和衍生類別內看見該方法或建構函式。Gets a value indicating whether the visibility of this method or constructor is described by Family; that is, the method or constructor is visible only within its class and derived classes.

IsFamilyAndAssembly IsFamilyAndAssembly IsFamilyAndAssembly IsFamilyAndAssembly

取得值,指出 FamANDAssem 是否描述此方法或建構函式的可視性;亦即,只有當該方法或建構函式位於相同的組件時,衍生類別才能呼叫它們。Gets a value indicating whether the visibility of this method or constructor is described by FamANDAssem; that is, the method or constructor can be called by derived classes, but only if they are in the same assembly.

IsFamilyOrAssembly IsFamilyOrAssembly IsFamilyOrAssembly IsFamilyOrAssembly

取得值,指出 FamORAssem 是否描述此方法或建構函式的潛在可視性;亦即,無論該方法或建構函式位於何處,衍生類別以及相同組件中的類別都可以呼叫它們。Gets a value indicating whether the potential visibility of this method or constructor is described by FamORAssem; that is, the method or constructor can be called by derived classes wherever they are, and by classes in the same assembly.

IsFinal IsFinal IsFinal IsFinal

取得值,指出這個方法是否為 finalGets a value indicating whether this method is final.

IsGenericMethod IsGenericMethod IsGenericMethod IsGenericMethod

取得值,指出方法是否為泛型。Gets a value indicating whether the method is generic.

IsGenericMethodDefinition IsGenericMethodDefinition IsGenericMethodDefinition IsGenericMethodDefinition

取得值,指出方法是否為泛型方法定義。Gets a value indicating whether the method is a generic method definition.

IsHideBySig IsHideBySig IsHideBySig IsHideBySig

取得值,指出是否只有簽章完全一樣的同類成員隱藏於衍生類別中。Gets a value indicating whether only a member of the same kind with exactly the same signature is hidden in the derived class.

IsPrivate IsPrivate IsPrivate IsPrivate

取得值,指出這個成員是否為私用的 (Private)。Gets a value indicating whether this member is private.

IsPublic IsPublic IsPublic IsPublic

取得值,指出這是否為公用的方法。Gets a value indicating whether this is a public method.

IsSecurityCritical IsSecurityCritical IsSecurityCritical IsSecurityCritical

取得值,這個值表示目前方法或建構函式在目前信任層級上是否為安全性關鍵或安全性安全關鍵,因而可以執行重要的作業。Gets a value that indicates whether the current method or constructor is security-critical or security-safe-critical at the current trust level, and therefore can perform critical operations.

IsSecuritySafeCritical IsSecuritySafeCritical IsSecuritySafeCritical IsSecuritySafeCritical

取得值,這個值表示目前方法或建構函式在目前信任層級上是否為安全性安全關鍵,也就是說,它是否可以執行重要作業並且可供透明程式碼存取。Gets a value that indicates whether the current method or constructor is security-safe-critical at the current trust level; that is, whether it can perform critical operations and can be accessed by transparent code.

IsSecurityTransparent IsSecurityTransparent IsSecurityTransparent IsSecurityTransparent

取得值,這個值表示目前方法或建構函式在目前信任層級上是否為透明,因此不得執行重要作業。Gets a value that indicates whether the current method or constructor is transparent at the current trust level, and therefore cannot perform critical operations.

IsSpecialName IsSpecialName IsSpecialName IsSpecialName

取得值,指出這個方法是否有特別的名稱。Gets a value indicating whether this method has a special name.

IsStatic IsStatic IsStatic IsStatic

取得值指出方法是否為 staticGets a value indicating whether the method is static.

IsVirtual IsVirtual IsVirtual IsVirtual

取得值指出方法是否為 virtualGets a value indicating whether the method is virtual.

MemberType MemberType MemberType MemberType

在衍生類別中覆寫時,取得 MemberTypes 值,指出成員類型︰方法、建構函式、事件等。When overridden in a derived class, gets a MemberTypes value indicating the type of the member - method, constructor, event, and so on.

(Inherited from MemberInfo)
MetadataToken MetadataToken MetadataToken MetadataToken

取得值,這個值可識別中繼資料項目。Gets a value that identifies a metadata element.

(Inherited from MemberInfo)
MethodHandle MethodHandle MethodHandle MethodHandle

取得方法內部中繼資料 (Metadata) 表示的控制代碼。Gets a handle to the internal metadata representation of a method.

MethodImplementationFlags MethodImplementationFlags MethodImplementationFlags MethodImplementationFlags

取得 MethodImplAttributes 旗標,這些旗標會指定方法實作的屬性。Gets the MethodImplAttributes flags that specify the attributes of a method implementation.

Module Module Module Module

取得用於定義型別的模組,該型別宣告以目前 MemberInfo 表示的成員。Gets the module in which the type that declares the member represented by the current MemberInfo is defined.

(Inherited from MemberInfo)
Name Name Name Name

取得目前成員的名稱。Gets the name of the current member.

(Inherited from MemberInfo)
ReflectedType ReflectedType ReflectedType ReflectedType

取得類別物件,是用來取得這個 MemberInfo 的執行個體。Gets the class object that was used to obtain this instance of MemberInfo.

(Inherited from MemberInfo)

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

傳回值,這個值指出此執行個體是否與指定的物件相等。Returns a value that indicates whether this instance is equal to a specified object.

GetCurrentMethod() GetCurrentMethod() GetCurrentMethod() GetCurrentMethod()

傳回代表目前執行方法的 MethodBase 物件。Returns a MethodBase object representing the currently executing method.

GetCustomAttributes(Boolean) GetCustomAttributes(Boolean) GetCustomAttributes(Boolean) GetCustomAttributes(Boolean)

在衍生類別中覆寫時,傳回套用至此成員之所有自訂屬性的陣列。When overridden in a derived class, returns an array of all custom attributes applied to this member.

(Inherited from MemberInfo)
GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean)

當在衍生的類別中覆寫時,會傳回套用至這個成員的自訂屬性陣列,並以 Type 識別。When overridden in a derived class, returns an array of custom attributes applied to this member and identified by Type.

(Inherited from MemberInfo)
GetCustomAttributesData() GetCustomAttributesData() GetCustomAttributesData() GetCustomAttributesData()

傳回 CustomAttributeData 物件的清單,表示已套用至目標成員之屬性的資料。Returns a list of CustomAttributeData objects representing data about the attributes that have been applied to the target member.

(Inherited from MemberInfo)
GetGenericArguments() GetGenericArguments() GetGenericArguments() GetGenericArguments()

傳回 Type 物件的陣列,這些物件表示泛型方法的型別引數,或泛型方法定義的型別參數。Returns an array of Type objects that represent the type arguments of a generic method or the type parameters of a generic method definition.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回這個執行個體的雜湊碼。Returns the hash code for this instance.

GetMethodBody() GetMethodBody() GetMethodBody() GetMethodBody()

在衍生類別中覆寫時,取得 MethodBody 物件,其提供對目前方法之 MSIL 資料流、區域變數和例外狀況的存取。When overridden in a derived class, gets a MethodBody object that provides access to the MSIL stream, local variables, and exceptions for the current method.

GetMethodFromHandle(RuntimeMethodHandle) GetMethodFromHandle(RuntimeMethodHandle) GetMethodFromHandle(RuntimeMethodHandle) GetMethodFromHandle(RuntimeMethodHandle)

利用方法的內部中繼資料表示 (控制代碼) 取得方法資訊。Gets method information by using the method's internal metadata representation (handle).

GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle) GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle) GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle) GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle)

針對指定的泛型型別,取得指定的控制代碼所表示之建構函式或方法的 MethodBase 物件。Gets a MethodBase object for the constructor or method represented by the specified handle, for the specified generic type.

GetMethodImplementationFlags() GetMethodImplementationFlags() GetMethodImplementationFlags() GetMethodImplementationFlags()

在衍生類別中覆寫時,傳回 MethodImplAttributes 旗標。When overridden in a derived class, returns the MethodImplAttributes flags.

GetParameters() GetParameters() GetParameters() GetParameters()

在衍生類別中覆寫時,取得指定方法或建構函式的參數。When overridden in a derived class, gets the parameters of the specified method or constructor.

GetType() GetType() GetType() GetType()
HasSameMetadataDefinitionAs(MemberInfo) HasSameMetadataDefinitionAs(MemberInfo) HasSameMetadataDefinitionAs(MemberInfo) HasSameMetadataDefinitionAs(MemberInfo) Inherited from MemberInfo
Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

在衍生類別中覆寫時,需使用指定的參數叫用反映的方法或建構函式。When overridden in a derived class, invokes the reflected method or constructor with the given parameters.

Invoke(Object, Object[]) Invoke(Object, Object[]) Invoke(Object, Object[]) Invoke(Object, Object[])

使用指定的參數叫用由目前執行個體代表的方法或建構函式。Invokes the method or constructor represented by the current instance, using the specified parameters.

IsDefined(Type, Boolean) IsDefined(Type, Boolean) IsDefined(Type, Boolean) IsDefined(Type, Boolean)

在衍生類別中覆寫時,表示是否已有一個或多個具有指定型別或其衍生型別的屬性套用至這個成員。When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member.

(Inherited from MemberInfo)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

運算子

Equality(MethodBase, MethodBase) Equality(MethodBase, MethodBase) Equality(MethodBase, MethodBase) Equality(MethodBase, MethodBase)

表示兩個 MethodBase 物件是否相等。Indicates whether two MethodBase objects are equal.

Inequality(MethodBase, MethodBase) Inequality(MethodBase, MethodBase) Inequality(MethodBase, MethodBase) Inequality(MethodBase, MethodBase)

表示兩個 MethodBase 物件是否不相等。Indicates whether two MethodBase objects are not equal.

明確介面實作

ICustomAttributeProvider.GetCustomAttributes(Boolean) ICustomAttributeProvider.GetCustomAttributes(Boolean) ICustomAttributeProvider.GetCustomAttributes(Boolean) ICustomAttributeProvider.GetCustomAttributes(Boolean) Inherited from MemberInfo
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) Inherited from MemberInfo
ICustomAttributeProvider.IsDefined(Type, Boolean) ICustomAttributeProvider.IsDefined(Type, Boolean) ICustomAttributeProvider.IsDefined(Type, Boolean) ICustomAttributeProvider.IsDefined(Type, Boolean) Inherited from MemberInfo
_MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。Maps a set of names to a corresponding set of dispatch identifiers.

(Inherited from MemberInfo)
_MemberInfo.GetType() _MemberInfo.GetType() _MemberInfo.GetType() _MemberInfo.GetType()

取得 Type 物件,表示 MemberInfo 類別。Gets a Type object representing the MemberInfo class.

(Inherited from MemberInfo)
_MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr)

擷取物件的類型資訊,可以用來取得介面的類型資訊。Retrieves the type information for an object, which can then be used to get the type information for an interface.

(Inherited from MemberInfo)
_MemberInfo.GetTypeInfoCount(UInt32) _MemberInfo.GetTypeInfoCount(UInt32) _MemberInfo.GetTypeInfoCount(UInt32) _MemberInfo.GetTypeInfoCount(UInt32)

擷取物件提供的類型資訊介面數目 (0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(Inherited from MemberInfo)
_MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供物件所公開的屬性和方法的存取權。Provides access to properties and methods exposed by an object.

(Inherited from MemberInfo)
_MethodBase.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MethodBase.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MethodBase.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MethodBase.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。Maps a set of names to a corresponding set of dispatch identifiers.

_MethodBase.GetType() _MethodBase.GetType() _MethodBase.GetType() _MethodBase.GetType()

如需這個成員的說明,請參閱 GetType()For a description of this member, see GetType().

_MethodBase.GetTypeInfo(UInt32, UInt32, IntPtr) _MethodBase.GetTypeInfo(UInt32, UInt32, IntPtr) _MethodBase.GetTypeInfo(UInt32, UInt32, IntPtr) _MethodBase.GetTypeInfo(UInt32, UInt32, IntPtr)

擷取物件的類型資訊,可以用來取得介面的類型資訊。Retrieves the type information for an object, which can then be used to get the type information for an interface.

_MethodBase.GetTypeInfoCount(UInt32) _MethodBase.GetTypeInfoCount(UInt32) _MethodBase.GetTypeInfoCount(UInt32) _MethodBase.GetTypeInfoCount(UInt32)

擷取物件提供的類型資訊介面數目 (0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

_MethodBase.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MethodBase.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MethodBase.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MethodBase.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供物件所公開的屬性和方法的存取權。Provides access to properties and methods exposed by an object.

_MethodBase.IsAbstract _MethodBase.IsAbstract _MethodBase.IsAbstract _MethodBase.IsAbstract

如需這個成員的說明,請參閱 IsAbstractFor a description of this member, see IsAbstract.

_MethodBase.IsAssembly _MethodBase.IsAssembly _MethodBase.IsAssembly _MethodBase.IsAssembly

如需這個成員的說明,請參閱 IsAssemblyFor a description of this member, see IsAssembly.

_MethodBase.IsConstructor _MethodBase.IsConstructor _MethodBase.IsConstructor _MethodBase.IsConstructor

如需這個成員的說明,請參閱 IsConstructorFor a description of this member, see IsConstructor.

_MethodBase.IsFamily _MethodBase.IsFamily _MethodBase.IsFamily _MethodBase.IsFamily

如需這個成員的說明,請參閱 IsFamilyFor a description of this member, see IsFamily.

_MethodBase.IsFamilyAndAssembly _MethodBase.IsFamilyAndAssembly _MethodBase.IsFamilyAndAssembly _MethodBase.IsFamilyAndAssembly

如需這個成員的說明,請參閱 IsFamilyAndAssemblyFor a description of this member, see IsFamilyAndAssembly.

_MethodBase.IsFamilyOrAssembly _MethodBase.IsFamilyOrAssembly _MethodBase.IsFamilyOrAssembly _MethodBase.IsFamilyOrAssembly

如需這個成員的說明,請參閱 IsFamilyOrAssemblyFor a description of this member, see IsFamilyOrAssembly.

_MethodBase.IsFinal _MethodBase.IsFinal _MethodBase.IsFinal _MethodBase.IsFinal

如需這個成員的說明,請參閱 IsFinalFor a description of this member, see IsFinal.

_MethodBase.IsHideBySig _MethodBase.IsHideBySig _MethodBase.IsHideBySig _MethodBase.IsHideBySig

如需這個成員的說明,請參閱 IsHideBySigFor a description of this member, see IsHideBySig.

_MethodBase.IsPrivate _MethodBase.IsPrivate _MethodBase.IsPrivate _MethodBase.IsPrivate

如需這個成員的說明,請參閱 IsPrivateFor a description of this member, see IsPrivate.

_MethodBase.IsPublic _MethodBase.IsPublic _MethodBase.IsPublic _MethodBase.IsPublic

如需這個成員的說明,請參閱 IsPublicFor a description of this member, see IsPublic.

_MethodBase.IsSpecialName _MethodBase.IsSpecialName _MethodBase.IsSpecialName _MethodBase.IsSpecialName

如需這個成員的說明,請參閱 IsSpecialNameFor a description of this member, see IsSpecialName.

_MethodBase.IsStatic _MethodBase.IsStatic _MethodBase.IsStatic _MethodBase.IsStatic

如需這個成員的說明,請參閱 IsStaticFor a description of this member, see IsStatic.

_MethodBase.IsVirtual _MethodBase.IsVirtual _MethodBase.IsVirtual _MethodBase.IsVirtual

如需這個成員的說明,請參閱 IsVirtualFor a description of this member, see IsVirtual.

擴充方法

GetCustomAttribute(MemberInfo, Type) GetCustomAttribute(MemberInfo, Type) GetCustomAttribute(MemberInfo, Type) GetCustomAttribute(MemberInfo, Type)

擷取指定型別的自訂屬性,此屬性套用至指定成員。Retrieves a custom attribute of a specified type that is applied to a specified member.

GetCustomAttribute(MemberInfo, Type, Boolean) GetCustomAttribute(MemberInfo, Type, Boolean) GetCustomAttribute(MemberInfo, Type, Boolean) GetCustomAttribute(MemberInfo, Type, Boolean)

擷取只訂型別的自訂屬性,此屬性套用至指定成員,並且可選擇性檢查該成員的祖系。Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttribute<T>(MemberInfo) GetCustomAttribute<T>(MemberInfo) GetCustomAttribute<T>(MemberInfo) GetCustomAttribute<T>(MemberInfo)

擷取指定型別的自訂屬性,此屬性套用至指定成員。Retrieves a custom attribute of a specified type that is applied to a specified member.

GetCustomAttribute<T>(MemberInfo, Boolean) GetCustomAttribute<T>(MemberInfo, Boolean) GetCustomAttribute<T>(MemberInfo, Boolean) GetCustomAttribute<T>(MemberInfo, Boolean)

擷取只訂型別的自訂屬性,此屬性套用至指定成員,並且可選擇性檢查該成員的祖系。Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttributes(MemberInfo) GetCustomAttributes(MemberInfo) GetCustomAttributes(MemberInfo) GetCustomAttributes(MemberInfo)

擷取套用至指定成員的自訂屬性集合。Retrieves a collection of custom attributes that are applied to a specified member.

GetCustomAttributes(MemberInfo, Boolean) GetCustomAttributes(MemberInfo, Boolean) GetCustomAttributes(MemberInfo, Boolean) GetCustomAttributes(MemberInfo, Boolean)

擷取自訂屬性集合,此集合套用至指定成員,並且可選擇性檢查該成員的祖系。Retrieves a collection of custom attributes that are applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttributes(MemberInfo, Type) GetCustomAttributes(MemberInfo, Type) GetCustomAttributes(MemberInfo, Type) GetCustomAttributes(MemberInfo, Type)

擷取指定型別的自訂屬性集合,此集合套用至指定成員。Retrieves a collection of custom attributes of a specified type that are applied to a specified member.

GetCustomAttributes(MemberInfo, Type, Boolean) GetCustomAttributes(MemberInfo, Type, Boolean) GetCustomAttributes(MemberInfo, Type, Boolean) GetCustomAttributes(MemberInfo, Type, Boolean)

擷取指定型別的自訂屬性集合,此集合套用至指定成員,並且可選擇性檢查該成員的祖系。Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttributes<T>(MemberInfo) GetCustomAttributes<T>(MemberInfo) GetCustomAttributes<T>(MemberInfo) GetCustomAttributes<T>(MemberInfo)

擷取指定型別的自訂屬性集合,此集合套用至指定成員。Retrieves a collection of custom attributes of a specified type that are applied to a specified member.

GetCustomAttributes<T>(MemberInfo, Boolean) GetCustomAttributes<T>(MemberInfo, Boolean) GetCustomAttributes<T>(MemberInfo, Boolean) GetCustomAttributes<T>(MemberInfo, Boolean)

擷取指定型別的自訂屬性集合,此集合套用至指定成員,並且可選擇性檢查該成員的祖系。Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member.

IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type)

指出是否將所指定型別的自訂屬性套用至指定的成員。Indicates whether custom attributes of a specified type are applied to a specified member.

IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean)

指出指定之型別的自訂屬性是否會套用至指定的成員,以及選擇性地套用到其上階。Indicates whether custom attributes of a specified type are applied to a specified member, and, optionally, applied to its ancestors.

GetMetadataToken(MemberInfo) GetMetadataToken(MemberInfo) GetMetadataToken(MemberInfo) GetMetadataToken(MemberInfo)

取得指定成員的中繼資料語彙基元 (如果有)。Gets a metadata token for the given member, if available.

HasMetadataToken(MemberInfo) HasMetadataToken(MemberInfo) HasMetadataToken(MemberInfo) HasMetadataToken(MemberInfo)

傳回值,指出所指定成員是否有可用的中繼資料語彙基元。Returns a value that indicates whether a metadata token is available for the specified member.

安全性

InheritanceDemand
適用於繼承者的完全信任的。for full trust for inheritors. 此類別無法由部分信任程式碼繼承。This class cannot be inherited by partially trusted code.

適用於

執行緒安全性

此型別具備執行緒安全。This type is thread safe.