Adding an IDO event handler

IDO event handler methods should be declared as private methods in your IDO extension class. These methods should use the same signature as this example:

private void HandlePreLoadCollection( object sender, IDOEventArgs args)

These IDO events are available on the IDO property of the IIDOExtensionClassContext interface. To add your handler to an IDO event, you must override the IDOExtensionClass.SetContext method in your IDO extension class and use the AddHandler keyword as shown in this example:

public override void SetContext(IIDOExtensionClassContext context) 
{ 
   // Call the base class implementation: 
   base.SetContext(context); 

   // Add event handlers here, for example: 
   this.Context.IDO.PreUpdateCollection += this.PreUpdateCollection; 
} 

When you create an extension class assembly from source, or you extend and replace one, you must not override SetContext. Instead, use attributes on the methods to add event handlers, as shown in this example:

[IDOAddEventHandler( IDOEvent.PostInvokeMethod )]
private void ExtPostInvokeMethod( object sender, IDOInvokeEventArgs args )
{
   if ( args.InvokeRequest.MethodName == "MyTestMethod" )
   {

   }
}