MethodInfo MethodInfo MethodInfo MethodInfo Class

定義

探索方法的屬性 (Attribute) 並提供方法中繼資料 (Metadata) 的存取。Discovers the attributes of a method and provides access to method metadata.

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

備註

MethodInfo類別代表類型的方法。The MethodInfo class represents a method of a type. 您可以使用MethodInfo物件取得該物件所代表之方法的相關資訊,並叫用方法。You can use a MethodInfo object to obtain information about the method that the object represents and to invoke the method. 例如:For example:

您可以具現化MethodInfo藉由呼叫的執行個體Type.GetMethods或是Type.GetMethod方法,或藉由呼叫MethodInfo.MakeGenericMethod方法MethodInfo物件,代表泛型方法定義。You can instantiate a MethodInfo instances by calling the Type.GetMethods or Type.GetMethod method, or by calling the MethodInfo.MakeGenericMethod method of a MethodInfo object that represents a generic method definition.

如需泛型的方法特定的恆成立條件,請參閱IsGenericMethod屬性。For a list of the invariant conditions for terms specific to generic methods, see the IsGenericMethod property. 如需泛型反映中所使用的其他詞彙的非變異條件的清單,請參閱IsGenericType屬性。For a list of the invariant conditions for other terms used in generic reflection, see the IsGenericType property.

給繼承者的注意事項

當您繼承自MethodInfo,您必須覆寫GetBaseDefinition()ReturnTypeReturnTypeCustomAttributesGetParameters()GetMethodImplementationFlags()MethodHandleAttributesInvoke(Object, BindingFlags, Binder, Object[], CultureInfo)NameMemberTypeDeclaringTypeReflectedTypeGetCustomAttributes(Boolean)GetCustomAttributes(Type, Boolean),和IsDefined(Type, Boolean)When you inherit from MethodInfo, you must override GetBaseDefinition(), ReturnType, ReturnTypeCustomAttributes, GetParameters(), GetMethodImplementationFlags(), MethodHandle, Attributes, Invoke(Object, BindingFlags, Binder, Object[], CultureInfo), Name, MemberType, DeclaringType, ReflectedType, GetCustomAttributes(Boolean), GetCustomAttributes(Type, Boolean), and IsDefined(Type, Boolean).

建構函式

MethodInfo() MethodInfo() MethodInfo() MethodInfo()

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

屬性

Attributes Attributes Attributes Attributes

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

(Inherited from MethodBase)
CallingConvention CallingConvention CallingConvention CallingConvention

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

(Inherited from MethodBase)
ContainsGenericParameters ContainsGenericParameters ContainsGenericParameters ContainsGenericParameters

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

(Inherited from MethodBase)
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.

(Inherited from MethodBase)
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.

(Inherited from MethodBase)
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 Inherited from MethodBase
IsConstructor IsConstructor IsConstructor IsConstructor

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

(Inherited from MethodBase)
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.

(Inherited from MethodBase)
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.

(Inherited from MethodBase)
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.

(Inherited from MethodBase)
IsFinal IsFinal IsFinal IsFinal

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

(Inherited from MethodBase)
IsGenericMethod IsGenericMethod IsGenericMethod IsGenericMethod

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

IsGenericMethodDefinition IsGenericMethodDefinition IsGenericMethodDefinition IsGenericMethodDefinition

取得值,指出目前的 MethodInfo 是否表示泛型方法的定義。Gets a value indicating whether the current MethodInfo represents the definition of a generic method.

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.

(Inherited from MethodBase)
IsPrivate IsPrivate IsPrivate IsPrivate

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

(Inherited from MethodBase)
IsPublic IsPublic IsPublic IsPublic

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

(Inherited from MethodBase)
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.

(Inherited from MethodBase)
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.

(Inherited from MethodBase)
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.

(Inherited from MethodBase)
IsSpecialName IsSpecialName IsSpecialName IsSpecialName

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

