Inheritance: CancelEventArgs
        private void OnFormClosing(object sender, FormClosingEventArgs e)
        {
            SaveFormState(sender as Form);

            if (Changed != null)
                Changed();
        }
 private void MFUsbConfigDialog_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (m_cfgHelper != null)
     {
         m_cfgHelper.Dispose();
     }
 }
Beispiel #3
1
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     notifyIcon1.Visible = false;
     timer1.Enabled = false;
     serialPort1.Close();
     Serial_connect_status(false);
 }
Beispiel #4
1
 void ServerRithmicMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     _log.Stop();
     if (sr != null)
         sr.Stop();
     Properties.Settings.Default.Save();
 }
 private void frm_about_FormClosing(object sender, FormClosingEventArgs e)
 {
     for ( int i = 0; i < 10; i++ ) {
         Thread.Sleep(60);
         this.Opacity = this.Opacity - 0.1;
     }
 }
Beispiel #6
1
 private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         Microsoft.Win32.RegistryKey keyApp = Application.UserAppDataRegistry;
         if (null == keyApp)
         {
             return;
         }
         keyApp.SetValue("windowState", (int)WindowState);
         keyApp.SetValue("width", Width);
         keyApp.SetValue("height", Height);
         keyApp.SetValue("top", Top);
         keyApp.SetValue("left", Left);
         keyApp.SetValue("shaderFileName", shaderFileName);
         keyApp.SetValue("textureFileName", texture1.Text);
         keyApp.SetValue("texture2FileName", texture2.Text);
         keyApp.SetValue("soundFileName", soundFileName);
         keyApp.SetValue("play", soundPlayerBar1.Playing);
         keyApp.SetValue("granularity", this.granularity.Text);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #7
1
        /// <summary>
        /// Form is closing.
        /// </summary>
        private void FormLogFormClosing(object sender, FormClosingEventArgs e)
        {
            ClassWinGeometry.Save(this);

            // Remove our print function delegate
            App.PrintLogMessage -= Print;
        }
		private void FormSnapshotName_FormClosing(object sender, FormClosingEventArgs e)
		{
			if (DialogResult != DialogResult.OK) return;
			if (!String.IsNullOrEmpty(textEditScheduleName.EditValue as String)) return;
			e.Cancel = true;
			PopupMessageHelper.Instance.ShowWarning("You should set Snapshot name before continue");
		}
Beispiel #9
1
 private void GUIcomment_FormClosing(object sender, FormClosingEventArgs e)
 {
     gui.Invoke((MethodInvoker)delegate
     {
         gui.Enabled = true;
     });
 }
        private void frmNotes_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (OriginalText == txtNotes.Text) return;

            if (EventName != null)
            {
                Tournament tournament = Config.Settings.GetTournament(EventName);
                if (tournament != null)
                {
                    tournament.Notes = txtNotes.Text;
                    Config.Settings.SaveEvents();
                    return;
                }
                League league = Config.Settings.GetLeague(EventName);
                if (league != null)
                {
                    league.Notes = txtNotes.Text;
                    Config.Settings.SaveEvents();
                    return;
                }
            }
            else
            {
                Config.Settings.Notes = txtNotes.Text;
                Config.Settings.SaveSettings();
            }
        }
Beispiel #11
1
        private void FeedbackForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (DialogResult == DialogResult.OK)
            {
                if (nameTextBox.Text.Length < 4)
                {
                    Error("Please enter your name before submitting your feedback.");
                    e.Cancel = true;
                    return;
                }
                if (emailTextBox.Text.Length < 4 || !emailTextBox.Text.Contains("@") || !emailTextBox.Text.Contains("."))
                {
                    Error("Please enter your email address before submitting your feedback.");
                    e.Cancel = true;
                    return;
                }

                string text = nameTextBox.Text + ":" + emailTextBox.Text + ":" + textBox.Text + ":" + AboutBox.AssemblyVersion+":"+Environment.OSVersion.ToString();
                string result = null;
                try
                {
                    result = Submit(text);
                }
                catch (Exception)
                {
                }
                if (result == null)
                {
                    Error("Sorry, we couldn't submit your feedback right now. Please make sure your Internet connection is working.\nOr, you can send your feedback via email to the address in the About box.");
                    e.Cancel = true;
                    return;
                }
                MessageBox.Show(this, result, this.Text, MessageBoxButtons.OK);
            }
        }
