0
我正在嘗試註冊UIControlledApplication的DialogBoxShowing事件。但是我無法使用IExternalApplication接口的OnStartup/OnShutdown實現。最好我能想出是...註冊事件
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;
}
但我得到「無法隱式轉換類型‘TaskDialogEvent_01.Form1.Handeler’到「System.EventHandler Autodesk.Revit.UI.Events.DialogBoxShowingEventArgs >「錯誤。我的'UIAppEventHandlers1'方法與Handler具有相同的簽名。我做錯了什麼,誰能提供一個例子?謝謝。