I have an edit extension that listens to events that happen during an editor session. I have wired it like so:
void Events_OnStartEditing()
{
//Since features of shapefiles, coverages, and so on, cannot be validated, ignore wiring
//events for them.
if (ArcMap.Editor.EditWorkspace.Type !=
esriWorkspaceType.esriFileSystemWorkspace)
{
//Wire OnCreateFeature edit event.
Events.OnCreateFeature += new IEditEvents_OnCreateFeatureEventHandler
(Events_OnCreateFeature);
//Wire onChangeFeature edit event.
Events.OnChangeFeature += new IEditEvents_OnChangeFeatureEventHandler
(Events_OnChangeFeature);
}
}
The OnStartEditing event fires just fine. I want to listen for when an attribute from the row changes, so I wired an OnChangeFeature event:
void Events_OnChangeFeature(ESRI.ArcGIS.Geodatabase.IObject obj)
{
MessageBox.Show("Event fired");
}
Every time I go in and change a feature by editing the attribute table, this should fire. But it doesn't. I am manually editing features of the table (I'm not using a cursor to programatically update the features).
I will lastly mention that the feature class that I am editing is a subset of a parcel fabric. I'm not sure that this makes a difference as there is nothing in ESRI documentation that I have found that says that editing in a parcel fabric bypasses normal editing events, but I will mention it anyway.
EDIT: Ideas I have tried with no result:
Implementing IObjectClassInfo2 in my extension to make sure that no store methods are being bypassed:
public class ParcelEditorExtension : ESRI.ArcGIS.Desktop.AddIns.Extension, IObjectClassInfo2
public Boolean CanBypassStoreMethod()
{
return false;
}
public Boolean CanBypassEditSession()
{
return false;
}
Running the IWorkspaceEditControl.SetStoreEventsRequired() method to enforce this rule over the entire edit session.
IWorkspaceEditControl EditControl = ArcMap.Editor.EditWorkspace as IWorkspaceEditControl;
EditControl.SetStoreEventsRequired();
EDIT 2: It appears that the parcel fabric is, in fact, the issue. The event fires just fine when working on simple feature classes. Regardless, setting CanBypassStoreMethod() to false should fix this issue - is my implementation of this method correct?