Beispiel #12
1
        /// <summary>
        /// �ر��¼�
        /// ����TE�¼� 
        /// �����Դ
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmCustomPath_FormClosing(object sender, FormClosingEventArgs e)
        {
            Program.TE.OnLButtonDown -= new TerraExplorerX._ITerraExplorerEvents5_OnLButtonDownEventHandler(TE_OnLButtonDown);
            Program.TE.OnFrame -= new TerraExplorerX._ITerraExplorerEvents5_OnFrameEventHandler(TE_OnFrame);
            Program.TE.OnRButtonDown -= new TerraExplorerX._ITerraExplorerEvents5_OnRButtonDownEventHandler(TE_OnRButtonDown);

            if (this.lock_deleteObj)
            {
                try
                {
                    Program.TE.DeleteItem(this.dynamicObj.InfoTreeItemID);

                }
                catch (Exception)
                {
                }

            }
            try
            {
                Program.TE.DeleteItem(this.polyLine.InfoTreeItemID);
            }
            catch (Exception)
            {

            }

            this.Dispose();
            this.Close();
        }
Beispiel #13
1
 private void Program_FormClosing(object sender, FormClosingEventArgs e)
 {
     Console.WriteLine ("End of Game");
     if (wld != null) {
         wld.Destroy ();
     }
 }
 private void AccountPropertiesDialog_FormClosing( object sender, FormClosingEventArgs e )
 {
     if( ctx == null || DialogResult != DialogResult.OK ) {
         return;
     }
     if( string.IsNullOrEmpty( textBox1.Text ) ) {
         MessageBox.Show( "Du måste ange ett namn" );
     }
     _account = new Account {
         Name = textBox1.Text
     };
     if( account != null ) {
         _account.ID = account.ID;
     }
     foreach( Control c in panel1.Controls ) {
         CheckBox cb = c as CheckBox;
         if( cb == null || !cb.Checked ) {
             continue;
         }
         User u = (User)cb.Tag;
         _account.PermittedUsers.Add( u.ID );
     }
     NameValueCollection values = new NameValueCollection();
     values.Add( "Name", _account.Name );
     values.Add( "ID", _account.ID );
     foreach( int uid in _account.PermittedUsers ) {
         values.Add( "userid", uid );
     }
     _account = ctx.ServiceCaller.PostData<Account>( string.Format( "{0}/AccountService/Save", ctx.ServiceBaseURL ), values );
 }
Beispiel #15
1
 private void FacebookUploader_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (isWorking)
         if (e.Cancel = !(MessageBox.Show("There are still images to upload.\nConfirm cancelation?", "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
             == System.Windows.Forms.DialogResult.Yes))
             deleteFolder(directoryPath.FullName);
 }
Beispiel #16
1
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     if (e.CloseReason == CloseReason.UserClosing)
     {
         WorkbenchSingleton.Workbench.CloseView(content);
     }
 }
 private void ProfScheduleForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     //
     // Read all checkBox in dgvSchedule and save that in string array
     //
     string[] Day = new string[7];
     for (int columnIndex = 1; columnIndex < 8; columnIndex++)
     {
         Day[columnIndex - 1] = string.Empty;
         for (int rowIndex = 0; rowIndex < 12; rowIndex++)
         {
             if (dgvSchedule[columnIndex, rowIndex].Value != null)
             {
                 if (dgvSchedule[columnIndex, rowIndex].Value.ToString() == "True")
                 {
                     Day[columnIndex - 1] += (string)dgvSchedule[0, rowIndex].Value.ToString() + " & ";
                 }
             }
         }
     }
     //
     // clear over plus text in string array and add in dgvProfessor
     //
     interface_TextBox.Value = string.Empty;
     string buffer = "";
     for (int i = 0; i < 7; i++)
     {
         // clear overPlus data as string Array
         Day[i] = Day[i].Substring(0, (Day[i].Length > 2) ? Day[i].Length - 2 : 0);
         // add day schedule in DataGridView dgvProfessor
         string dayName = "";
         switch (i)
         {
             case 0: dayName = "SAT";
                 break;
             case 1: dayName = "SUN";
                 break;
             case 2: dayName = "MON";
                 break;
             case 3: dayName = "THU";
                 break;
             case 4: dayName = "WED";
                 break;
             case 5: dayName = "THR";
                 break;
             case 6: dayName = "FRI";
                 break;
         }
         buffer += (Day[i].Length > 2) ? dayName + " { " + Day[i] + "} & " : "";
     }
     interface_TextBox.Value = buffer.Substring(0, (buffer.Length > 2) ? buffer.Length - 2 : 0);
     bool FREE = true;
     for (int i = 0; i < 12; i++)
         for (int j = 1; j < 8; j++)
             if (dgvSchedule[j, i].Value == null)
             { FREE = false; break; }
             else if (dgvSchedule[j, i].Value.ToString() == "false")
             { FREE = false; break; }
     if (FREE) interface_TextBox.Value = "FREE";
 }
        /// <summary>
        /// Function that overrides the default behavior of the X button on the form
        /// Permitting to show the hidden MainForm.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            base.OnFormClosing(e);

            if (e.CloseReason == CloseReason.WindowsShutDown) return;

            // Confirm user wants to close
            if (BTN_ExportData.Enabled)
            {
                switch (MessageBox.Show(this, "Etes vous certain de vouloir quitter sans Sauvegarder?", "Closing", MessageBoxButtons.YesNoCancel))
                {
                    case DialogResult.No:
                    case DialogResult.Cancel:
                        e.Cancel = true;
                        break;
                    default:
                        Application.OpenForms[0].Show();
                        break;
                }
            }
            else
            {
                Application.OpenForms[0].Show();
            }
        }
 private void frmbackup_FormClosing(object sender, FormClosingEventArgs e)
 {
     frm_Main.activeFrom[13] = 13;
     //Thread thread = new Thread(new ThreadStart(hienform_main)); //Tạo luồng mới
     //thread.Start(); //Khởi chạy luồng
     //this.Close(); //đóng Form hiện tại. (Form1);
 }
