语言

ActivityCodeDomSerializationManager.CreateInstance 方法

定义

创建指定类型的实例并将其添加到命名实例的集合中。

public:
 virtual System::Object ^ CreateInstance(Type ^ type, System::Collections::ICollection ^ arguments, System::String ^ name, bool addToContainer);
public object CreateInstance(Type type, System.Collections.ICollection arguments, string name, bool addToContainer);
abstract member CreateInstance : Type * System.Collections.ICollection * string * bool -> obj
override this.CreateInstance : Type * System.Collections.ICollection * string * bool -> obj
Public Function CreateInstance (type As Type, arguments As ICollection, name As String, addToContainer As Boolean) As Object

参数

type
Type

要创建的数据 Type 。

arguments
ICollection

ICollection要传递给指定类型的构造函数的参数。

name
String

分配给生成的对象的名称。 此名称可用于稍后通过 GetInstance(String). 访问对象。

如果传递 null,则会创建对象,但不能按名称访问。

addToContainer
Boolean

true 将对象添加到设计容器;否则,为 false.

对象必须实现 IComponent 此对象才能产生任何效果。

返回

新建的对象实例。

实现

注解

这提供了对 SerializationManager 同名方法的间接引用。

适用于