ArcObjects Library Reference (EditorExt)  

ITopologyExtensionEvents Interface

Provides access to events that occur when working with a topology.

Product Availability

Available with ArcGIS Desktop.


Event OnActiveErrorsChanged Called when the active error selection is changed.
Event OnCurrentTopologyChanged Called when the current topology is changed.
Event OnErrorDeleted Called when a topology error is deleted.
Event OnTopologySelectionChanged Called when the topology element selection is changed.
Event OnValidate Called when a topology is validated.

CoClasses that implement ITopologyExtensionEvents

CoClasses and Classes Description
ErrorWindow Esri topology error inspector.
TopologyExtension Extension for working with topology.


TopologyExtension listeners are objects like a command that listen for and respond to events triggered by the topology extension.  For example, the OnValidate event is fired each time a topology is validated and a custom object could perform additional tasks after receiving this notification.



The following code shows how to wire topology events in C#.

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

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

void OnTopologySelectionChanged()
  System.Windows.Forms.MessageBox.Show("Topology selection changed.");


[Visual Basic .NET]

The following code shows how to wire topology events in VBNet.

  Public Sub WireTopologyEvents()
    '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)

    'Wire editor events.
    AddHandler (CType(topologyExt, ITopologyExtensionEvents_Event).OnTopologySelectionChanged  , AddressOf OnTopologySelectionChanged
  End Sub

  Private Sub OnTopologySelectionChanged()
    System.Windows.Forms.MessageBox.Show("Topology selection changed.")
  End Sub