Beispiel #20
0
 private void Users_FormClosing(object sender, FormClosingEventArgs e)
 {
     usersBindingSource.EndEdit();
     usersTableAdapter.Update(baseDataSet);
     baseDataSet.AcceptChanges();
     this.Hide();
 }
Beispiel #21
0
 private void AddEdManagerForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (DialogResult == DialogResult.OK)
         managerBindingSource.EndEdit();
     else
         managerBindingSource.CancelEdit();
 }
        private void Config_FormClosing(object sender, FormClosingEventArgs e)
        {
            //TODO: Validar se arquivo .mfc é válido
            if (_contadorErro <= 3 && !System.IO.File.Exists(txtPasta.Text))
            {
                MessageBox.Show("Por favor, selecione um arquivo válido de configurações do Mock MF.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                e.Cancel = true;
                _contadorErro++;
                return;
            }

            if (_contadorErro > 3)
            {
                e.Cancel = false;
                Application.Exit();
                return;
            }

            FileInfo fInfo = new FileInfo(txtPasta.Text);
            Configuracoes.CaminhoArquivo = fInfo.DirectoryName;
            Configuracoes.TelaInicial = Path.GetFileNameWithoutExtension(txtPasta.Text);
            var baseMFSerializer =new Serializer<BaseMF>();
            if (checkSalvar.Checked)
                File.WriteAllText(String.Format("{0}\\{1}.xml", Application.LocalUserAppDataPath, Configuracoes.Nome), baseMFSerializer.XmlSerialize(Configuracoes));
        }
Beispiel #23
0
 private void Dashboard_FormClosing(object sender, FormClosingEventArgs e)
 {
     doUpdate = false;
     updateThread.Interrupt();
     this.Dispose(true);
     Environment.Exit(0);
 }
Beispiel #24
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     foreach (Process p in processes)
     {
         p.Kill();
     }
 }
        private void FormMailMapFormClosing(object sender, FormClosingEventArgs e)
        {
            var needToClose = false;

            if (!IsFileUpToDate())
            {
                switch (MessageBox.Show(this, _saveFileQuestion.Text, _saveFileQuestionCaption.Text, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
                {
                    case DialogResult.Yes:
                        if (SaveFile())
                            needToClose = true;
                        break;
                    case DialogResult.No:
                        needToClose = true;
                        break;
                    default:
                        break;
                }
            }
            else
                needToClose = true;

            if (!needToClose)
                e.Cancel = true;
        }
Beispiel #26
0
 private void frmLogIn_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.DialogResult != DialogResult.OK)
     {
         this.DialogResult = DialogResult.Abort;
     }
 }
Beispiel #27
0
 private void frmEditHook_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (DialogResult == DialogResult.OK)
     {
         SaveProperties();
     }
 }
Beispiel #28
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     if (t != null && t.IsAlive)
     {
         t.Abort();
         t = null;
     }
     if (Opacity != 0.0)
     {
         e.Cancel = true;
         new Thread(() =>
         {
             while (Opacity != 0.0)
             {
                 Invoke((MethodInvoker)delegate
                 {
                     Opacity -= 0.1;
                 });
                 Thread.Sleep(50);
             }
             Invoke((MethodInvoker)delegate
             {
                 base.OnFormClosing(e);
                 Close();
             });
         }).Start();
     }
 }
Beispiel #29
0
 private void MainPage_FormClosing(object sender, FormClosingEventArgs e)
 {
     timerMain.Dispose();
     sysTrayContextMenu.Dispose();
     sysTrayIcon.Dispose();
     Application.Exit();
 }
 private void RelatorioForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if(admin == false)
     {
         Application.Exit();
     }
 }
 private void DateAndTime_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     for (double counter = 1.0 #; counter >= 0.0 #; counter += -0.02 #)
     {
         this.Opacity = counter;
         this.Refresh();
         System.Threading.Thread.Sleep(10);
     }
 }
Beispiel #32
0
 // Note: the original parameters are Object Sender, ref TCloseAction Action
 public void FormClose(System.Object Sender, System.Windows.Forms.FormClosingEventArgs _e1)
 {
     Units.Settings.BacklinkForm.Enabled = true;
     if (Units.Settings.BacklinkSettings.SaveToIni)
     {
         Units.Settings.BacklinkSettings.WriteToFile(Units.Settings.IniFileName);
     }
     Units.Settings.SettingsForm.Hide();
     _e1.Cancel = true;
 }
Beispiel #33
0
 private void DataSocketClientApplication_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     try
     {
         this._dataSocketClient.Dispose();
     }
     catch (Exception)
     {
     }
 }
Beispiel #34
0
 private static void frm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     if (DialogRes != null)
     {
     }
     else
     {
         DialogRes = DialogResult.None;
     }
 }
Beispiel #35
0
 private void Form1_FormClosing(object sender,
                                System.Windows.Forms.FormClosingEventArgs e)
 {
     if (isExecuting)
     {
         MessageBox.Show(this, "Cannot close the form until " +
                         "the pending asynchronous command has completed. Please wait...");
         e.Cancel = true;
     }
 }
 public void BroadCastCliientTest_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     try
     {
         this._client.Dispose();
     }
     catch (Exception)
     {
     }
 }
 public void frmCNDServiceApplication_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     try
     {
         _CNDService.Dispose();
     }
     catch (Exception)
     {
     }
 }
Beispiel #38
0
        private void SetEquipment_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
        {
            ///防止事件在执行的之前 被其他的线程移除掉委托
            var temp = Volatile.Read(ref _refreshControl);

            if (null != temp)
            {
                temp(this.textEquipmentNick.Text);
            }
        }
Beispiel #39
0
 private void Main_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     foreach (Form splitWindow in this.tabbedMDIManager1.MdiChildren)
     {
         if (this.ActiveMdiChild != null && this.ActiveMdiChild.Text == splitWindow.Text)
         {
             splitWindow.Close();
         }
     }
 }
Beispiel #40
0
 public void frmCNDClientMAinform_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     try
     {
         this._CNDClient.Dispose();
     }
     catch (Exception)
     {
     }
 }
Beispiel #41
0
 private void WaitEntityFramework_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     if (this.progressPanel1.InvokeRequired)
     {
         this.Invoke(new MethodInvoker(delegate
         {
             this.progressPanel1.Caption = "  Iniciando ...";
         }));
     }
 }
 public void frmSTXServiceHandlerClient_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     try
     {
         this._STXServiceClient.Dispose();
     }
     catch (Exception)
     {
     }
 }
 public void broadCastTestForm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     try
     {
         this._broadCastDataReceiver.Dispose();
     }
     catch (Exception)
     {
     }
 }
 private void DataSocketServerTestForm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     try
     {
         this._DataSocketServer.Dispose();
     }
     catch (Exception)
     {
     }
 }
Beispiel #45
0
        private void friendList_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
        {
            try
            {
                server_NC.Send_message("logout" + myName);
            }
            catch
            { }

            server_NC.Close();
        }
Beispiel #46
0
        public void Main_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
        {
            tabPageContent.Dispose();
            tabPage.Dispose();
            tabbedForm.Dispose();
            tab.Dispose();

            base.Dispose();

            OpenFormCount--;
        }
