ArcObjects Library Reference (EditorExt)  

IMapTopology.FindClass Method

Finds the zero-based index of the specified feature class.

[Visual Basic .NET]
Public Function FindClass ( _
    ByVal fclass As IFeatureClass _
) As Integer
[C#]
public int FindClass (
    IFeatureClass fclass
);

Product Availability

Available with ArcGIS Desktop.

Remarks

FindClass returns the FeatureClass index position in the MapTopology. This index can then be used in RemoveClass, which allows removing a specific FeatureClass from the MapTopology using the index of the FeatureClass. This index can also be used in with the Class method that returns a specific FeatureClass based on its index in the MapTopology.

If the feature class does not participate in the MapTopology FindClass returns -1. 

 

 

[C#]
public void FindClass()
{
  UID extUid = new UIDClass();
  extUid.Value = "esriEditorExt.TopologyExtension";
  //You can get app from ICommand :: OnCreate() hook parameter
  ITopologyExtension topologyExt = m_app.FindExtensionByCLSID(extUid) as ITopologyExtension;
  IMapTopology mapTopology = topologyExt.MapTopology;
  mapTopology.AddClass(fc0);
  int featureClassID = mapTopology.FindClass(fc0);
}
[Visual Basic .NET]
  Public Sub FindClass()
    'You can get app from ICommand :: OnCreate() hook parameter
    Dim extUid As UID = New UIDClass()
    extUid.Value = "esriEditorExt.TopologyExtension"
    Dim topologyExt As ITopologyExtension = TryCast(app.FindExtensionByCLSID(extUid), ITopologyExtension)
    Dim mapTopology As IMapTopology = topologyExt.MapTopology
    mapTopology.AddClass(fc0)
    Dim featureClassID As Integer = mapTopology.FindClass(fc0)
  End Sub

See Also

IMapTopology Interface