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 方法提供間接參考。

適用於