Field Class Reference

Represents a single field of the attribute table. More...

Collaboration diagram for Field:
Collaboration graph

Public Member Functions

Field Clone ()
 Creates an exact copy of the field. More...
 
string get_ErrorMsg (int ErrorCode)
 Retrieves the error message associated with the specified error code. More...
 

Properties

string Alias [get, set]
 Gets or sets the alias for the field. For use in application only, not used by MapWinGIS internally. More...
 
string Expression [get, set]
 Gets or sets the expression for the field. For use in application only, not used by MapWinGIS internally. More...
 
ICallback GlobalCallback [get, set]
 The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications. More...
 
bool Joined [get]
 Gets a value indicating whether this field is joined. More...
 
string Key [get, set]
 The key may be used by the programmer to store any string data associated with the object. More...
 
int LastErrorCode [get]
 Retrieves the last error generated in the object. More...
 
bool Modified [get, set]
 Gets or sets a value indicating whether this field is modified. It is used during saving of changes for OgrLayer. The flag should be set by application code. More...
 
string Name [get, set]
 Gets or sets the name of the field. More...
 
int Precision [get, set]
 Gets or sets the precision of the field. Precision only applies to fields of fieldtype double. More...
 
FieldType Type [get, set]
 Gets or sets the field type of the field. More...
 
bool Visible [get, set]
 Gets or sets a value indicating whether the field is visible. For use in application only, not used by MapWinGIS internally. More...
 
int Width [get, set]
 Gets or sets the width of the field. More...
 

Detailed Description

Represents a single field of the attribute table.

dot_inline_dotgraph_39.png

Graph description

To show the properties of the field the following code can be used:

Shapefile sf = some_shapefile;
Field field = sf.get_Field(fieldIndex);
if (field != null)
{
string s = string.Format("Name = {0}; type = {1}; width = {2}; precision = {3}",
field.Name, field.Type.ToString(), field.Width.ToString(), field.Precision.ToString());
Debug.Print(s);
}
Represents a single field of the attribute table.
Definition: Field.cs:48
FieldType Type
Gets or sets the field type of the field.
Definition: Field.cs:143
string Name
Gets or sets the name of the field.
Definition: Field.cs:125
int Precision
Gets or sets the precision of the field. Precision only applies to fields of fieldtype double.
Definition: Field.cs:134
int Width
Gets or sets the width of the field.
Definition: Field.cs:152
Provides a functionality for accessing and editing ESRI shapefiles.
Definition: Shapefile.cs:72
Field get_Field(int fieldIndex)
Gets a specific field stored in the attribute table.
Definition: Shapefile.cs:611
Examples
IntersectionLength.cs, and MinimalDistance.cs.

Member Function Documentation

◆ Clone()

Field Field.Clone ( )

Creates an exact copy of the field.

Returns
The copy of the field.
New API 4.8:
Added in version 4.8

◆ get_ErrorMsg()

string Field.get_ErrorMsg ( int  ErrorCode)

Retrieves the error message associated with the specified error code.

Parameters
ErrorCodeThe error code for which the error message is required.
Returns
The error message description for the specified error code.

Property Documentation

◆ Alias

string Field.Alias
getset

Gets or sets the alias for the field. For use in application only, not used by MapWinGIS internally.

New API 4.9.4:
Added in version 4.9.4

◆ Expression

string Field.Expression
getset

Gets or sets the expression for the field. For use in application only, not used by MapWinGIS internally.

New API 4.9.4:
Added in version 4.9.4

◆ GlobalCallback

ICallback Field.GlobalCallback
getset

The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.

Deprecated:
v4.9.3 Use GlobalSettings.ApplicationCallback instead.

◆ Joined

bool Field.Joined
get

Gets a value indicating whether this field is joined.

New API 4.9.4:
Added in version 4.9.4

◆ Key

string Field.Key
getset

The key may be used by the programmer to store any string data associated with the object.

◆ LastErrorCode

int Field.LastErrorCode
get

Retrieves the last error generated in the object.

◆ Modified

bool Field.Modified
getset

Gets or sets a value indicating whether this field is modified. It is used during saving of changes for OgrLayer. The flag should be set by application code.

New API 4.9.4:
Added in version 4.9.4

◆ Name

string Field.Name
getset

Gets or sets the name of the field.

Examples
MinimalDistance.cs.

◆ Precision

int Field.Precision
getset

Gets or sets the precision of the field. Precision only applies to fields of fieldtype double.

Examples
MinimalDistance.cs.

◆ Type

FieldType Field.Type
getset

Gets or sets the field type of the field.

Examples
MinimalDistance.cs.

◆ Visible

bool Field.Visible
getset

Gets or sets a value indicating whether the field is visible. For use in application only, not used by MapWinGIS internally.

New API 4.9.4:
Added in version 4.9.4

◆ Width

int Field.Width
getset

Gets or sets the width of the field.