I have an interesting situation.Suppose a user creates 10 features in ArcMap in an edit session. Now the user tries to save this edits by clicking save edits or stop edits button. I would be performing some checks at this point(by listening to OnStopEditing/OnSaveEdits events). If the result of this check is not satisfactory, I would want ArcMap not to commit these changes. Also the state of edits not should be the same as it was before the Save Edits/Stop Edits button was pressed.
So in the case of failed checks, the 10 digitized features would stay ther in map, without permanantly committing to the database.
I hope I am not complicating things. Another way to describe the situation is, If the validations fail, ArcMap should just behave as if the user had not presed the StopEdits/SaveEdits button.
How can I do this using ArcObjects? I tried as shown below. But it simply saves edits and then stops editing. Anyone got ideas?
void editor_OnStopEditing(bool save)
{
if (save == true)
{
if(HasMyValidationFailed())
{
//do not stop edit here..
return; //did not work..
//throw; //did not work..
}
}
}
