IDesignerSerializationManager.CreateInstance 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
建立指定型態的實例,並將其加入一組命名實例中。
public:
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
Public Function CreateInstance (type As Type, arguments As ICollection, name As String, addToContainer As Boolean) As Object
參數
- type
- Type
要建立的資料型態。
- arguments
- ICollection
將參數傳遞給此型態的建構子。
- name
- String
物件的名稱。 此名稱可用於後續透過 GetInstance(String)存取該物件。 若 null 被傳遞,該物件仍會被建立,但無法以名稱存取。
- addToContainer
- Boolean
若 true,則該物件被加入設計容器中。 物件必須實作 IComponent 才能產生效果。
傳回
新建立的物件實例。
備註
若參數addToContainer為 true,實作IComponent物件會被加入設計時容器中。