(Inherited from MethodBase)
IsStatic IsStatic IsStatic IsStatic

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

(Inherited from MethodBase)
IsVirtual IsVirtual IsVirtual IsVirtual

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

(Inherited from MethodBase)
MemberType MemberType MemberType MemberType

取得 MemberTypes 值,表示這個成員為方法。Gets a MemberTypes value indicating that this member is a method.

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.

(Inherited from MethodBase)
MethodImplementationFlags MethodImplementationFlags MethodImplementationFlags MethodImplementationFlags

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

(Inherited from MethodBase)
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)
ReturnParameter ReturnParameter ReturnParameter ReturnParameter

取得 ParameterInfo 物件,其中含有方法之傳回型別的相關資訊,例如傳回型別是否含有自訂修飾詞 (Modifier)。Gets a ParameterInfo object that contains information about the return type of the method, such as whether the return type has custom modifiers.

ReturnType ReturnType ReturnType ReturnType

取得這個方法的傳回型別 (Return Type)。Gets the return type of this method.

ReturnTypeCustomAttributes ReturnTypeCustomAttributes ReturnTypeCustomAttributes ReturnTypeCustomAttributes

取得傳回型別的自訂屬性。Gets the custom attributes for the return type.

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

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

(Inherited from MethodBase)
_MethodBase.IsAssembly _MethodBase.IsAssembly _MethodBase.IsAssembly _MethodBase.IsAssembly

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

(Inherited from MethodBase)
_MethodBase.IsConstructor _MethodBase.IsConstructor _MethodBase.IsConstructor _MethodBase.IsConstructor

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

(Inherited from MethodBase)
_MethodBase.IsFamily _MethodBase.IsFamily _MethodBase.IsFamily _MethodBase.IsFamily

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

(Inherited from MethodBase)
_MethodBase.IsFamilyAndAssembly _MethodBase.IsFamilyAndAssembly _MethodBase.IsFamilyAndAssembly _MethodBase.IsFamilyAndAssembly

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

(Inherited from MethodBase)
_MethodBase.IsFamilyOrAssembly _MethodBase.IsFamilyOrAssembly _MethodBase.IsFamilyOrAssembly _MethodBase.IsFamilyOrAssembly

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

(Inherited from MethodBase)
_MethodBase.IsFinal _MethodBase.IsFinal _MethodBase.IsFinal _MethodBase.IsFinal

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

(Inherited from MethodBase)
_MethodBase.IsHideBySig _MethodBase.IsHideBySig _MethodBase.IsHideBySig _MethodBase.IsHideBySig

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

(Inherited from MethodBase)
_MethodBase.IsPrivate _MethodBase.IsPrivate _MethodBase.IsPrivate _MethodBase.IsPrivate

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

(Inherited from MethodBase)
_MethodBase.IsPublic _MethodBase.IsPublic _MethodBase.IsPublic _MethodBase.IsPublic

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

(Inherited from MethodBase)
_MethodBase.IsSpecialName _MethodBase.IsSpecialName _MethodBase.IsSpecialName _MethodBase.IsSpecialName

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

(Inherited from MethodBase)
_MethodBase.IsStatic _MethodBase.IsStatic _MethodBase.IsStatic _MethodBase.IsStatic

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

(Inherited from MethodBase)
_MethodBase.IsVirtual _MethodBase.IsVirtual _MethodBase.IsVirtual _MethodBase.IsVirtual

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

(Inherited from MethodBase)

方法

CreateDelegate(Type) CreateDelegate(Type) CreateDelegate(Type) CreateDelegate(Type)

從這個方法建立所指定類型的委派。Creates a delegate of the specified type from this method.

CreateDelegate(Type, Object) CreateDelegate(Type, Object) CreateDelegate(Type, Object) CreateDelegate(Type, Object)

從這個方法以指定的目標建立所指定類型的委派。Creates a delegate of the specified type with the specified target from this method.

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

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

