ESRI.ArcGIS.E2API Feedback via the User Forum
FieldCollection Class
See Also  Members   Example 
ESRI.ArcGIS.E2API Namespace : FieldCollection Class


The collection of fields in a Feature.

Object Model


Syntax

Visual Basic (Declaration) 
<ComVisibleAttribute(False)>
<DefaultMemberAttribute("Item")>
Public NotInheritable Class FieldCollection 
Visual Basic (Usage)Copy Code
Dim instance As FieldCollection
C# 
[ComVisibleAttribute(false)]
[DefaultMemberAttribute("Item")]
public sealed class FieldCollection 

Example

An example of accessing the FieldCollection of a Feature. This example assumes there is a variable MyLocalVectorLayer pointing to a LocalVectorLayer (e.g. Shapefile).
C#Copy Code
ESRI.ArcGIS.E2API.FeatureSet MyFeatureSet = MyLocalVectorLayer.QueryFeatures(null, 
                                             string.Empty,esriE2SpatialRelationship.Undefined ); 
 
ESRI.ArcGIS.E2API.Feature MyFeature = MyFeatureSet.GetFeature(0); 
 
FieldCollection MyFieldCollection = MyFeature.Fields; 
 
int i = 0; 
do 

ESRI.ArcGIS.E2API.Field MyField = MyFieldCollection.GetField(i); 
_taskUI.E2.MessageBox(MyField.FieldName,"Message Box",esriE2MessageBoxType.Information); 
  i++; 
}while(i != MyFieldCollection.Count);
Visual BasicCopy Code
Dim MyFeatureSet As ESRI.ArcGIS.E2API.FeatureSet = MyLocalVectorLayer.QueryFeatures(Nothing, _
                                                    String.Empty,esriE2SpatialRelationship.Undefined)

Dim MyFeature As ESRI.ArcGIS.E2API.Feature = MyFeatureSet.GetFeature(0)

Dim MyFieldCollection As FieldCollection = MyFeature.Fields

Dim i As Integer
For i = 0 To MyFieldCollection.Count - 1 Step i + 1
Dim MyField As ESRI.ArcGIS.E2API.Field = MyFieldCollection.GetField(i)
_taskUI.E2.MessageBox(MyField.FieldName,"Message Box",esriE2MessageBoxType.Information)
Next

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.E2API.FieldCollection

Platforms

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Version Information

This class was added to the E2API at version 1.0.0.348.

See Also