ProxyAttribute.CreateInstance(Type) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
根據當前上下文中是否能存在指定類型,建立未初始化 MarshalByRefObject 或透明代理。
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 的代理或透明代理。
- 屬性
範例
// 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