WorkflowMarkupSerializationManager.IDesignerSerializationManager.CreateInstance(Type, ICollection, String, Boolean) 方法

定义

创建指定类型的实例并将其添加到已命名实例的集合中。Creates an instance of the specified type and adds it to a collection of named instances.

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

参数

type
Type

要创建的 TypeThe Type to create.

arguments
ICollection

一个 ICollection,其中包含 type 的自变量。An ICollection that contains the arguments for type.

name
String

对象的名称。The name of the object. 此名称可用于以后通过 IDesignerSerializationManager.GetInstance(String) 访问该对象。This name can be used to access the object later using IDesignerSerializationManager.GetInstance(String). 如果传递了空引用(在 Visual Basic 中为 Nothing),则仍会创建对象,但不能按名称访问该对象。If a null reference (Nothing in Visual Basic) is passed, the object is still created but cannot be accessed by name.

addToContainer
Boolean

true 则将该对象添加到设计容器;否则为 falsetrue to add the object to the design container; otherwise, false.

返回

Object

新创建的对象。The newly created object.

实现

注解

如果将 addToContainer 设置为 true,则该对象必须实现 IComponent 才能使此设置生效。If addToContainer is set to true, the object must implement IComponent for this to have any effect.

适用于