ProxyAttribute.CreateInstance(Type) 方法
定义
或者创建未初始化的 MarshalByRefObject,或者创建透明代理,具体取决于指定类型是否可以存在于当前上下文中。Creates either an uninitialized MarshalByRefObject or a transparent proxy, depending on whether the specified type can exist in the current context.
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
要创建其实例的对象类型。The object type to create an instance of.
返回
未初始化的 MarshalByRefObject 或透明代理。An uninitialized MarshalByRefObject or a transparent 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