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


IEditEvents2 Interface (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Editor)  

IEditEvents2 Interface

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

Product Availability

Available with ArcGIS Desktop.

When To Use

IEditEvents2 contains a collection of new editor events added at release 8.1.  For example, the editor now fires event notifcations whenever an edit sketch vertex is added, deleted, or moved.

For more information on editor events, see IEditEvents.

Members

Description
Event BeforeStopEditing Fired before StopEditing happens.
Event BeforeStopOperation Called before StopOperation is called.
Event OnAbort Called when AbortOperation is called.
Event OnCurrentZChanged Called when the CurrentZ changes.
Event OnSaveEdits Called when edits are saved.
Event OnStartOperation Called when StartOperation is called.
Event OnStopOperation Called when StopOperation is called.
Event OnVertexAdded Called after a point/vertex is added to the sketch.
Event OnVertexDeleted Called after a point is deleted from the sketch.
Event OnVertexMoved Called after a vertex/point has been moved in the sketch.

CoClasses that implement IEditEvents2

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.
EditEvents2 Helper coclass for working with the nondefault outbound IEditEvents2 interface in VB.
Editor The Object Editor Extension.
TableFrame (esriEditorExt) Graphic Element to display table.
TopologyExtension (esriEditorExt) Extension for working with topology.
UnplacedAnnotationWindow Esri unplaced anno window.

Remarks

As with IEditEvents, always set the event object variable to nothing when the class is destructed to avoid circular reference problems.

When editing geometric network features, different combinations of edit events may be fired depending on the edit that is being performed. The OnVertexAdded  event is the fired before the OnCreateFeature, OnChangeFeature and OnDeleteFeature edit events under the following geometric network editing scenarios:

See the IEditEvents interface for a listing of those events that are fired when geometric network features are edited.  For more infomation on geometric networks and network features refer to the  IGeometricNetwork, INetworkFeature and IFeature interfaces.

[C#]

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

public void WireEditEvents2()
{
  UID editorUid=new UIDClass(); 
  editorUid.Value="esriEditor.Editor";

  //You can get app from ICommand :: OnCreate() hook parameter  
  IEditor editor=app.FindExtensionByCLSID(editorUid) as IEditor;
  ((IEditEvents2_Event)editor).OnVertexAdded += 
    new IEditEvents2_OnVertexAddedEventHandler(OnVertexAdded);
}
void OnVertexAdded(IPoint point)
{
  System.Windows.Forms.MessageBox.Show("Vertex Added.");
}
For more information see How to listen to edit events.

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