I have coded a Customized Command (or button) in ArcMap by using the ArcObjects library in C#.
I would like to check if there is any ongoing editing session (and close it) when the user presses that button. Is there any way to do that?
public void StopEditing(bool saveChanges)
//Get a reference to the editor.
UID uid = new UIDClass();
uid.Value = "esriEditor.Editor";
IEditor editor = m_application.FindExtensionByCLSID(uid)as IEditor;
//Check to see if a workspace is already being edited.
if (editor.EditState != esriEditState.esriStateNotEditing)
have a look at the editing-API: ArcObjects Help for .NET developers
Thank you Frank!
Just to add that I needed to add the reference ESRI.ArcGIS.Editor and to insert the line
Retrieving data ...