MethodInfo.CreateDelegate 方法

定义

从此方法创建委托。

重载

CreateDelegate(Type)

从此方法创建指定类型的委托。

CreateDelegate(Type, Object)

从此方法创建具有指定目标的指定类型的委托。

CreateDelegate<T>()

从此方法创建 T 类型的委托。

CreateDelegate<T>(Object)

从此方法创建具有指定目标的 T 类型的委托。

CreateDelegate(Type)

Source:
MethodInfo.cs
Source:
MethodInfo.cs
Source:
MethodInfo.cs

从此方法创建指定类型的委托。

public:
 virtual Delegate ^ CreateDelegate(Type ^ delegateType);
public virtual Delegate CreateDelegate (Type delegateType);
abstract member CreateDelegate : Type -> Delegate
override this.CreateDelegate : Type -> Delegate
Public Overridable Function CreateDelegate (delegateType As Type) As Delegate

参数

delegateType
Type

要创建的委托的类型。

返回

此方法的委托。

适用于

CreateDelegate(Type, Object)

Source:
MethodInfo.cs
Source:
MethodInfo.cs
Source:
MethodInfo.cs

从此方法创建具有指定目标的指定类型的委托。

public:
 virtual Delegate ^ CreateDelegate(Type ^ delegateType, System::Object ^ target);
public virtual Delegate CreateDelegate (Type delegateType, object target);
public virtual Delegate CreateDelegate (Type delegateType, object? target);
abstract member CreateDelegate : Type * obj -> Delegate
override this.CreateDelegate : Type * obj -> Delegate
Public Overridable Function CreateDelegate (delegateType As Type, target As Object) As Delegate

参数

delegateType
Type

要创建的委托的类型。

target
Object

由委托将其作为目标的对象。

返回

此方法的委托。

适用于

CreateDelegate<T>()

Source:
MethodInfo.cs
Source:
MethodInfo.cs
Source:
MethodInfo.cs

从此方法创建 T 类型的委托。

public:
generic <typename T>
 where T : Delegate T CreateDelegate();
public T CreateDelegate<T> () where T : Delegate;
member this.CreateDelegate : unit -> 'T (requires 'T :> Delegate)
Public Function CreateDelegate(Of T As Delegate) () As T

类型参数

T

要创建的委托的类型。

返回

T

此方法的委托。

适用于

CreateDelegate<T>(Object)

Source:
MethodInfo.cs
Source:
MethodInfo.cs
Source:
MethodInfo.cs

从此方法创建具有指定目标的 T 类型的委托。

public:
generic <typename T>
 where T : Delegate T CreateDelegate(System::Object ^ target);
public T CreateDelegate<T> (object? target) where T : Delegate;
member this.CreateDelegate : obj -> 'T (requires 'T :> Delegate)
Public Function CreateDelegate(Of T As Delegate) (target As Object) As T

类型参数

T

要创建的委托的类型。

参数

target
Object

由委托将其作为目标的对象。

返回

T

此方法的委托。

适用于