ICustomFactory.CreateInstance(Type) 方法

定义

创建指定类型的新实例。Creates a new instance of the specified type.

public:
 MarshalByRefObject ^ CreateInstance(Type ^ serverType);
public MarshalByRefObject CreateInstance (Type serverType);
abstract member CreateInstance : Type -> MarshalByRefObject
Public Function CreateInstance (serverType As Type) As MarshalByRefObject

参数

serverType
Type

要激活的类型。The type to activate.

返回

MarshalByRefObject

与指定类型关联的 MarshalByRefObjectA MarshalByRefObject associated with the specified type.

注解

CreateInstance 当需要创建指定类型的新对象时,公共语言运行时将调用。CreateInstance is called by the common language runtime when a new object of the specified type needs to be created. 重写此方法以提供您自己的自定义类工厂。Override this method to provide your own custom class factory.

适用于