TypeBuilder.DefineField Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Agrega un campo al tipo dinámico.
Sobrecargas
| Nombre | Description |
|---|---|
| DefineField(String, Type, FieldAttributes) |
Agrega un nuevo campo al tipo, con el nombre, los atributos y el tipo de campo especificados. |
| DefineField(String, Type, Type[], Type[], FieldAttributes) |
Agrega un nuevo campo al tipo, con el nombre, los atributos, el tipo de campo y os modificadores personalizados especificados. |
DefineField(String, Type, FieldAttributes)
- Source:
- TypeBuilder.cs
- Source:
- TypeBuilder.cs
- Source:
- TypeBuilder.cs
- Source:
- TypeBuilder.cs
Agrega un nuevo campo al tipo, con el nombre, los atributos y el tipo de campo especificados.
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
Parámetros
- fieldName
- String
Nombre del campo.
fieldName no puede contener valores null insertados.
- type
- Type
Tipo del campo.
- attributes
- FieldAttributes
Atributos del campo.
Devoluciones
Campo definido.
Excepciones
La longitud de fieldName es cero.
o bien
type es System.Void.
o bien
Se especificó un tamaño total de la clase primaria de este campo.
fieldName es null.
El tipo se creó previamente mediante CreateType().
Se aplica a
DefineField(String, Type, Type[], Type[], FieldAttributes)
- Source:
- TypeBuilder.cs
- Source:
- TypeBuilder.cs
- Source:
- TypeBuilder.cs
- Source:
- TypeBuilder.cs
Agrega un nuevo campo al tipo, con el nombre, los atributos, el tipo de campo y os modificadores personalizados especificados.
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
Parámetros
- fieldName
- String
Nombre del campo.
fieldName no puede contener valores null insertados.
- type
- Type
Tipo del campo.
- requiredCustomModifiers
- Type[]
Matriz de tipos que representan los modificadores personalizados necesarios para el campo, como IsConstModifier.
- optionalCustomModifiers
- Type[]
Matriz de tipos que representan los modificadores personalizados opcionales para el campo, como IsConstModifier.
- attributes
- FieldAttributes
Atributos del campo.
Devoluciones
Campo definido.
Excepciones
La longitud de fieldName es cero.
o bien
type es System.Void.
o bien
Se especificó un tamaño total de la clase primaria de este campo.
fieldName es null.
El tipo se creó previamente mediante CreateType().
Comentarios
Esta sobrecarga se proporciona para diseñadores de compiladores administrados.