This document is archived and information here might be outdated.  Recommended version.


ITopologyExtension.CurrentTopology Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > EditorExt > ESRI.ArcGIS.EditorExt > Interfaces > IT > ITopologyExtension Interface > ITopologyExtension.CurrentTopology Property
ArcGIS Developer Help

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