Provides access to more editor events. Implement it to listen for specific events that occur during an edit session.
Product Availability
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 | ||
---|---|---|
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 deleted from the sketch. | |
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:
- 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
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.");
}
For more information see How to listen to edit events.
See Also
IEditEvents2 Interface | IEditEvents Interface | IDatasetEdit Interface | IDatasetEditInfo Interface | Editor Class | IEditTask.OnFinishSketch Method | IEditor Interface | IEditTask.OnDeleteSketch Method | IEditTask.Activate Method | IEditTask.Deactivate Method | IEditSketch Interface | IEditAttributeProperties Interface | IEditLayers Interface | IEditEvents Interface | IEditTask.Name Property | IEditProperties Interface | IEditEvents2 Interface | ISnapEnvironment Interface