private void MammaView_OnClosing(object sender, CancelEventArgs e) { var viewModel = DataContext as MammaViewModel; if (viewModel != null && viewModel.SaveCommand.CanExecute(null)) { var dialogResult = MessageBox.Show("Есть несохраненные изменения. Сохранить их?", "УЗД молочной железы", MessageBoxButton.YesNoCancel, MessageBoxImage.Question, MessageBoxResult.Yes); switch (dialogResult) { case MessageBoxResult.Yes: viewModel.SaveCommand.Execute(null); break; case MessageBoxResult.Cancel: e.Cancel = true; break; } } else { var dialogResult = MessageBox.Show("Вы уверны, что хотите выйти?", "УЗД молочной железы", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes); if (dialogResult == MessageBoxResult.No) { e.Cancel = true; } } }
protected virtual void OnNotInList(CancelEventArgs e) { if (NotInList != null) { NotInList(this, e); } }
public bool SetNewConfig() { CancelEventArgs e = new CancelEventArgs(false); if (SetNewConfigEvent != null) SetNewConfigEvent(this, e); return e.Cancel; }
void collectObjectSpace(object sender, CancelEventArgs e) { if (detController != null && detController.View != null) { XafDeltaModule.Instance.CollectObjectSpace(detController.View.ObjectSpace); } }
private void Window_Closing(object sender, CancelEventArgs e) { var model = (MusicViewModel) DataContext; model.SaveIfDirty(); SaveSettings(); }
void OnConfirmDelete(object sender, CancelEventArgs e) { MessageBoxResult result = MessageBox.Show("Are you sure you want to delete this item?", "Confirm Delete", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.No) e.Cancel = true; }
private void Close(object sender, CancelEventArgs e) { if (_kinectSensor != null) { _kinectSensor.Close(); } }
private void txtPassword2_Validating(object sender, CancelEventArgs e) { if (!ValidarPassword()) { //e.Cancel = true; } }
private void textBox_Validating(object sender, CancelEventArgs e) { var textBox = (TextBox)sender; decimal value = 0; if (allowOnlyInteger) { int intValue; if (!int.TryParse(textBox.Text, out intValue)) { errorProvider.SetError(textBox, "Please enter a valid integer value."); e.Cancel = true; return; } else { value = intValue; errorProvider.SetError(textBox, null); } } else { if (!decimal.TryParse(textBox.Text, NumberStyles.Float, CultureInfo.CurrentCulture.NumberFormat, out value)) { errorProvider.SetError(textBox, "Please enter a valid double value."); e.Cancel = true; return; } else errorProvider.SetError(textBox, null); } if (textBox == minimumTextBox) Minimum = value; else if (textBox == maximumTextBox) Maximum = value; else if (textBox == stepSizeTextBox) Step = value; okButton.Enabled = IsValid(); }
public void BackKeyPressed(CancelEventArgs e) { while (navigationService.BackStack.Any()) { navigationService.RemoveBackEntry(); } }
private void WindowClosing(object sender, CancelEventArgs e) { if(!Validate()) { e.Cancel = true; } }
protected override void OnClosing(CancelEventArgs e) { if (_connector != null) _connector.Dispose(); base.OnClosing(e); }
private void OnClosing(object sender, CancelEventArgs e) { if (!App.Locator.MainWindow.IsAuth) { this.Close(); } }
private void AttributeArgumentEditor_Validating(object sender, CancelEventArgs e) { var validated = false; if (AttributeArgumentEditor.TypeReferenceEditor.SelectedOperand != null) { var arg = AttributeArgumentEditor.SelectedArgument; if (arg.Type is TypeSpecification) { var tspec = arg.Type as TypeSpecification; validated = tspec.ElementType != null; } else validated = true; } if (!validated) { ErrorProvider.SetError(AttributeArgumentEditor, "Type is mandatory"); e.Cancel = true; } else { ErrorProvider.SetError(AttributeArgumentEditor, string.Empty); } }
protected override void OnClosing(CancelEventArgs e) { RegisterOprate.SaveRegData(KeyName, tabs.SelectedIndex); if (MessageBox.Show("确认退出?", "请确认", MessageBoxButtons.YesNo) == DialogResult.No) e.Cancel = true; base.OnClosing(e); }
protected override void OnClosing(CancelEventArgs e) { if (MessageBox.Show("确认退出?", "请确认", MessageBoxButtons.YesNo) == DialogResult.No) e.Cancel = true; SaveRegConfig(); base.OnClosing(e); }
private void Window_OnClosing(object sender, CancelEventArgs e) { var vm = (ElementListToolWindowViewModel)this.DataContext; vm.Remove(); //((ToolWindow)sender).Hide(); //e.Cancel = true; }
public override void OnSetActive(CancelEventArgs e) { MethodList = DataContextHelper.getProcedures(T4CreateViewWizard.TemplateData.ContextReference.DBContextClass.BaseType); RefreshLists(); SetWizardButtons(WizardButtons.Back | WizardButtons.Next); base.OnSetActive(e); }
void OnLogConsoleWindowClosing( object sender, CancelEventArgs e ) { e.Cancel = true; _logConsoleWindow.Visibility = System.Windows.Visibility.Collapsed; _consoleWindowIsClosed = true; OnPropertyChanged( "IsMaximized" ); }
protected override void OnValidating( CancelEventArgs e ) { //string saved = _versionIdentifier == null ? null : _versionIdentifier.Serialize(); //ControlsToData(); //ValidateToSchema(_versionIdentifier); //_versionIdentifier = string.IsNullOrEmpty(saved) ? null : VersionIdentifier.Deserialize(saved); }
protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); Settings.Default.MainWindowPlacement = new JavaScriptSerializer().Serialize(this.GetPlacement()); Settings.Default.Save(); }
private void OnParentClosing(object sender, CancelEventArgs e) { e.Cancel = true; if (Command != null && Command.CanExecute(CommandParameter)) Command.Execute(CommandParameter); }
private void MainWindow_Closing(object sender, CancelEventArgs e) { string s = LanguageDictionary.Current.Translate<string>("ExitProgram", "Text", "Exit program?"); e.Cancel = (MessageBox.Show(s, App.Name, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No); if (!e.Cancel) Model.Options.Maximized = WindowState == WindowState.Maximized; }
protected override void OnClosing(CancelEventArgs e) { if(_appIsClosing) return; e.Cancel = true; Hide(); }
protected override void OnClosing(CancelEventArgs e) { if (null == mDockUrl) { e.Cancel = false; } else if (mDockUrl._isDirty()) { string dockUrlName_ = mDockUrl._getDockUrlName(); if (null == dockUrlName_ || "" == dockUrlName_) { dockUrlName_ = "untitle"; } DialogResult dialogResult_ = MessageBox.Show("是否保存?", dockUrlName_, MessageBoxButtons.OKCancel); if (dialogResult_ == DialogResult.OK) { mDockUrl._runSave(); mDockUrl._runClose(); e.Cancel = false; } else { e.Cancel = true; } } else { mDockUrl._runClose(); e.Cancel = false; } base.OnClosing(e); }
protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); e.Cancel = true; Hide(); formControl.buttonShowGraph.Text = "Показать график"; }
/// <summary> Shuts down the application when the main window closes. </summary> /// <param name="sender"> The sender. </param> /// <param name="e"> The event arguments. </param> private void MainWindowClosing(object sender, CancelEventArgs e) { var vm = (MainWindowViewModel)this.DataContext; vm.SaveSettings(); Application.Current.Shutdown(); }
protected override void OnClosing(CancelEventArgs e) { //Prevent disposal of dialog e.Cancel = true; base.OnClosing(e); Hide(); }
protected override void OnClosing(CancelEventArgs e) { if (_dontShowAgainCheckbox.Checked) { JToolsPackage.Instance.OptionsPage.PromptBeforeRunningWithBuildError = false; JToolsPackage.Instance.OptionsPage.SaveSettingsToStorage(); } }
protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); if (checkBox1.Checked) { // User clicked 'ignore': set flag in VM. log.DebugFormat("Setting IgnoreExcessiveVcpus flag to true for VM {0}", vm.Name); VM copyVM = (VM)vm.Clone(); copyVM.IgnoreExcessiveVcpus = true; // Save changes to server try { vm.Locked = true; copyVM.SaveChanges(vm.Connection.Session); } finally { vm.Locked = false; } } else { // Select VM's settings (a.k.a. 'general') tab if (Program.MainWindow.SelectObject(this.vm)) Program.MainWindow.SwitchToTab(MainWindow.Tab.Settings); } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { appTimer.Stop(); dataAccess.close(); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { UnhookWindowsHookEx(_hookID); }
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { Properties.Settings.Default.WindowSize = new System.Drawing.Size(Convert.ToInt32(Application.Current.MainWindow.ActualWidth), Convert.ToInt32(Application.Current.MainWindow.ActualHeight)); Properties.Settings.Default.WindowState = this.WindowState; Properties.Settings.Default.Save(); }
private void frmReport_Closing(object sender, System.ComponentModel.CancelEventArgs e) { mTCBase.SaveBounds(mRegistryKey, this.Left, this.Top, this.Width, this.Height); }
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { this.Menu.MenuItems.Clear(); base.OnClosing(e); }
private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { _controller = null; }
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { }
private void pwStep4Folder_ValidateStep(object sender, System.ComponentModel.CancelEventArgs e) { ProfileWizard wiz = Wizard as ProfileWizard; wiz.Profile.MulManager.CustomFolder = m_CustomFolder; }
void OpenFileDialog1FileOk(object sender, System.ComponentModel.CancelEventArgs e) { }
private void MainGUI_Closing(object sender, System.ComponentModel.CancelEventArgs e) { myGame.Exit(); }
private void frmCadastros_Closing(object sender, System.ComponentModel.CancelEventArgs e) { frmPrincipal.fPrincipal.statusBar1.Panels[1].Text = ""; }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { //_sensor.Dispose(); bluetoothObj.Dispose(); }
private void SpinGlobe_Closing(object sender, System.ComponentModel.CancelEventArgs e) { //Release COM Objects ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown(); }
private void importdialog_FileOk(object sender, System.ComponentModel.CancelEventArgs e) { FileInfo fi = new FileInfo(importDialog.FileName); attemptImport(fi); }
private void PostCode_Validating(System.Object sender, System.ComponentModel.CancelEventArgs e) { txtPostCodeFrom.Text = txtPostCodeFrom.Text.ToUpper(); txtPostCodeTo.Text = txtPostCodeTo.Text.ToUpper(); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { Usefull_Tools.Logger.logMain("Stopping ..." + Environment.NewLine); }
private void CompletePage_SetActive(object sender, System.ComponentModel.CancelEventArgs e) { SetWizardButtons(WizardButtons.Finish); }
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { StopCamera(); }
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { base.OnClosing(e); _projectDataContext.Dispose(); }
private void ProtocolResultVialSelection_Closing(object sender, System.ComponentModel.CancelEventArgs e) { UpdateCheckboxes(m_iLastIdx); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { this.wathcer.Dispose(); }
private void Form1_FormClosing(object sender, System.ComponentModel.CancelEventArgs e) { listening = false; terminating = true; Environment.Exit(0); }
private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = true; Hide(); }
protected override void OnValidating(System.ComponentModel.CancelEventArgs e) { //do nothing }
private void FlowsheetOptionsForm_Closing(object sender, System.ComponentModel.CancelEventArgs e) { // nothing at this moment }
private void ProductionDebug_Closing(object sender, System.ComponentModel.CancelEventArgs e) { this.Hide(); radPIOOff.Checked = true; e.Cancel = true; }
private void Progress_Closing(object sender, System.ComponentModel.CancelEventArgs e) { this.Hide(); e.Cancel = true; }
private void DlgSaveLog_FileOk(object sender, System.ComponentModel.CancelEventArgs e) { TxtLogFile.Text = DlgSaveLog.FileName; }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { login.Show(); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { Dispose(); e.Cancel = false; }