private void fireWindowOpenedEvent(unoidl.com.sun.star.lang.EventObject source) { if (WindowOpened != null) { try { WindowOpened.DynamicInvoke(this, new OoEventArgs(source)); } catch (Exception ex) { Logger.Instance.Log(LogPriority.DEBUG, this, "can't fire window opend event", ex); } } }
void fireWindowOpenedEvent(unoidl.com.sun.star.lang.EventObject Source) { if (WindowOpened != null) { try { WindowOpened.Invoke(this, new EventObjectForwarder(Source)); } catch { } } }
static ProgramWindow() { Automation.AddAutomationEventHandler( WindowPattern.WindowOpenedEvent, AutomationElement.RootElement, TreeScope.Children, (sender, e) => WindowOpened?.Invoke(null, new WindowEventArgs( new ProgramWindow(new IntPtr(((AutomationElement)sender).Current.NativeWindowHandle))))); Automation.AddAutomationEventHandler( WindowPattern.WindowClosedEvent, AutomationElement.RootElement, TreeScope.Subtree, (sender, e) => WindowClosed?.Invoke(null, new WindowEventArgs( new ProgramWindow(new IntPtr(((AutomationElement)sender).Cached.NativeWindowHandle))))); }
static ProgramWindow() { Automation.AddAutomationEventHandler( WindowPattern.WindowOpenedEvent, AutomationElement.RootElement, TreeScope.Children, (sender, e) => { WindowOpened?.Invoke(new WindowEventArgs(new ProgramWindow(new IntPtr((sender as AutomationElement).Current.NativeWindowHandle)))); }); /*Automation.AddAutomationEventHandler( * WindowPattern.WindowClosedEvent, * AutomationElement.RootElement, * TreeScope.Subtree, * (sender, e) => * { * WindowClosed?.Invoke(new WindowEventArgs(new ProgramWindow(new IntPtr((sender as AutomationElement).Current.NativeWindowHandle)))); * });*/ }
/// <inheritdoc /> public virtual void OnWindowOpened(IDockWindow?window) { WindowOpened?.Invoke(this, new WindowOpenedEventArgs(window)); }
public void RaiseWindowOpened(IUiWindowShim windowShim) => WindowOpened?.Invoke(this, new EArg <IUiWindowShim> { Value = windowShim });