DispatchProxy.Create<T,TProxy> 方法

定义

创建一个派生自类 TProxy 的对象实例,并实现接口 TCreates an object instance that derives from class TProxy and implements interface T.

public:
generic <typename T, typename TProxy>
 where TProxy : System::Reflection::DispatchProxy static T Create();
public static T Create<T,TProxy> () where TProxy : System.Reflection.DispatchProxy;
static member Create : unit -> 'T (requires 'Proxy :> System.Reflection.DispatchProxy)
Public Shared Function Create(Of T, TProxy) () As T

类型参数

T

代理应实现的接口。The interface the proxy should implement.

TProxy

要用于代理类的基类。The base class to use for the proxy class.

返回

T

实现 T 的对象实例。An object instance that implements T.

异常

T 是一个类,或者 TProxy 是密封的,或没有无参数构造函数。T is a class, or TProxy is sealed or does not have a parameterless constructor.

适用于