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

IEditEvents Interface (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Editor > ESRI.ArcGIS.Editor > Interfaces > IE > IEditEvents Interface
ArcGIS Developer Help

IEditEvents Interface

Provides access to editor events. Implement it to listen for specific events that occur during an edit session.

Product Availability

Available with ArcGIS Desktop.

When To Use

Edit events are specific notifications that occur during editing. Edit event listeners are objects like a command that listen for and respond to edit events. For example, a specific edit event is fired each time a new feature is created and a custom object could perform automatic feature validation after receiving this notification.


Name Description
Method AfterDrawSketch Called after the edit sketch is drawn.
Method OnChangeFeature Called when features are modified.
Method OnConflictsDetected Called when editing conflicts are detected during save.
Method OnCreateFeature Called when new features are created.
Method OnCurrentLayerChanged Called when the current layer changes.
Method OnCurrentTaskChanged Called when the current task changes.
Method OnDeleteFeature Called when features are deleted.
Method OnRedo Called when RedoOperation is called.
Method OnSelectionChanged Called when the selection changes.
Method OnSketchFinished Called when the edit sketch is finished.
Method OnSketchModified Called when the edit sketch is modified.
Method OnStartEditing Called when editing begins.
Method OnStopEditing Called when editing ends.
Method OnUndo Called when UndoOperation is called.

Classes that implement IEditEvents

Classes Description
Adjustment (esriEditorExt) The Adjustment Tools Editor Extension.
AnnotationEditExtension An editor extension for creating and editing annotation features.
CreateFeatureDockWin Esri create features window.
DimensionEditExtension An editor extension for creating and editing dimension features.
Editor The Object Editor Extension.
EditSelectionCache Caches the selection for fast hit testing.
FeatureSnap Snap agent that snaps to a feature in a specified way.
TableFrame (esriEditorExt) Graphic Element to display table.
TopologyExtension (esriEditorExt) Extension for working with topology.
UnplacedAnnotationWindow Esri unplaced anno window.


When editing geometric network features, different combinations of edit events may be fired depending on the edit that is being performed. For more infomation on geometric networks and network features refer to the  IGeometricNetwork, INetworkFeature and IFeature interfaces. The following is a breakdown of when the OnCreateFeature, OnChangeFeature and OnDeleteFeature edit events are fired for specific geometric network editing scenarios.  The events are listed in the order in which they are fired.

A standalone junction created:

A junction is created, snapped along a complex edge:

A junction is created, snapped along a simple edge:

A junction subsumes an orphan junction connected to an edge(s):

An edge is created:

An edge is created which with a connectivity rule (IConnectivityRule) that has a default junction specified:

A junction is moved (may or may not have connected edge(s)):

An endpoint orphan junction is deleted:

An endpoint junction is deleted:

A midspan orphan junction is deleted:

A midspan junction is deleted:

An edge is deleted:

public void WireEditEvents()
  UID editorUid = new UIDClass(); 
  editorUid.Value = "esriEditor.Editor";
  //You can get app from ICommand :: OnCreate() hook 
  //declare the editor, and the editevents interface.
  IEditor editor = app.FindExtensionByCLSID(editorUid) as IEditor;
//Wire edit events OnSketchFinished 
  ((IEditEvents_Event)editor).OnSketchFinished += 
    new IEditEvents_OnSketchFinishedEventHandler(OnSketchFinished);
void OnSketchFinished(IPolygon polygon)
  System.Windows.Forms.MessageBox.Show("The Edit Sketch has been completed!");
For more information see How to listen to edit events.
[Visual Basic .NET]

  Public Sub WireEditEvents()
    'You can get app from ICommand :: OnCreate() hook parameter
    Dim editorUid As UID = New UIDClass()
    editorUid.Value = "esriEditor.Editor"
    Dim editor As IEditor = TryCast(app.FindExtensionByCLSID(editorUid), IEditor)

    'Wire editor events.
    AddHandler (CType(editor, IEditEvents_Event).OnSketchFinished), AddressOf OnSketchFinished
  End Sub

  Private Sub OnSketchFinished()
    System.Windows.Forms.MessageBox.Show("The Edit Sketch has been completed!")
  End Sub

See Also

IEditEvents2 Interface | IEditEvents Interface | IDatasetEdit Interface | IDatasetEditInfo Interface | IEditSketch Interface | IEditTask.Activate Method | IEditor Interface | IEditTask.Deactivate Method | ISnapEnvironment Interface | IEditEvents2 Interface | IEditLayers Interface | IEditEvents Interface | IEditTask.Name Property | Editor Class | Editor Library | IEditTask.OnFinishSketch Method | IEditAttributeProperties Interface | IEditTask.OnDeleteSketch Method | IEditProperties Interface