Provides access to editor events. Implement it to listen for specific events that occur during an edit session.
Product Availability
When To Use
Members
Description | ||
---|---|---|
AfterDrawSketch | Called after the edit sketch is drawn. | |
OnChangeFeature | Called when features are modified. | |
OnConflictsDetected | Called when editing conflicts are detected during save. | |
OnCreateFeature | Called when new features are created. | |
OnCurrentLayerChanged | Called when the current layer changes. | |
OnCurrentTaskChanged | Called when the current task changes. | |
OnDeleteFeature | Called when features are deleted. | |
OnRedo | Called when RedoOperation is called. | |
OnSelectionChanged | Called when the selection changes. | |
OnSketchFinished | Called when the edit sketch is finished. | |
OnSketchModified | Called when the edit sketch is modified. | |
OnStartEditing | Called when editing begins. | |
OnStopEditing | Called when editing ends. | |
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:
- OnCreatefeature event is fired for junction
A junction is created, snapped along a complex edge:
- OnChangefeature event is fired for complex edge
- OnCreatefeature event is fired for junction
A junction is created, snapped along a simple edge:
- OnCreatefeature event is fired for each new simple edge
- OnDeletefeature event is fired for deleted simple edge
- OnCreatefeature event is fired for junction
A junction subsumes an orphan junction connected to an edge(s):
- OnChangefeature event is fired for each connected edge
- OnDeletefeature event is fired for orphan junction
- OnCreatefeature event is fired for junction
An edge is created:
- OnCreatefeature event is fired twice for each orphan junction
- OnCreatefeature event is fired for new edge
An edge is created which with a connectivity rule (IConnectivityRule) that has a default junction specified:
- OnCreatefeature event is fired twice for each orphan junction
- OnCreatefeature event is fired twice for each default junction
- OnCreatefeature event is fired for new edge
A junction is moved (may or may not have connected edge(s)):
- OnChangefeature event is fired for junction
- OnChangefeature event is fired each connected edge(s)
An endpoint orphan junction is deleted:
- OnDeletefeature event is fired for each connected edge
- OnDeletefeature event is fired for junction
An endpoint junction is deleted:
- OnChangefeature event is fired for each connected edge
- OnDeletefeature event is fired for junction
- OnCreatefeature event is fired for orphan junction
A midspan orphan junction is deleted:
- OnChangefeature event is fired for complex edge
- OnDeletefeature event is fired for orphan junction
A midspan junction is deleted:
- OnChangefeature event is fired twice for complex edge
- OnDeletefeature event is fired for junction
- OnCreatefeature event is fired for Orphan junction
An edge is deleted:
- OnDeletefeature event is fired for edge
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.
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 | 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