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


EditEvents2 Class (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Editor > ESRI.ArcGIS.Editor > Classes > E > EditEvents2 Class
ArcGIS Developer Help

EditEvents2Class Class

Helper coclass for working with the nondefault outbound IEditEvents2 interface in VB.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Interfaces

Interfaces Description
IEditEvents2 Provides access to more editor events. Implement it to listen for specific events that occur during an edit session.
[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.");
}
[Visual Basic .NET]

The following code shows how to wire edit events in VBNet.

  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, IEditEvents2_Event).OnVertexAdded), AddressOf OnVertexAdded
  End Sub

  Private Sub OnVertexAdded(ByVal point As IPoint)
    System.Windows.Forms.MessageBox.Show("Vertex Added.")
  End Sub