NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

TypeBuilder.DefineField

Adds a new fieldto the class, with the given name, attributes and field type.

[Visual Basic]
Public Function DefineField( _
   ByVal fieldName As String, _
   ByVal type As Type, _
   ByVal attributes As FieldAttributes _
) As FieldBuilder
[C#]
public FieldBuilder DefineField(
   string fieldName,
   Type type,
   FieldAttributes attributes
);
[C++]
public: FieldBuilder* DefineField(
   String* fieldName,
   Type* type,
   FieldAttributes attributes
);
[JScript]
public function DefineField(
   fieldName : String,
   type : Type,
   attributes : FieldAttributes
) : FieldBuilder;

Parameters

fieldName
The name of the field.
type
The type of the field
attributes
The attributes of the field.

Return Value

The defined field.

Exceptions

Exception Type Condition
ArgumentNullException if fieldName is a null reference (in Visual Basic Nothing)
InvalidOperationException if the type was previously created using CreateType

See Also

TypeBuilder Class | TypeBuilder Members | System.Reflection.Emit Namespace