void fireWindowClosedEvent(OoWindowEventArgs e)
 {
     if (WindowClosed != null)
     {
         try { WindowClosed.Invoke(this, e); }
         catch { }
     }
 }
Esempio n. 2
0
 public void Close()
 {
     gameObject.SetActive(false);
     if (NotificationSystem.Instance != null)
     {
         NotificationSystem.Instance.CanShowMessages = true;
     }
     WindowClosed?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 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);
     }
 }
Esempio n. 4
0
 private void WindowClosedHandler()
 {
     if (tabViewModel != null)
     {
         tabViewModel.CloseTabRequested       -= CloseTabRequested;
         tabViewModel.SelectDownloadRequested -= SelectDownloadRequestedHandler;
     }
     OnWindowClosing();
     WindowClosed?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 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));
        }
 void fireWindowClosedEvent(unoidl.com.sun.star.lang.EventObject Source)
 {
     if (WindowClosed != null)
     {
         try
         {
             WindowClosed.Invoke(this, new EventObjectForwarder(Source));
         }
         catch { }
     }
 }
Esempio n. 7
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)));
     });
 }
Esempio n. 8
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);
        }
Esempio n. 9
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);
        }
    }
Esempio n. 10
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)))));
        }
Esempio n. 11
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);
         }
     }
 }
Esempio n. 12
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());
            }
        }
Esempio n. 13
0
 public void Window_Closed(object sender, EventArgs eventArgs) => WindowClosed?.Invoke(sender, eventArgs);
Esempio n. 14
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();
 }
Esempio n. 17
0
 public void Close()
 {
     WindowClosed?.Invoke();
     WindowClosed = null;
     Destroy(gameObject);
 }
Esempio n. 18
0
 /// <inheritdoc />
 public virtual void OnWindowClosed(IDockWindow?window)
 {
     WindowClosed?.Invoke(this, new WindowClosedEventArgs(window));
 }
Esempio n. 19
0
 public void Close()
 {
     gameObject.SetActive(false);
     WindowClosed?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 20
0
 private void OnClose(object p)
 {
     WindowClosed?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 21
0
 public void CloseAndNotify()
 {
     WindowClosed?.Invoke(this, null);
     Close();
 }
Esempio n. 22
0
 protected virtual void OnWindowClosed(WindowClosedEventArgs e)
 {
     WindowClosed?.Invoke(this, e);
 }
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     WindowClosed?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 24
0
 public void Close()
 {
     this.Visible = false;
     WindowClosed?.Invoke(this);
 }