Exemple #1
0
 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)))));
        }
Exemple #4
0
        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))));
             *  });*/
        }
Exemple #5
0
 /// <inheritdoc />
 public virtual void OnWindowOpened(IDockWindow?window)
 {
     WindowOpened?.Invoke(this, new WindowOpenedEventArgs(window));
 }
Exemple #6
0
 public void RaiseWindowOpened(IUiWindowShim windowShim)
 => WindowOpened?.Invoke(this, new EArg <IUiWindowShim> {
     Value = windowShim
 });