Interface IObjectClassEvents
- Namespace
- ESRI.ArcGIS.Geodatabase
- Assembly
- ESRI.Server.Geodatabase.dll
Provides access to events that occur with an object class.
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("E53AFB0E-E6D4-11D2-9F29-00C04F6BC979")]
public interface IObjectClassEvents
Remarks
Listeners of the OnCreate event are not necessarily notified every time an object is created. The event is triggered following a call to IRow.Store, and by default this does not occur when objects or simple features are created using an insert cursor. This can be overridden by setting the IWorkspaceEditControl.SetStoreEventsRequired property to true, or by implementing the optional IObjectClassInfo interface on the class' extension.
If you are using the OnCreate, OnDelete or OnChange methods in a class extension to validate edit operations, you should not call AbortEditOperation on the workspace if your logic indicates that the edit operation is invalid. Instead, raise an error which will be propagated to the application that is performing the edit on the class.
It is the responsibility of the editing application that receives the error to abort the edit operation. This is especially true when editing with ArcMap. If you call AbortEditOperation from within the class extension, the ArcMap undo/redo edit stack will become out of sync.
In the event that a feature should be deleted due to an OnChange event, it is not recommended that the event handler delete the feature itself. Instead, an exception should be thrown to the application, where it can be made responsible for deleting the feature.
The OnCreate, OnDelete or OnChange events are not fired during a Topology Validation. The OnCreate and OnDelete events are not applicable since a Validate does not create or delete features. The OnChange event is not fired for performance as a large number of features may be changed during a Validate. In addition, features may be changed many times.
Methods
OnChange(IObject)
This event is fired when an object's attributes or geometry is updated.
void OnChange(IObject obj)
Parameters
objIObject
Remarks
In the event that a feature should be deleted due to an OnChange event, it is not recommended that the event handler delete the feature itself. Instead, an exception should be thrown to the application, where it can be made responsible for deleting the feature.
The OnChange event is not fired during a Topology Validation for performance reasons as a large number of features may be changed during a Validate. In addition, features may be changed many times.
OnCreate(IObject)
This event is fired when a new object is created in the object class.
void OnCreate(IObject obj)
Parameters
objIObject
OnDelete(IObject)
This event is fired when an object is deleted from the object class.
void OnDelete(IObject obj)
Parameters
objIObject