This document is archived and information here might be outdated. Recommended version. |
The current topology.
[Visual Basic .NET]
Public Property CurrentTopology As Object
[C#]
public object CurrentTopology {get; set;}
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.
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");
}
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