ArcObjects Library Reference (Editor)  

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.

Members

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

CoClasses that implement IEditEvents

CoClasses and 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.

Remarks

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:

[C#]
 
public void WireEditEvents()
{
  UID editorUid = new UIDClass(); 
  editorUid.Value = "esriEditor.Editor";
  //You can get app from ICommand :: OnCreate() hook 
parameter
  //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 | IEditTask.Name Property | Editor Class | ISnapEnvironment Interface | IEditEvents2 Interface | IEditTask.Deactivate Method | IEditAttributeProperties Interface | IEditor Interface | IEditSketch Interface | IEditTask.OnFinishSketch Method | IEditProperties Interface | IEditLayers Interface | IEditTask.Activate Method | IEditTask.OnDeleteSketch Method | IEditEvents Interface