共用方式為


ProxyAttribute.CreateInstance(Type) 方法

定義

建立未初始化的 MarshalByRefObject 或者透明 Proxy,依指定型別是否可以在目前內容中存在而定。

public:
 virtual MarshalByRefObject ^ CreateInstance(Type ^ serverType);
public virtual MarshalByRefObject CreateInstance (Type serverType);
[System.Security.SecurityCritical]
public virtual MarshalByRefObject CreateInstance (Type serverType);
abstract member CreateInstance : Type -> MarshalByRefObject
override this.CreateInstance : Type -> MarshalByRefObject
[<System.Security.SecurityCritical>]
abstract member CreateInstance : Type -> MarshalByRefObject
override this.CreateInstance : Type -> MarshalByRefObject
Public Overridable Function CreateInstance (serverType As Type) As MarshalByRefObject

參數

serverType
Type

要建立其執行個體的物件型別。

傳回

未初始化的 MarshalByRefObject 或透明 Proxy。

屬性

範例

// Create an instance of ServicedComponentProxy
virtual MarshalByRefObject^ CreateInstance( Type^ serverType ) override
{
   return ProxyAttribute::CreateInstance( serverType );
}
// Create an instance of ServicedComponentProxy
public override MarshalByRefObject CreateInstance(Type serverType)
{
   return base.CreateInstance(serverType);
}
' Create an instance of ServicedComponentProxy
Public Overrides Function CreateInstance(serverType As Type) As MarshalByRefObject
   Return MyBase.CreateInstance(serverType)
End Function 'CreateInstance

適用於