TypeBuilder.DefineField 메서드

정의

동적 형식에 새 필드를 추가합니다.

오버로드

DefineField(String, Type, FieldAttributes)

지정된 이름, 특성 및 필드 형식을 사용하여 형식에 새 필드를 추가합니다.

DefineField(String, Type, Type[], Type[], FieldAttributes)

지정된 이름, 특성, 필드 형식 및 사용자 지정 한정자를 사용하여 형식에 새 필드를 추가합니다.

DefineField(String, Type, FieldAttributes)

지정된 이름, 특성 및 필드 형식을 사용하여 형식에 새 필드를 추가합니다.

public:
 System::Reflection::Emit::FieldBuilder ^ DefineField(System::String ^ fieldName, Type ^ type, System::Reflection::FieldAttributes attributes);
public System.Reflection.Emit.FieldBuilder DefineField (string fieldName, Type type, System.Reflection.FieldAttributes attributes);
member this.DefineField : string * Type * System.Reflection.FieldAttributes -> System.Reflection.Emit.FieldBuilder
Public Function DefineField (fieldName As String, type As Type, attributes As FieldAttributes) As FieldBuilder

매개 변수

fieldName
String

필드의 이름입니다. fieldName에는 내장된 null이 포함될 수 없습니다.

type
Type

필드의 형식입니다.

attributes
FieldAttributes

필드의 특성입니다.

반환

FieldBuilder

정의된 필드입니다.

예외

fieldName의 길이가 0입니다.

또는 type이 System.Void입니다.

또는 이 필드의 부모 클래스에 대한 전체 크기가 지정되었습니다.

fieldName이(가) null인 경우

CreateType()을 사용하여 이전에 형식을 만들었습니다.

적용 대상

DefineField(String, Type, Type[], Type[], FieldAttributes)

지정된 이름, 특성, 필드 형식 및 사용자 지정 한정자를 사용하여 형식에 새 필드를 추가합니다.

public:
 System::Reflection::Emit::FieldBuilder ^ DefineField(System::String ^ fieldName, Type ^ type, cli::array <Type ^> ^ requiredCustomModifiers, cli::array <Type ^> ^ optionalCustomModifiers, System::Reflection::FieldAttributes attributes);
public System.Reflection.Emit.FieldBuilder DefineField (string fieldName, Type type, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers, System.Reflection.FieldAttributes attributes);
public System.Reflection.Emit.FieldBuilder DefineField (string fieldName, Type type, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, System.Reflection.FieldAttributes attributes);
member this.DefineField : string * Type * Type[] * Type[] * System.Reflection.FieldAttributes -> System.Reflection.Emit.FieldBuilder
Public Function DefineField (fieldName As String, type As Type, requiredCustomModifiers As Type(), optionalCustomModifiers As Type(), attributes As FieldAttributes) As FieldBuilder

매개 변수

fieldName
String

필드의 이름입니다. fieldName에는 내장된 null이 포함될 수 없습니다.

type
Type

필드의 형식입니다.

requiredCustomModifiers
Type[]

IsConstModifier 같은 필드에 대한 필수 사용자 지정 한정자를 나타내는 형식의 배열입니다.

optionalCustomModifiers
Type[]

IsConstModifier와 같은 필드에 대한 선택적 사용자 지정 한정자를 나타내는 형식의 배열입니다.

attributes
FieldAttributes

필드의 특성입니다.

반환

FieldBuilder

정의된 필드입니다.

예외

fieldName의 길이가 0입니다.

또는 type이 System.Void입니다.

또는 이 필드의 부모 클래스에 대한 전체 크기가 지정되었습니다.

fieldName이(가) null인 경우

CreateType()을 사용하여 이전에 형식을 만들었습니다.

설명

이 오버로드는 관리되는 컴파일러 디자이너를 위해 제공됩니다.

적용 대상