SignatureHelper.GetMethodSigHelper 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個方法的簽名助手。
多載
| 名稱 | Description |
|---|---|
| GetMethodSigHelper(Module, Type, Type[]) |
回傳一個帶有標準呼叫慣例的方法的簽章輔助工具,根據方法的模組、回傳類型和參數類型。 |
| GetMethodSigHelper(Module, CallingConvention, Type) |
根據方法的模組、非管理呼叫慣例及回傳類型,回傳一個簽章輔助工具。 |
| GetMethodSigHelper(CallingConvention, Type) |
根據方法的非管理呼叫慣例與回傳類型,回傳一個簽章輔助工具。 |
| GetMethodSigHelper(CallingConventions, Type) |
根據方法的呼叫慣例與回傳類型,回傳一個簽章輔助工具。 |
| GetMethodSigHelper(Module, CallingConventions, Type) |
根據方法的模組、呼叫慣例和回傳類型,回傳一個簽章輔助工具。 |
GetMethodSigHelper(Module, Type, Type[])
回傳一個帶有標準呼叫慣例的方法的簽章輔助工具,根據方法的模組、回傳類型和參數類型。
public:
static System::Reflection::Emit::SignatureHelper ^ GetMethodSigHelper(System::Reflection::Module ^ mod, Type ^ returnType, cli::array <Type ^> ^ parameterTypes);
public static System.Reflection.Emit.SignatureHelper GetMethodSigHelper(System.Reflection.Module? mod, Type? returnType, Type[]? parameterTypes);
public static System.Reflection.Emit.SignatureHelper GetMethodSigHelper(System.Reflection.Module mod, Type returnType, Type[] parameterTypes);
static member GetMethodSigHelper : System.Reflection.Module * Type * Type[] -> System.Reflection.Emit.SignatureHelper
Public Shared Function GetMethodSigHelper (mod As Module, returnType As Type, parameterTypes As Type()) As SignatureHelper
參數
- mod
- Module
其中 ModuleBuilder that 包含了被請求的方法 SignatureHelper 。
- returnType
- Type
方法是回傳類型,或空迴轉類型null(Visual Basic中Sub程序)。
- parameterTypes
- Type[]
方法是方法的參數類型,或 null 是方法是否沒有參數。
傳回
方法的 SignatureHelper 物件。
例外狀況
mod 不是 ModuleBuilder。
備註
此過載會產生帶有標準呼叫慣例的簽章。
要建立帶有自訂修飾符的方法簽名,先使用 method GetMethodSigHelper(Module, CallingConventions, Type) overload,然後再用 AddArgument(Type, Type[], Type[]) or AddArguments(Type[], Type[][], Type[][]) 方法覆蓋來加入帶有自訂修飾符的參數。
適用於
GetMethodSigHelper(Module, CallingConvention, Type)
根據方法的模組、非管理呼叫慣例及回傳類型,回傳一個簽章輔助工具。
public:
static System::Reflection::Emit::SignatureHelper ^ GetMethodSigHelper(System::Reflection::Module ^ mod, System::Runtime::InteropServices::CallingConvention unmanagedCallConv, Type ^ returnType);
public static System.Reflection.Emit.SignatureHelper GetMethodSigHelper(System.Reflection.Module mod, System.Runtime.InteropServices.CallingConvention unmanagedCallConv, Type returnType);
static member GetMethodSigHelper : System.Reflection.Module * System.Runtime.InteropServices.CallingConvention * Type -> System.Reflection.Emit.SignatureHelper
Public Shared Function GetMethodSigHelper (mod As Module, unmanagedCallConv As CallingConvention, returnType As Type) As SignatureHelper
參數
- mod
- Module
其中 ModuleBuilder that 包含了被請求的方法 SignatureHelper 。
- unmanagedCallConv
- CallingConvention
方法是方法的非管理呼叫慣例。
- returnType
- Type
方法是回傳類型,或空迴轉類型null(Visual Basic中Sub程序)。
傳回
方法的 SignatureHelper 物件。
例外狀況
mod 是 null。
適用於
GetMethodSigHelper(CallingConvention, Type)
根據方法的非管理呼叫慣例與回傳類型,回傳一個簽章輔助工具。
public:
static System::Reflection::Emit::SignatureHelper ^ GetMethodSigHelper(System::Runtime::InteropServices::CallingConvention unmanagedCallingConvention, Type ^ returnType);
public static System.Reflection.Emit.SignatureHelper GetMethodSigHelper(System.Runtime.InteropServices.CallingConvention unmanagedCallingConvention, Type returnType);
static member GetMethodSigHelper : System.Runtime.InteropServices.CallingConvention * Type -> System.Reflection.Emit.SignatureHelper
Public Shared Function GetMethodSigHelper (unmanagedCallingConvention As CallingConvention, returnType As Type) As SignatureHelper
參數
- unmanagedCallingConvention
- CallingConvention
方法是方法的非管理呼叫慣例。
- returnType
- Type
方法是回傳類型,或空迴轉類型null(Visual Basic中Sub程序)。
傳回
方法的 SignatureHelper 物件。
例外狀況
unmanagedCallingConvention 是一個未知的非管理呼叫慣例。
適用於
GetMethodSigHelper(CallingConventions, Type)
根據方法的呼叫慣例與回傳類型,回傳一個簽章輔助工具。
public:
static System::Reflection::Emit::SignatureHelper ^ GetMethodSigHelper(System::Reflection::CallingConventions callingConvention, Type ^ returnType);
public static System.Reflection.Emit.SignatureHelper GetMethodSigHelper(System.Reflection.CallingConventions callingConvention, Type? returnType);
public static System.Reflection.Emit.SignatureHelper GetMethodSigHelper(System.Reflection.CallingConventions callingConvention, Type returnType);
static member GetMethodSigHelper : System.Reflection.CallingConventions * Type -> System.Reflection.Emit.SignatureHelper
Public Shared Function GetMethodSigHelper (callingConvention As CallingConventions, returnType As Type) As SignatureHelper
參數
- callingConvention
- CallingConventions
方法的呼叫慣例。
- returnType
- Type
方法是回傳類型,或空迴轉類型null(Visual Basic中Sub程序)。
傳回
方法的 SignatureHelper 物件。
適用於
GetMethodSigHelper(Module, CallingConventions, Type)
根據方法的模組、呼叫慣例和回傳類型,回傳一個簽章輔助工具。
public:
static System::Reflection::Emit::SignatureHelper ^ GetMethodSigHelper(System::Reflection::Module ^ mod, System::Reflection::CallingConventions callingConvention, Type ^ returnType);
public static System.Reflection.Emit.SignatureHelper GetMethodSigHelper(System.Reflection.Module? mod, System.Reflection.CallingConventions callingConvention, Type? returnType);
public static System.Reflection.Emit.SignatureHelper GetMethodSigHelper(System.Reflection.Module mod, System.Reflection.CallingConventions callingConvention, Type returnType);
static member GetMethodSigHelper : System.Reflection.Module * System.Reflection.CallingConventions * Type -> System.Reflection.Emit.SignatureHelper
Public Shared Function GetMethodSigHelper (mod As Module, callingConvention As CallingConventions, returnType As Type) As SignatureHelper
參數
- mod
- Module
其中 ModuleBuilder that 包含了被請求的方法 SignatureHelper 。
- callingConvention
- CallingConventions
方法的呼叫慣例。
- returnType
- Type
方法是回傳類型,或空迴轉類型null(Visual Basic中Sub程序)。
傳回
方法的 SignatureHelper 物件。
例外狀況
mod 是 null。
mod 不是 ModuleBuilder。