void fireWindowClosedEvent(OoWindowEventArgs e)
 {
     if (WindowClosed != null)
     {
         try { WindowClosed.Invoke(this, e); }
         catch { }
     }
 }
Пример #2
0
 public void Close()
 {
     gameObject.SetActive(false);
     if (NotificationSystem.Instance != null)
     {
         NotificationSystem.Instance.CanShowMessages = true;
     }
     WindowClosed?.Invoke(this, EventArgs.Empty);
 }
Пример #3
0
 static void HandleWndVisibleChanged(object sender, EventArgs args)
 {
     if (!wnd.Visible)
     {
         isShowing = false;
         ParameterInformationWindowManager.UpdateWindow(wnd.Extension, wnd.CompletionWidget);
         WindowClosed?.Invoke(null, EventArgs.Empty);
     }
 }
Пример #4
0
 private void WindowClosedHandler()
 {
     if (tabViewModel != null)
     {
         tabViewModel.CloseTabRequested       -= CloseTabRequested;
         tabViewModel.SelectDownloadRequested -= SelectDownloadRequestedHandler;
     }
     OnWindowClosing();
     WindowClosed?.Invoke(this, EventArgs.Empty);
 }
Пример #5
0
        private void DestroyWindow(X11.Window xWindow)
        {
            Services.Logger.LogWindowingSystemEvent("Destroying window {0}.", xWindow);

            var window = _windows.First(w => w.XWindow == xWindow);

            window.Close();

            WindowClosed?.Invoke(new WindowEventArgs(window));
        }
Пример #6
0
 private void fireWindowClosedEvent(unoidl.com.sun.star.lang.EventObject source)
 {
     if (WindowClosed != null)
     {
         try
         {
             WindowClosed.DynamicInvoke(this, new OoEventArgs(source));
         }
         catch (Exception ex) { Logger.Instance.Log(LogPriority.DEBUG, this, "can't fire window closed event", ex); }
     }
 }
 void fireWindowClosedEvent(unoidl.com.sun.star.lang.EventObject Source)
 {
     if (WindowClosed != null)
     {
         try
         {
             WindowClosed.Invoke(this, new EventObjectForwarder(Source));
         }
         catch { }
     }
 }
Пример #8
0
 static void AddClosedHandler(IntPtr handle)
 {
     Automation.AddAutomationEventHandler(
         WindowPattern.WindowClosedEvent,
         AutomationElement.FromHandle(handle),
         TreeScope.Subtree,
         (sender, e) =>
     {
         Debug.WriteLine(handle.ToString() + " IS KILL");
         WindowClosed?.Invoke(null, new WindowEventArgs(new ProgramWindow(handle)));
     });
 }
Пример #9
0
        /// <summary>
        /// Closes the specified do close sound.
        /// </summary>
        /// <param name="doCloseSound">if set to <c>true</c> [do close sound].</param>
        public override void Close(bool doCloseSound = false)
        {
            if (!confirmed)
            {
                Reset();
                SoundDefOf.Click.PlayOneShotOnCamera();
            }
            else
            {
                SoundDefOf.Checkbox_TurnedOn.PlayOneShotOnCamera();
            }

            base.Close(doCloseSound);

            WindowClosed?.Invoke(this, addedMutations);
        }
Пример #10
0
    private void InitButtons(string[] buttonsText, ButtonCommands[] buttonCommands)
    {
        for (var i = 0; i < buttonsText.Length; i++)
        {
            var buttonInstance = GameObject.Instantiate(View.ButtonTemplate, View.ButtonsContainer);
            buttonInstance.gameObject.SetActive(true);
            buttonInstance.Text.text = buttonsText[i];
            var buttonComand = buttonCommands[i];
            buttonInstance.Button.onClick.AddListener(() => { ButtonClickHandle(buttonComand); });
        }

        void ButtonClickHandle(ButtonCommands commandId)
        {
            GameObject.Destroy(View.gameObject);
            WindowClosed?.Invoke(this, commandId);
        }
    }
Пример #11
0
        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)))));
        }
Пример #12
0
 protected override void WinEventCallback(WinEventConstant eventType, IntPtr handle, int objectId, int childId)
 {
     if (handle == _targetHandle && objectId == 0)
     {
         if (eventType == WinEventConstant.EVENT_OBJECT_DESTROY)
         {
             // Target window was closed
             WindowClosed?.Invoke(this, EventArgs.Empty);
         }
         else if (eventType == WinEventConstant.EVENT_OBJECT_LOCATIONCHANGE)
         {
             // Target window size has changed
             SendWindowDimensions(handle);
         }
         else if (eventType == WinEventConstant.EVENT_OBJECT_NAMECHANGE)
         {
             // Target window title has changed
             SendWindowTitle(handle);
         }
     }
 }
Пример #13
0
        public void CloseWindow(string windowHandle)
        {
            if (!IsOpened)
            {
                return;
            }
            if (!OpenedWindows.Contains(windowHandle))
            {
                throw new ArgumentException($"Can`t find window with handle = {windowHandle}");
            }
            if (OpenedWindows.Count == 1)
            {
                Quit();
                return;
            }

            string currentHandle = DriverKeeper.GetDriver.CurrentWindowHandle;

            bool windowChanged = false;

            if (currentHandle != windowHandle)
            {
                DriverKeeper.GetDriver.SwitchTo().Window(windowHandle).Close();
                DriverKeeper.GetDriver.SwitchTo().Window(currentHandle);
            }
            else
            {
                DriverKeeper.GetDriver.Close();
                DriverKeeper.GetDriver.SwitchTo().Window(OpenedWindows.Last());
                windowChanged = true;
            }

            WindowClosed?.Invoke(windowHandle);
            if (windowChanged)
            {
                WindowChanged?.Invoke(OpenedWindows.Last());
            }
        }
Пример #14
0
 public void Close()
 {
     gameObject.SetActive(false);
     WindowClosed?.Invoke(this, EventArgs.Empty);
 }
Пример #15
0
 public void Window_Closed(object sender, EventArgs eventArgs) => WindowClosed?.Invoke(sender, eventArgs);
Пример #16
0
 private void RaiseClosed(object sender, EventArgs e)
 {
     WindowClosed?.Invoke(sender, e);
 }
 public void CloseWindow()
 {
     WindowClosed?.Invoke(this, null);
     Close();
 }
 public void CloseAndNotify(bool saveSession)
 {
     WindowClosed?.Invoke(this, saveSession);
     Close();
 }
Пример #19
0
 public void Close()
 {
     WindowClosed?.Invoke();
     WindowClosed = null;
     Destroy(gameObject);
 }
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     WindowClosed?.Invoke(this, EventArgs.Empty);
 }
Пример #21
0
 private void OnClose(object p)
 {
     WindowClosed?.Invoke(this, EventArgs.Empty);
 }
Пример #22
0
 /// <inheritdoc />
 public virtual void OnWindowClosed(IDockWindow?window)
 {
     WindowClosed?.Invoke(this, new WindowClosedEventArgs(window));
 }
Пример #23
0
 public void CloseAndNotify()
 {
     WindowClosed?.Invoke(this, null);
     Close();
 }
Пример #24
0
 protected virtual void OnWindowClosed(WindowClosedEventArgs e)
 {
     WindowClosed?.Invoke(this, e);
 }
Пример #25
0
 public void Close()
 {
     this.Visible = false;
     WindowClosed?.Invoke(this);
 }