Provides access to more editor events. Implement it to listen for specific events that occur during an edit session.
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.
| Description | ||
|---|---|---|
![]() |
BeforeStopEditing | Fired before StopEditing happens. |
![]() |
BeforeStopOperation | Called before StopOperation is called. |
![]() |
OnAbort | Called when AbortOperation is called. |
![]() |
OnCurrentZChanged | Called when the CurrentZ changes. |
![]() |
OnSaveEdits | Called when edits are saved. |
![]() |
OnStartOperation | Called when StartOperation is called. |
![]() |
OnStopOperation | Called when StopOperation is called. |
![]() |
OnVertexAdded | Called after a point/vertex is added to the sketch. |
![]() |
OnVertexDeleted | Called after a point is added to the sketch. |
![]() |
OnVertexMoved | Called after a vertex/point has been moved in the sketch. |
| CoClasses and Classes | Description |
|---|---|
| Adjustment (esriEditorExt) | The Adjustment Tools Editor Extension. |
| AnnotationEditExtension | An editor extension for creating and editing annotation features. |
| 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. |
| TopologyExtension (esriEditorExt) | Extension for working with topology. |
| UnplacedAnnotationWindow | ESRI unplaced anno window. |
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.
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.");
}
To respond to events under IEditEvents2, declare a modular-level object variable of type EditEvents2. EditEvents2 is an artificial CoClass that solves the problem Visual Basic has with multiple outbound interfaces on an object.
Private WithEvents EditorEvents2 as EditEvents2
As with IEditEvents, set the event object variable to another object variable which references the existing editor object.
Set EditorEvents2 = m_pEditor
IEditEvents2 Interface | IEditEvents Interface | IDatasetEdit Interface | IDatasetEditInfo Interface | IEditEvents2 Interface | Editor Class | IEditTask.OnDeleteSketch Method | IEditor Interface | IEditEvents Interface | IEditTask.OnFinishSketch Method | IEditProperties Interface | ISnapEnvironment Interface | IEditTask.Deactivate Method | IEditAttributeProperties Interface | IEditTask.Activate Method | IEditLayers Interface | IEditTask.Name Property | IEditSketch Interface