SignatureHelper 類別

定義

提供建置簽章的方法。Provides methods for building signatures.

public ref class SignatureHelper sealed : System::Runtime::InteropServices::_SignatureHelper
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SignatureHelper : System.Runtime.InteropServices._SignatureHelper
type SignatureHelper = class
    interface _SignatureHelper
Public NotInheritable Class SignatureHelper
Implements _SignatureHelper
繼承
SignatureHelper
屬性
實作

備註

使用 SignatureHelper 類別來建立可傳遞至 DynamicILInfo 類別之 SetLocalSignature 方法的簽章 blob。Use the SignatureHelper class to create a signature blob that can be passed to the SetLocalSignature method of the DynamicILInfo class. SignatureHelper 物件也可以傳遞至 ILGenerator.Emit(OpCode, SignatureHelper) 方法多載,以將指令和簽章標記插入 Microsoft 中繼語言(MSIL)資料流程中。A SignatureHelper object can also be passed to the ILGenerator.Emit(OpCode, SignatureHelper) method overload to insert an instruction and a signature token into a Microsoft intermediate language (MSIL) stream. 如需有關簽章 blob 和簽章中繼資料的詳細資訊,請參閱 ECMA Partition II 元資料檔案。For information on signature blobs and signature metadata, see the ECMA Partition II Metadata documentation.

注意

您可以從線上取得 ECMA Partition II 檔;請參閱 MSDN 上的ECMA C#和通用語言基礎結構標準,以及 ECMA International 網站上的標準 Ecma-335-通用語言基礎結構(CLI)The ECMA Partition II documentation is available online; see ECMA C# and Common Language Infrastructure Standards on MSDN and Standard ECMA-335 - Common Language Infrastructure (CLI) on the Ecma International Web site.

方法

AddArgument(Type)

加入引數至簽章。Adds an argument to the signature.

AddArgument(Type, Boolean)

將指定之型別的引數加入簽章,指定該引數是否為固定 (Pin) 。Adds an argument of the specified type to the signature, specifying whether the argument is pinned.

AddArgument(Type, Type[], Type[])

使用指定的自訂修飾詞,將引數加入簽章。Adds an argument to the signature, with the specified custom modifiers.

AddArguments(Type[], Type[][], Type[][])

使用指定的自訂修飾詞,將引數集合加入簽章。Adds a set of arguments to the signature, with the specified custom modifiers.

AddSentinel()

標記 vararg 固定部分的結尾。Marks the end of a vararg fixed part. 只有在呼叫端正在建立 vararg 簽章呼叫站台時,這才會使用。This is only used if the caller is creating a vararg signature call site.

Equals(Object)

檢查這個執行個體 (Instance) 是否等於指定物件。Checks if this instance is equal to the given object.

GetFieldSigHelper(Module)

傳回欄位的簽章 Helper。Returns a signature helper for a field.

GetHashCode()

建立並傳回這個執行個體的雜湊碼。Creates and returns a hash code for this instance.

GetLocalVarSigHelper()

傳回區域變數的簽章 Helper。Returns a signature helper for a local variable.

GetLocalVarSigHelper(Module)

傳回區域變數的簽章 Helper。Returns a signature helper for a local variable.

GetMethodSigHelper(CallingConvention, Type)

傳回方法的簽章 Helper,其會指定模組的 Unmanaged 呼叫慣例和傳回型別。Returns a signature helper for a method given the method's unmanaged calling convention and return type.

GetMethodSigHelper(CallingConventions, Type)

傳回方法的簽章 Helper,其會指定方法的呼叫慣例和傳回型別。Returns a signature helper for a method given the method's calling convention and return type.

GetMethodSigHelper(Module, CallingConvention, Type)

傳回方法的簽章 Helper,其會指定方法的模組、Unmanaged 呼叫慣例和傳回型別。Returns a signature helper for a method given the method's module, unmanaged calling convention, and return type.

GetMethodSigHelper(Module, CallingConventions, Type)

指定方法的模組、呼叫慣例和傳回類型,以傳回方法的簽章協助程式。Returns a signature helper for a method given the method's module, calling convention, and return type.

GetMethodSigHelper(Module, Type, Type[])

傳回方法的簽章 Helper,該方法具有標準的呼叫慣例、指定的方法模組、傳回型別和引數型別。Returns a signature helper for a method with a standard calling convention, given the method's module, return type, and argument types.

GetPropertySigHelper(Module, CallingConventions, Type, Type[], Type[], Type[], Type[][], Type[][])

以指定的動態模組 (其中包含屬性、呼叫慣例、屬性型別、屬性引數以及傳回型別與引數的自訂修飾詞),傳回屬性的簽章 Helper。Returns a signature helper for a property, given the dynamic module that contains the property, the calling convention, the property type, the property arguments, and custom modifiers for the return type and arguments.

GetPropertySigHelper(Module, Type, Type[])

指定包含屬性、屬性型別和屬性引數的動態模組後,傳回屬性的簽章 Helper。Returns a signature helper for a property, given the dynamic module that contains the property, the property type, and the property arguments.

GetPropertySigHelper(Module, Type, Type[], Type[], Type[], Type[][], Type[][])

指定包含屬性、屬性型別、屬性引數和傳回型別與引數之自訂修飾詞的動態模組後,傳回屬性的簽章 Helper。Returns a signature helper for a property, given the dynamic module that contains the property, the property type, the property arguments, and custom modifiers for the return type and arguments.

GetSignature()

加入結尾語彙基元 (Token) 至簽章,並將簽章標記為已完成,如此其他語彙基元便無法再加入。Adds the end token to the signature and marks the signature as finished, so no further tokens can be added.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回表示簽章引數的字串。Returns a string representing the signature arguments.

明確介面實作

_SignatureHelper.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

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

_SignatureHelper.GetTypeInfo(UInt32, UInt32, IntPtr)

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

_SignatureHelper.GetTypeInfoCount(UInt32)

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

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

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

適用於