IDesignerSerializationManager.CreateInstance Metódus

Definíció

Létrehozza a megadott típusú példányt, és hozzáadja egy elnevezett példányok gyűjteményéhez.

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);
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

Paraméterek

type
Type

A létrehozandó adattípus.

arguments
ICollection

Az ilyen típusú konstruktornak átadni kívánt argumentumok.

name
String

Az objektum neve. Ezzel a névvel később GetInstance(String)is elérheti az objektumot. Ha null a rendszer átadja az objektumot, az továbbra is létrejön, de név alapján nem érhető el.

addToContainer
Boolean

Ha trueez az objektum hozzáadódik a tervezőtárolóhoz. Az objektumnak implementálnia IComponent kell ezt, hogy bármilyen hatása legyen.

Válaszok

Az újonnan létrehozott objektumpéldány.

Megjegyzések

Ha a paraméter a paraméterIComponent, a rendszer hozzáadja a implementálandó addToContainer objektumokat a true tervezési idő tárolóhoz.

A következőre érvényes: