示例#1
0
        void window_Closing(object sender, global::System.ComponentModel.CancelEventArgs e)
        {
            string current_thread = "";

            foreach (var th in controller.threads_list)
            {
                if (th.IsAlive)
                {
                    current_thread = current_thread + " " + th.Name;
                }
            }
            if (current_thread != "")
            {
                MessageBoxResult result = MessageBox.Show("this/these task(s) are still in progress:" + current_thread + " ,do you want to close the application?", " close", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No);
                if (result == MessageBoxResult.No)
                {
                    e.Cancel = true;
                }
                else if (result == MessageBoxResult.Yes)
                {
                    foreach (var th in controller.threads_list)
                    {
                        th.Abort();
                    }
                    controller.Close();
                }
            }
            else
            {
                controller.Close();
            }
        }
 internal void OnDeactivate(global::System.ComponentModel.CancelEventArgs e)
 {
     object[] args = new object[] {
         e
     };
     m_privateObject.Invoke("OnDeactivate", new System.Type[] {
         typeof(global::System.ComponentModel.CancelEventArgs)
     }, args);
 }
 // Make sure our threads stop when windows closes
 void window_Closing(object sender, global::System.ComponentModel.CancelEventArgs e)
 {
     if (_APIThread != null)
     {
         if ((_APIThread.SpawnedThread != null) && (_APIThread.SpawnedThread.IsAlive))
         {
             _APIThread.Stop();
         }
     }
 }
示例#4
0
        private async void window_Closing(object sender, global::System.ComponentModel.CancelEventArgs e)
        {
            if (context == null)
            {
                return;
            }

            if (!doClose && !e.Cancel)
            {
                e.Cancel = true;
                await ClosingTasks();
            }
        }
 /// <summary>
 /// On closing control action
 /// </summary>
 void Window_Closing(object sender, global::System.ComponentModel.CancelEventArgs e)
 {
     TurnOffHighlighter();
 }
 void window_Closing(object sender, global::System.ComponentModel.CancelEventArgs e)
 {
     _config.DisconectWindowOpen = false;
     _config.save();
 }
 private void OnWindowClosing(object sender, global::System.ComponentModel.CancelEventArgs e) => Dispose();
示例#8
0
 /// <summary>
 /// Handles the Closing event of the mainForm control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.ComponentModel.CancelEventArgs"/> instance containing the event data.</param>
 void mainForm_Closing(object sender, global::System.ComponentModel.CancelEventArgs e)
 {
     TypeSerializer <TSettings> .ToXmlFile(settingsFileName, Settings);
 }
示例#9
0
 void window_Closing(object sender, global::System.ComponentModel.CancelEventArgs e)
 {
     //helper.CloseSocket();
 }
示例#10
0
 void window_Closing(object sender, global::System.ComponentModel.CancelEventArgs e)
 {
 }
示例#11
0
        void LoginPage_BackKeyPress(object sender, global::System.ComponentModel.CancelEventArgs e)
        {
            WebAuthenticationResult result = new WebAuthenticationResult("", WebAuthenticationStatus.UserCancel, 0u);

            WebAuthenticationResultSource.TrySetResult(result);
        }
 void window_Closing(object sender, global::System.ComponentModel.CancelEventArgs e)
 {
     DrawingService.LeaveDrawing();
 }