private void SecondaryOnUnloadEvent(object sender, EventArgs e) { GenericElementEventHandler handler = sender as GenericElementEventHandler; if (WBSecondaryOnUnload != null) { SecondaryOnloadEventArgs args = new SecondaryOnloadEventArgs(handler.HTMLElement as IWebBrowser2); WBSecondaryOnUnload(this, args); if (args.Cancel) return; } handler.InvokeOldHandler(); //Clear interfaces if (handler.HTMLElement != null) handler.HTMLElement = null; //Release IWebbrowser instance }
private void SecondaryOnLoadEvent(object sender, EventArgs e) { GenericElementEventHandler handler = sender as GenericElementEventHandler; if (WBSecondaryOnLoad != null) { SecondaryOnloadEventArgs args = new SecondaryOnloadEventArgs(handler.HTMLElement as IWebBrowser2); WBSecondaryOnLoad(this, args); if (args.Cancel) return; } handler.InvokeOldHandler(); }