ArcObjects Library Reference (EditorExt)  

ITopologyExtension.CurrentTopology Property

The current topology.

[Visual Basic .NET]
Public Property CurrentTopology As Object
[C#]
public object CurrentTopology {get; set;}

Product Availability

Available with ArcGIS Desktop.

Remarks

The CurrentTopology property can return either a IMapTopology object or ITopology object.  Only a topology in the current EditWorkspace can be set to this property.

The CurrentTopology property can be set to Nothing/Null. This does not update the Select Topology dialog.

[C#]

The following code checks the type of current topology and prints a message based on the return value. 

public void ReturnCurrentTopologyType()
{
  UID extUid = new UIDClass();
  extUid.Value = "esriEditorExt.TopologyExtension";

  //You can get app from ICommand :: OnCreate() hook parameter
  ITopologyExtension topologyExt = app.FindExtensionByCLSID(extUid) as ITopologyExtension;

  if (topologyExt.CurrentTopology == null)
    return;

  if (topologyExt.CurrentTopology is IMapTopology)
    System.Windows.Forms.MessageBox.Show("Current Topology is a map topology");
  else
    System.Windows.Forms.MessageBox.Show("Current topology is a geodatabase topology");
}
[Visual Basic .NET]

The following code checks the type of current topology and prints a message based on the return value. 

  Public Sub ReturnCurrentTopologyType()
    Dim extUid As UID = New UIDClass()
    extUid.Value = "esriEditorExt.TopologyExtension"

    'You can get app from ICommand :: OnCreate() hook parameter
    Dim topologyExt As ITopologyExtension = TryCast(app.FindExtensionByCLSID(extUid), ITopologyExtension)

    If topologyExt.CurrentTopology Is Nothing Then
      Exit Sub
    End If

    If TypeOf topologyExt.CurrentTopology Is IMapTopology Then
      System.Windows.Forms.MessageBox.Show("Current Topology is a map topology")
    Else
      System.Windows.Forms.MessageBox.Show("Current topology is a geodatabase topology")
    End If
  End Sub

See Also

ITopologyExtension Interface

.NET Related Topics

EditorExt | Working with topologically related features | Working with topology errors