private void OnPlayButtonClick(object sender, EventArgs e) { if (_game != null) { var processInfo = new ProcessStartInfo(_game.Location, _game.PathAddition); Process.Start(processInfo); var loadingIndicator = new LoadingIndicator(); Controls.Add(loadingIndicator); loadingIndicator.GameInfo = _game; loadingIndicator.Location = new Point(312, 181); loadingIndicator.BringToFront(); if (_settings != null && _settings.CloseLauncherOnGameStart) { ParentForm?.Close(); } } else { MessageBox.Show(this, "The game path couldn't been located. Please select the right location in the settings tab.", "Game location not found", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
void btnOpt2_Click(object sender, EventArgs e) { switch (btnOpt2.Text) { case "No": isNo = true; ParentForm?.Close(); break; } }
private void pbExit_Click(object sender, EventArgs e) { var mouse = e as MouseEventArgs; if (mouse?.Button != MouseButtons.Left) { return; } ParentForm?.Close(); }
public void Release() { if (ParentForm is GameForm f) { f.Remove(this); } else // Popup { ParentForm?.Close(); } }
private void btnSubmit_Click(object sender, EventArgs e) { try { SaveManagedSecuritiesData(); ParentForm?.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btPayment_Click(object sender, System.EventArgs e) { var actions = new ActionForm(new UcPayments(CurrentUserId)) { Text = @"PAYMENTS", //copy icons folder to ...//TvForms/bin/Debug/icons - folder for icons Icon = new Icon(@"icons\dollar.ico") }; ParentForm?.Close(); actions.ShowDialog(); }
void btnOpt1_Click(object sender, EventArgs e) { switch (btnOpt1.Text) { case "OK": ParentForm?.Close(); break; case "Yes": _buttonSelected = 2; ParentForm?.Close(); break; } }
protected void ClickCancel() { var form = ParentForm as DialogForm; if (form != null) { form.ClickCancel(); } else { ParentForm.DialogResult = DialogResult.Cancel; ParentForm.Close(); } }
public void RefreshBus_RefreshObject(object sender, RefreshObjectEventArgs e) { //if we don't exist! if (_collection.DatabaseObjects.Any()) { if (!((IRevertable)_collection.DatabaseObjects[0]).Exists()) { if (ParentForm != null) { ParentForm.Close(); } } } }
private void Exit() { try { Settings.SaveControlValue <PB0501>(Login, cbxCustomerCodeTo.Name, cbxCustomerCodeTo.Checked); Settings.SaveControlValue <PB0501>(Login, cbxStaffCodeTo.Name, cbxStaffCodeTo.Checked); ParentForm.Close(); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
protected override void OnMouseClick(MouseEventArgs e) { if (ParentForm == null) { return; } if (_hoveredIndex == 0) { ParentForm.WindowState = FormWindowState.Minimized; } else { ParentForm.Close(); } }
private void btnSubmitTrading_Click(object sender, EventArgs e) { TradingInfo.OptionCount = (int)numOptionsCount.Value; if ((int)rgpSellOrBuy.EditValue == 1) { //Sell: TradingInfo.OrderAction = OrderAction.SELL; } else { //Buy: TradingInfo.OrderAction = OrderAction.BUY; } ParentForm.Close(); }
private void btnCancel_Click(object sender, EventArgs e) { try { //Visible = false; //Parent.Controls.Remove(this); //Dispose(); ParentForm.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnInPatientPayments_Click(object sender, System.EventArgs e) { BaseController <InvoicePayment> .ShowEditorControl(ref _invoicePayment, this, null, null, EditorContainerType.Settings, ViewerName.InvoicePayment_Viewer, DB_CommonTransactionType.CreateNew, ".... الخـزينـــــة ....", true); if (_invoicePayment != null) { _invoicePayment.MedicalInitialize(InvoiceObject.ActiveInvoice); } if (ParentForm != null) { ParentForm.Close(); } }
private void btOrderView_Click(object sender, EventArgs e) { var actions = new ActionForm(new UсOrdersView(CurrentUserId)) { Text = @"User orders history", //copy icons folder to ...//TvForms/bin/Debug/icons - folder for icons Icon = new Icon(@"icons\wallet.ico") }; if (ParentForm != null) { ParentForm.Close(); actions.ShowDialog(); } }
private void Exit() { int index = tbcReminderSetting.SelectedIndex; bool changeFlg = (index == (int)SettingTabIndex.CommonSetting && CommonChangeFlg) || (index == (int)SettingTabIndex.TemplateSetting && TemplateChangeFlg) || (index == (int)SettingTabIndex.LevelSetting && IsLevelSettingEdit()) || (index == (int)SettingTabIndex.SummarySetting && SummaryChangeFlg); if (changeFlg && !ShowConfirmDialog(MsgQstConfirmClose)) { return; } ParentForm.Close(); }
private void button_save_Click(object sender, EventArgs e) { //account.api if (account.api.key.Length > 0 && account.api.secret.Length > 0) { EarnGG.EarnGGAccount listItem = PreferenceManager.EarnGGPreferences.EarnGGAccounts.FirstOrDefault(item => item.api.key == account.api.key && item.api.secret == account.api.secret); if (listItem == null) { PreferenceManager.EarnGGPreferences.EarnGGAccounts.Add(account); //PreferenceManager.UpdatePreferenceSnapshots(); PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.EarnGG); EarnGG.UpdateUI(); ParentForm.Close(); } } }
private void CompleteTabPageRenaming() { //validate if (txtNewName.Text.Length == 0) { MessageBox.Show(this, "Tab page name can not be empty!", "Invalid Tab page name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } TabPageName = txtNewName.Text; if (ParentForm != null) { ParentForm.DialogResult = DialogResult.OK; ParentForm.Close(); } }
private void btnOk_Click(object sender, EventArgs e) { //validate if (txtNewName.Text.Length == 0) { MessageBox.Show(this, "Tab page name can not be empty!", "Invalid Tab page name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } TabPageName = txtNewName.Text; if (ParentForm != null) { ParentForm.DialogResult = DialogResult.OK; ParentForm.Close(); } }
private void m_btnAdd_Click(object sender, EventArgs e) { string fileName = m_txtXDLMacro.Text; if (!System.IO.File.Exists(fileName)) { MessageBox.Show("File " + fileName + " not found", "File not found", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } AddXDLLibraryElement addCmd = new AddXDLLibraryElement(); addCmd.FileName = fileName; Commands.CommandExecuter.Instance.Execute(addCmd); ParentForm.Close(); }
private void btnDelete_Click(object sender, System.EventArgs e) { if (BaseControllerObject.SaveChanges(DB_CommonTransactionType.DeleteExisting)) { if (BaseControllerObject.Close()) { if (ParentForm != null) { if (ParentForm.ParentForm != null) { ParentForm.ParentForm.BringToFront(); } ParentForm.Close(); } } } }
private void btnCancel_Click(object sender, EventArgs e) { var arg = new CancelEventArgs(); //Throw the event out to subscribers if (CloseFromCancel != null) { CloseFromCancel(this, arg); } //If nobody told me to cancel if (!arg.Cancel && ParentForm != null) { ParentForm.DialogResult = DialogResult.Cancel; //Then we close the form ParentForm.Close(); } }
private async void btnSave_Click(object sender, EventArgs e) { try { var user = await userService.GetById <MUser>(_ID); UserUpsertRequest request = null; if (txtOldPassword.Text == APIService.Password) { request = new UserUpsertRequest { FirstName = user.FirstName, LastName = user.LastName, Username = user.Username, Email = user.Email, PhoneNumber = user.PhoneNumber, Image = user.Image, Password = txtNewPassword.Text, PasswordConfirmation = txtNewPasswordConfirm.Text }; } else { MessageBox.Show("Old password is not correct!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (txtNewPassword.Text != txtNewPasswordConfirm.Text) { MessageBox.Show("Passwords do not match!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } await userService.Update <MUser>(_ID, request); MessageBox.Show("Succesfully changed, please log in to confirm changes.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); var form = new frmLogin(); form.Show(); ParentForm.Close(); } catch { MessageBox.Show("Ups, something went wrong!"); } }
private void ExitForm() { try { if (IsGridModified && !ShowConfirmDialog(MsgQstConfirmClose)) { return; } Settings.SaveControlValue <PE0701>(Login, nmbLength.Name, nmbLength.Value); ParentForm.Close(); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void HandleTooSmall() { var schemaManager = new DiagramPropertySchemaManager(_diagram.Model); var propertyType = schemaManager.GetDpiFactorPropertyType(); if (propertyType != null) { if ((_diagram.GetProperty(propertyType) ?? _diagram.AddProperty(propertyType, null)) is IPropertyDecimal property) { property.Value /= 2; MessageBox.Show(this, "The Diagram will now be closed.\nPlease open it again and apply the minor fixes which may eventually be required", "Diagram fix", MessageBoxButtons.OK, MessageBoxIcon.Information); ParentForm?.Close(); } } }
private void classicButton2_Click(object sender, EventArgs e) { classicButton3.Show(); panel1.Controls.Clear(); if (state == 0) { var eula = new InstallerPanes.EULAPane(); eula.Parent = panel1; state = 1; classicButton2.Enabled = false; } else if (state == 1) { var dir = new InstallerPanes.DirectoryPane(); dir.Parent = panel1; state = 2; } else if (state == 2) { classicButton3.Hide(); classicButton1.Enabled = false; classicButton2.Enabled = false; var p = new InstallerPanes.ProgressPane(); p.Parent = panel1; state = 3; } else if (state == 3) { OnInstallCompleted(EventArgs.Empty); var c = new InstallerPanes.CompletePane(); c.Parent = panel1; classicButton3.Enabled = false; classicButton2.Enabled = true; classicButton2.Text = "Finish"; classicButton2.Invalidate(); state = 4; } else { ParentForm.Close(); } }
internal EditDataViewVehicle(Vehicle v) { InitializeComponent(); buttonAccept.Text = "Fahrzeug bearbeiten"; if (v != null) { vehicleOld = v; txtConstructionYear.Text = v.ConstructionYear.ToString(); txtFuelCon.Text = v.FuelConsumption.ToString(); txtMaxTankFilling.Text = v.MaxTankFilling.ToString(); txtMileage.Text = v.Mileage.ToString(); txtModel.Text = v.Model; txtNumberplate.Text = v.NumberPlate; txtPosX.Text = v.Position.X.ToString(); txtPosY.Text = v.Position.Y.ToString(); txtPower.Text = v.Power.ToString(); txtPrice.Text = v.BasicPrice.ToString(); txtPriceKilo.Text = v.PricePerKilometre.ToString(); txtPriceMin.Text = v.PricePerMinute.ToString(); txtReg.Text = v.Registration.ToShortDateString(); txtSeats.Text = v.Seats.ToString(); txtTankFilling.Text = v.TankFilling.ToString(); checkABS.Checked = v.ABS; checkAirConditioner.Checked = v.AirConditioner; checkAvailable.Checked = v.Available; checkBluetooth.Checked = v.Bluetooth; checkCDPlayer.Checked = v.CDPlayer; checkCruiseControl.Checked = v.CruiseControl; checkESP.Checked = v.ESP; checkHeatedSeat.Checked = v.SeatHeating; checkNavigationDevice.Checked = v.Navi; checkRadio.Checked = v.Radio; checkSmoker.Checked = v.Smoker; checkUSB.Checked = v.USB; checkWinter.Checked = v.WinterTire; } else { ParentForm.Close(); } }
private void btnAddService_Click(object sender, EventArgs e) { if (lstLabServices_Selected.DataSource == null || ((List <Service_cu>)lstLabServices_Selected.DataSource).Count == 0) { XtraMessageBox.Show("يجب إختيار إختبارت قبل الإضافة", "تنبيه", MessageBoxButtons.YesNo, MessageBoxIcon.Error); return; } if (lkeDoctor.EditValue == null) { XtraMessageBox.Show("يجب إختيار الطبيب قبل الإضافة", "تنبيه", MessageBoxButtons.YesNo, MessageBoxIcon.Error); return; } if (dtServiceDate.EditValue == null) { XtraMessageBox.Show("يجب إختيار تاريخ الإضافة", "تنبيه", MessageBoxButtons.YesNo, MessageBoxIcon.Error); return; } DialogResult result = XtraMessageBox.Show("هل تريد إضافة خدمات المعمل ؟", "تنبيه", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation); switch (result) { case DialogResult.Yes: if (ParentForm != null) { ParentForm.DialogResult = DialogResult.Yes; ParentForm.Close(); } break; case DialogResult.No: if (ParentForm != null) { ParentForm.DialogResult = DialogResult.No; } break; } }
private void okButton_Click(object sender, EventArgs e) { switch ((string)comboBox1.SelectedItem) { case "Default": SaveSystem.CurrentSave.ThemeName = "default95"; SaveSystem.currentTheme = new Default95Theme(); TitleScreen.frm95.BackgroundImage = null; TitleScreen.frm95.desktopicons.BackgroundImage = null; break; case "Dangerous Creatures": SaveSystem.CurrentSave.ThemeName = "dangeranimals"; SaveSystem.currentTheme = new DangerousCreaturesTheme(); TitleScreen.frm95.BackgroundImage = Properties.Resources.DCTheme_BG; TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.DCTheme_BG, TitleScreen.frm95.Width, TitleScreen.frm95.Height); break; case "Inside Your Computer": SaveSystem.CurrentSave.ThemeName = "insidepc"; SaveSystem.currentTheme = new InsideComputerTheme(); TitleScreen.frm95.BackgroundImage = Properties.Resources.ICTheme_BG; TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.ICTheme_BG, TitleScreen.frm95.Width, TitleScreen.frm95.Height); break; } foreach (Form f in Application.OpenForms) { if (f is WinClassic) { if (((WinClassic)f).isActive) { ((WinClassic)f).programtopbar.BackColor = SaveSystem.currentTheme.activeTitleBarColor; ((WinClassic)f).Title.ForeColor = SaveSystem.currentTheme.activeTitleTextColor; } else { ((WinClassic)f).programtopbar.BackColor = SaveSystem.currentTheme.inactiveTitleBarColor; ((WinClassic)f).Title.ForeColor = SaveSystem.currentTheme.inactiveTitleTextColor; } } } ParentForm.Close(); }
public void RefreshBus_RefreshObject(object sender, RefreshObjectEventArgs e) { bool shouldCloseInstead; _collection.RevertIfMatchedInCollectionObjects(e.Object, out shouldCloseInstead); if (shouldCloseInstead) { if (ParentForm != null) { ParentForm.Close(); } } else { //now reload the graph because the change was to a relevant object LoadGraphAsync(); } }