Beispiel #47
0
        private void Form_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
        {
            Alam.Close();
            BinaryFormatter binFmt = new BinaryFormatter();

            using (FileStream fs = new FileStream(Global.ReDownloadPath, FileMode.Create))
            {
                binFmt.Serialize(fs, Global.HioDownGalleries);
            }
            Global.ProgramExit = true;
        }
 public void frmSTXDataSocketClient_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     try
     {
         this._STXDataSocketClient.DisconnectFromServer();
         this._STXDataSocketClient.Dispose();
     }
     catch (Exception)
     {
     }
 }
Beispiel #49
0
 //窗口关闭前关闭连接
 private void chatWindow_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     receive_tr.Abort();
     //释放内存
     GC.Collect();
     GC.WaitForPendingFinalizers();
     if (Environment.OSVersion.Platform == PlatformID.Win32NT)
     {
         SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1);
     }
 }
Beispiel #50
0
        private void NoteForm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
        {
            visible = false;
            VisibleChangedEventArgs args = new VisibleChangedEventArgs()
            {
                Visible = visible
            };

            OnVisibleChanged(args);
            noteForm.Dispose();
        }
 private void Form1_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     if (MessageBox.Show("Deseja Encerrar a Aplicação?", "Sair", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
     {
         Environment.Exit(0);
     }
     else
     {
         e.Cancel = true;
     }
 }
Beispiel #52
0
 private void MainForm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     if (MetroMessageBox.Show(this, "정말 종료하시겠습니까?", "종료", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
     {
         e.Cancel = false; //이게 값이 없는거니까 ok
     }
     else
     {
         e.Cancel = true; // 이게 값이 있는거니까 no
     }
 }
Beispiel #53
0
 void Main_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     if (MessageBox.Show("Do you want to close the application?", "Tracker", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         this.logToFile(-2, null);
     }
     else
     {
         e.Cancel = true;
     }
 }
Beispiel #54
0
    private void FilterTest_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
    {
        Cursor = Cursors.WaitCursor;

        if (this.DialogResult == System.Windows.Forms.DialogResult.None)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }
        CutoffLevel = (int)(nudCutoffValue.Value);
        Cursor      = Cursors.Default;
    }
Beispiel #55
0
 // Controla el evento de cerrado de ventada evitando que este ocurra cuando se presiona
 // la combinación de teclas ALT + F4
 private void Turnos_Closing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     if (!estaEn130Horas)
     {
         e.Cancel = true;
     }
     else
     {
         Application.Exit();
     }
 }
Beispiel #56
0
 private void frmPrincipal_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     if (MessageBox.Show("Deseja realmente sair ?", "Saindo...", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         System.Environment.Exit(0);
     }
     else
     {
         e.Cancel = true;
     }
 }
Beispiel #57
0
 void fasGetAccountCode_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     sAccountCodeToReceive = fasGetAccountCode.sGetAccountCode();
     if (sAccountCodeToReceive != "NONE_SELECTED")
     {
         string[] sExtraInfo = { tEngine.sGetAccountDetailsFromCode(sAccountCodeToReceive)[2].TrimEnd('\0').TrimEnd(' ') };
         fiGetAmount = new frmInput(frmInput.FormType.ReceivedOnAccount, pLocation, new Size(sSize.Width, 75), sExtraInfo);
         fiGetAmount.Show();
         fiGetAmount.FormClosing += new FormClosingEventHandler(fiGetAmount_FormClosing);
     }
 }
Beispiel #58
0
 /// <summary>
 /// Checks if the form has unsaved changes, and allows the user to cancel the forms close
 /// </summary>
 /// <param name="sender">the object calling this method</param>
 /// <param name="e"></param>
 private void LevelEdit_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     if (unsaved)
     {
         DialogResult result = MessageBox.Show("There are unsaved changes. Are you sure you want to quit?", "Unsaved Changes", MessageBoxButtons.YesNo);
         if (result == DialogResult.No)
         {
             e.Cancel = true;
         }
     }
 }
Beispiel #59
0
        /// <summary>
        /// 关闭窗口时保存数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form_Login_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
        {
            tcpClientLogin.Close();
            tcpListenerUser.Stop();
            if (this.textBox_UesrAccount.Text == null)
            {
                return;
            }
            string lastUser = this.textBox_UesrAccount.Text;

            Registry.AddKey2Registry("PublishClient", "LastUser", lastUser);
        }
Beispiel #60
0
 private new void Closing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     if (MessageBox.Show("Tem certeza que deseja sair da aplicação?", "Sair",
                         MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
     {
         Application.Exit();
     }
     else
     {
         e.Cancel = true;
     }
 }