Share via


DesignerSerializationManager.CreateInstance 메서드

정의

형식의 인스턴스를 만듭니다.

protected:
 virtual System::Object ^ CreateInstance(Type ^ type, System::Collections::ICollection ^ arguments, System::String ^ name, bool addToContainer);
protected virtual object CreateInstance (Type type, System.Collections.ICollection arguments, string name, bool addToContainer);
protected virtual 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
Protected Overridable Function CreateInstance (type As Type, arguments As ICollection, name As String, addToContainer As Boolean) As Object

매개 변수

type
Type

인스턴스를 만들 형식입니다.

arguments
ICollection

형식 생성자의 매개 변수입니다. 매개 변수가 없는 생성자를 호출하려면 null이거나 빈 컬렉션이 될 수 있습니다.

name
String

개체에 지정할 이름입니다. null이면, 개체가 컨테이너에 추가되고 이 컨테이너가 개체에 이름을 제공하지 않을 경우 개체에 이름이 지정되지 않습니다.

addToContainer
Boolean

개체가 IComponent를 구현할 경우 컨테이너에 개체를 추가하려면 true이고, 그렇지 않으면 false입니다.

반환

type에 의해 지정된 형식의 새 인스턴스입니다.

예외

type에 포함된 매개 변수를 가져오는 생성자가 arguments에 없는 경우

설명

이 메서드는 직렬 변환기가 형식의 instance 만들려고 할 때 호출됩니다. 기본 구현은 형식의 새 instance 만들거나 및 RecycleInstances 속성의 PreserveNames 값에 따라 기존 instance 반환할 수 있습니다. 메서드는 CreateInstance 리플렉션을 사용하여 인스턴스를 만들고 매개 변수에서 몇 가지 제네릭 IConvertible 변환을 수행하여 일치하는 생성자를 찾습니다.

적용 대상

추가 정보