GetBaseDefinition() GetBaseDefinition() GetBaseDefinition() GetBaseDefinition()

在衍生類別中覆寫時,為直接或間接基底類別 (也就是這個執行個體所代表的方法第一次被宣告的地方) 中的方法傳回 MethodInfo 物件。When overridden in a derived class, returns the MethodInfo object for the method on the direct or indirect base class in which the method represented by this instance was first declared.

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.

GetGenericMethodDefinition() GetGenericMethodDefinition() GetGenericMethodDefinition() GetGenericMethodDefinition()

傳回表示泛型方法定義的 MethodInfo 物件,利用此泛型方法定義就可以建構出目前的方法。Returns a MethodInfo object that represents a generic method definition from which the current method can be constructed.

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.

(Inherited from MethodBase)
GetMethodImplementationFlags() GetMethodImplementationFlags() GetMethodImplementationFlags() GetMethodImplementationFlags()

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

(Inherited from MethodBase)
GetParameters() GetParameters() GetParameters() GetParameters()

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

(Inherited from MethodBase)
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.

(Inherited from MethodBase)
Invoke(Object, Object[]) Invoke(Object, Object[]) Invoke(Object, Object[]) Invoke(Object, Object[])
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)
MakeGenericMethod(Type[]) MakeGenericMethod(Type[]) MakeGenericMethod(Type[]) MakeGenericMethod(Type[])

使用類型陣列的項目取代目前泛型方法定義的類型參數,並傳回代表所產生之建構方法的 MethodInfo 物件。Substitutes the elements of an array of types for the type parameters of the current generic method definition, and returns a MethodInfo object representing the resulting constructed method.

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(MethodInfo, MethodInfo) Equality(MethodInfo, MethodInfo) Equality(MethodInfo, MethodInfo) Equality(MethodInfo, MethodInfo)

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

Inequality(MethodInfo, MethodInfo) Inequality(MethodInfo, MethodInfo) Inequality(MethodInfo, MethodInfo) Inequality(MethodInfo, MethodInfo)

表示兩個 MethodInfo 物件是否不相等。Indicates whether two MethodInfo 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.

(Inherited from MethodBase)
_MethodBase.GetType() _MethodBase.GetType() _MethodBase.GetType() _MethodBase.GetType()

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

(Inherited from MethodBase)
_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.

(Inherited from MethodBase)
_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).

(Inherited from MethodBase)
_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.

(Inherited from MethodBase)
_MethodInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MethodInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MethodInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MethodInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

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

_MethodInfo.GetType() _MethodInfo.GetType() _MethodInfo.GetType() _MethodInfo.GetType()

提供 COM 之 GetType() 方法的存取。Provides access to the GetType() method from COM.

_MethodInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _MethodInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _MethodInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _MethodInfo.GetTypeInfo(UInt32, UInt32, IntPtr)

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

_MethodInfo.GetTypeInfoCount(UInt32) _MethodInfo.GetTypeInfoCount(UInt32) _MethodInfo.GetTypeInfoCount(UInt32) _MethodInfo.GetTypeInfoCount(UInt32)

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

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

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

Extension Methods

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)
HasMetadataToken(MemberInfo) HasMetadataToken(MemberInfo) HasMetadataToken(MemberInfo) HasMetadataToken(MemberInfo)
GetBaseDefinition(MethodInfo) GetBaseDefinition(MethodInfo) GetBaseDefinition(MethodInfo) GetBaseDefinition(MethodInfo)
GetRuntimeBaseDefinition(MethodInfo) GetRuntimeBaseDefinition(MethodInfo) GetRuntimeBaseDefinition(MethodInfo) GetRuntimeBaseDefinition(MethodInfo)

擷取物件,表示直接或間接基底類別上的指定方法 (在這個類別上首次宣告這個方法)。Retrieves an object that represents the specified method on the direct or indirect base class where the method was first declared.

安全性

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

適用於

執行緒安全性

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

另請參閱