Quantcast
Channel: Question and Answer » arcmap
Viewing all articles
Browse latest Browse all 248

How to find if ArcMap raised error during edit session?

$
0
0

I have a class extended IExtension and inside this class I catch OnCreate, OnDelete and OnChanged and OnStopEditing events of Editor object of ArcMap. However I need to know if ArcMap has raised any error while user interaction during edit session when control falls into OnStopEditing event.But I could not find any property or method in Editor object that shows me it.

Is there any way to find if ArcMap has thrown an error while user drawing/modifying/deleting a sketch in programming?

Here is a sample how I structure my extension:

//Startup method of IExtension interface
public void Startup(ref object initializationData)
{
  //find Editor object somehow
  this.m_Editor.OnChangeFeature += new IEditEvents_OnChangeFeatureEventHandler(m_Editor_OnChangeFeature);
            this.m_Editor.OnCreateFeature += new IEditEvents_OnCreateFeatureEventHandler(m_Editor_OnCreateFeature);
            this.m_Editor.OnDeleteFeature += new IEditEvents_OnDeleteFeatureEventHandler(m_Editor_OnDeleteFeature);
            this.m_Editor.OnStartEditing += new IEditEvents_OnStartEditingEventHandler(m_Editor_OnStartEditing);
            this.m_Editor.OnStopEditing += new IEditEvents_OnStopEditingEventHandler(m_Editor_OnStopEditing);

}

void m_Editor_OnDeleteFeature(ESRI.ArcGIS.Geodatabase.IObject obj)
{
//Some verification
}

void m_Editor_OnChangeFeature(ESRI.ArcGIS.Geodatabase.IObject obj)
{
//Some verification
}

void m_Editor_OnCreateFeature(ESRI.ArcGIS.Geodatabase.IObject obj)
{
//Some verification
}

void m_Editor_OnStopEditing(bool save)
{
//Here I need if ArcMap has raised an error and showed it to user
}

Viewing all articles
Browse latest Browse all 248

Trending Articles