void fireWindowClosingEvent(unoidl.com.sun.star.lang.EventObject Source)
 {
     if (WindowClosing != null)
     {
         try
         {
             WindowClosing.Invoke(this, new EventObjectForwarder(Source));
         }
         catch { }
     }
 }
Ejemplo n.º 2
0
 private void fireWindowClosingEvent(unoidl.com.sun.star.lang.EventObject source)
 {
     if (WindowClosing != null)
     {
         try
         {
             WindowClosing.DynamicInvoke(this, new OoEventArgs(source));
         }
         catch (Exception ex) { Logger.Instance.Log(LogPriority.DEBUG, this, "can't fire window closing event", ex); }
     }
 }
        } // OnScreenSizeChanged

        #endregion

        #region Form Closing

        #if (WINDOWS)

            /// <summary>
            /// If the form is closing
            /// </summary>
            private static void FormClosing(object sender, FormClosingEventArgs e)
            {
                bool ret = false;

                WindowClosingEventArgs ex = new WindowClosingEventArgs();
                if (WindowClosing != null)
                {   
                    WindowClosing.Invoke(null, ex);
                    ret = ex.Cancel;
                }
                e.Cancel = ret;
            } // FormClosing
Ejemplo n.º 4
0
    /// <inheritdoc />
    public virtual bool OnWindowClosing(IDockWindow?window)
    {
        var canClose = window?.OnClose() ?? true;

        var eventArgs = new WindowClosingEventArgs(window)
        {
            Cancel = !canClose
        };

        WindowClosing?.Invoke(this, eventArgs);

        return(!eventArgs.Cancel);
    }
Ejemplo n.º 5
0
        ///<summary>Invokes registered user-defined handler methods when the native window is about to close.</summary>
        internal byte OnWindowClosing()
        {
            //C++ handles bool values as a single byte, C# uses 4 bytes
            byte noClose    = 0;
            var  doNotClose = WindowClosing?.Invoke(this, null);

            if (doNotClose ?? false)
            {
                noClose = 1;
            }

            return(noClose);
        }
Ejemplo n.º 6
0
        private void OnClosing(Object sender, CancelEventArgs e)
        {
            if (e.Cancel)
            {
                return;
            }

            FormClosingEventArgs args = new FormClosingEventArgs(CloseReason, e.Cancel);

            WindowClosing?.Invoke(sender, args);

            if (args.Cancel)
            {
                e.Cancel = true;
            }
        }
Ejemplo n.º 7
0
        private void MetroWindow_Closed(object sender, EventArgs e)
        {
            Keymapper.Stop();
            ProcessWatcher.Stop();
            HapticManager.Stop();

            var aC = ControllerManager.GetActiveController();

            aC?.SetLightbar(0, 0, 0);
            aC?.Stop();
            ControllerManager.Stop();

            _notifyIcon.Visible = false;
            _notifyIcon.Dispose();
            WindowClosing?.Invoke();
        }
Ejemplo n.º 8
0
 public void Handle(WindowClosing message)
 {
     _settings.IsMuted = VideoPlayer.IsMuted;
 }
Ejemplo n.º 9
0
 private void CloseWindow()
 {
     WindowClosing?.Invoke(this, false);
 }
Ejemplo n.º 10
0
 private void AddStep()
 {
     WindowClosing?.Invoke(this, true);
 }
Ejemplo n.º 11
0
 private void OnWindowClosing()
 {
     WindowClosing?.Invoke(this, EventArgs.Empty);
 }
Ejemplo n.º 12
0
 private void AddRecipe()
 {
     WindowClosing?.Invoke(this, true);
 }
Ejemplo n.º 13
0
 private void AddIngredient()
 {
     WindowClosing?.Invoke(this, true);
 }
Ejemplo n.º 14
0
 protected virtual void OnWindowClosing()
 {
     WindowClosing?.Invoke(this, new EventArgs());
 }
Ejemplo n.º 15
0
 private void MainWindow_Closing(object sender, CancelEventArgs e)
 {
     WindowClosing.Execute(this);
     ConnectionService.Instance.Dispose();
 }