MulticastDelegate 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 MulticastDelegate 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| MulticastDelegate(Object, String) |
初始化 MulticastDelegate 類別的新執行個體。 |
| MulticastDelegate(Type, String) |
初始化 MulticastDelegate 類別的新執行個體。 |
MulticastDelegate(Object, String)
初始化 MulticastDelegate 類別的新執行個體。
protected:
MulticastDelegate(System::Object ^ target, System::String ^ method);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")]
protected MulticastDelegate(object target, string method);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")>]
new MulticastDelegate : obj * string -> MulticastDelegate
Protected Sub New (target As Object, method As String)
參數
- target
- Object
定義的對象 method 。
- method
- String
代表所屬的方法名稱。
- 屬性
例外狀況
無法建立抽象類的實例,或使用晚期綁定機制叫用這個成員。
備註
此建構函數無法用於應用程式程式碼。 若要透過指定實例方法名稱來建立代理,請使用該方法的超載 Delegate.CreateDelegate ,指定方法名稱與目標物件。 例如, Delegate.CreateDelegate(Type, Object, String) 方法過載會為一個具有指定名稱的實例方法建立代理。
適用於
MulticastDelegate(Type, String)
初始化 MulticastDelegate 類別的新執行個體。
protected:
MulticastDelegate(Type ^ target, System::String ^ method);
protected MulticastDelegate(Type target, string method);
new MulticastDelegate : Type * string -> MulticastDelegate
Protected Sub New (target As Type, method As String)
參數
- target
- Type
定義在物件上的類型 method 。
- method
- String
建立代理的靜態方法名稱。
例外狀況
無法建立抽象類的實例,或使用晚期綁定機制叫用這個成員。
備註
此建構函數無法用於應用程式程式碼。 若要透過指定靜態方法名稱來建立代理,請使用該方法的超載 Delegate.CreateDelegate ,該方法指定了方法名稱,但未指定目標物件。 例如,方法過載會 Delegate.CreateDelegate(Type, Type, String) 為指定名稱的方法建立一個靜態代理。