I'm trying to register the DialogBoxShowing event of the UIControlledApplication. But I cannot use the OnStartup / OnShutdown implementation of the IExternalApplication interface. The best I could come up with is...
public delegate void Handeler(object sender, DialogBoxShowingEventArgs e);
public void RegesterDialogEvent(UIControlledApplication uicApp)
{
UIAppEventHandlers1 uaeh1 = new UIAppEventHandlers1();
Handeler hdlr = new Handeler(UIAppEventHandlers1.UIAppEvent_DialogBoxShowing_Handler);
uicApp.DialogBoxShowing += hdlr;
}
But i'm getting the "Cannot implicitly convert type 'TaskDialogEvent_01.Form1.Handeler' to 'System.EventHandler Autodesk.Revit.UI.Events.DialogBoxShowingEventArgs> " error. My 'UIAppEventHandlers1' method has the same signature as the Handler. What am I doing wrong and can anyone provide an example? Thank you.