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

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

반품

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

예외

type 에 포함된 arguments매개 변수를 사용하는 생성자가 없습니다.

설명

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

적용 대상

추가 정보