private void SellCurrentHouse(ConfirmWindow window, GameInfo gameInfo, IGameState waitState) { gameInfo.CurrentPlayer.Remove(gameInfo.CurrentPlayer.House); gameInfo.CreateMessage(String.Format("{0} just sold a house!", gameInfo.CurrentPlayer.Name)); window.Close(); OfferPlayerHouse(gameInfo, waitState); }
private void BTNPromote_Click(object sender, RoutedEventArgs e) { TBikeDAL MyDAL = new TBikeDAL(); DataTable ResultTable = MyDAL.SelectEmployeeByEmployeeID(LBEmployeeID.Text); Rank = Convert.ToInt32(ResultTable.Rows[0]["EmployeeRank"]); try { if (RankID > Rank) { ConfirmWindow com = new ConfirmWindow(ImageType.Question, "Confirm?", "Are you sure to Promote " + LBEmployeeName.Text + " ?", "Yes", "No"); com.ShowDialog(); if (com.Confirmed) { MyDAL.UpdateEmployeePromotion(LBEmployeeID.Text, Rank + 1, TLUsername.Text); ResultTable = MyDAL.SelectEmployeeByEmployeeID(LBEmployeeID.Text); LBEmployeeRankDesc.Text = Convert.ToString(ResultTable.Rows[0]["EmployeeRankDesc"]); } } else { ConfirmWindow com = new ConfirmWindow(ImageType.Error, "Error", "Cant Promote Rank Higher than self", "Ok", "Cancel"); com.ShowDialog(); } } catch (Exception ex) { PopWindow pop = new PopWindow(ImageType.Error, "Error", Convert.ToString(ex).Trim(), "OK"); pop.ShowDialog(); } }
private void BuyNewHouse(ConfirmWindow window, GameInfo gameInfo, IGameState waitState) { gameInfo.CurrentPlayer.Accept(House); CloseWindow(window, gameInfo, waitState); gameInfo.CreateMessage(String.Format("{0} just bought a house!", gameInfo.CurrentPlayer.Name)); }
private void Button_Click(object sender, RoutedEventArgs e) { try { if (LBStatus.Text == "Invalid") { //send to repair button string repairCondition = ("Servicing, Reason: " + TBCondition.Text); TBikeDAL MyDAL = new TBikeDAL(); ConfirmWindow confirm = new ConfirmWindow(ImageType.Question, "Confirmation", "Are you sure to send this to Service? ", "Yes", "No"); confirm.ShowDialog(); if (confirm.Confirmed) { MyDAL.UpdateBikeStatus(CBBicycle.SelectedValue.ToString().Trim(), "", "M", repairCondition.Trim(), PickStart.SelectedDate, PickEnd.SelectedDate, TLUsername.Text); PopWindow pop = new PopWindow(ImageType.Information, "Done", "Bicycle Send for Service", "OK"); pop.ShowDialog(); } BindComboBoxBicycle(CBBicycle); } } catch (Exception ex) { PopWindow pop = new PopWindow(ImageType.Error, "Error", ex.Message, "OK"); pop.ShowDialog(); } }
private void BTNUpdate_Click(object sender, RoutedEventArgs e) { try { TBikeDAL MyDAL = new TBikeDAL(); username = LBUsername.Text; ConfirmWindow com = new ConfirmWindow(ImageType.Error, "Update", "Are you sure to modify these changes?", "Yes", "No"); com.ShowDialog(); if (com.Confirmed) { MyDAL.UpdateEmployee(LBEmployeeID.Text, LBEmployeeName.Text, Convert.ToDateTime(LBDob.Text), LBUsername.Text, LBEmployeeRankDesc.Text, LBEmail.Text, LBPhoneNo.Text, LBCity.Text, TLUsername.Text); DataTable ResultTable = MyDAL.SelectEmployeeByEmployeeID(LBEmployeeID.Text); LBEmployeeName.Text = Convert.ToString(ResultTable.Rows[0]["EmployeeName"]).Trim(); LBEmployeeRankDesc.Text = Convert.ToString(ResultTable.Rows[0]["EmployeeRankDesc"]).Trim(); LBUsername.Text = Convert.ToString(ResultTable.Rows[0]["Username"]).Trim(); LBEmail.Text = Convert.ToString(ResultTable.Rows[0]["Email"]).Trim(); LBDob.Text = Convert.ToString(ResultTable.Rows[0]["DateOfBirth"]).Trim(); LBPhoneNo.Text = Convert.ToString(ResultTable.Rows[0]["PhoneNo"]).Trim(); LBCity.Text = Convert.ToString(ResultTable.Rows[0]["Address"]).Trim(); LBLastLogin.Text = Convert.ToString(ResultTable.Rows[0]["LastLoginTime"]).Trim(); PopulateDataFromLogin(username); } } catch (Exception ex) { PopWindow pop = new PopWindow(ImageType.Error, "Error", ex.Message, "OK"); pop.ShowDialog(); } }
private void onDeleteDocument() { ConfirmWindow lConfirmWindow = new ConfirmWindow("删除", "删除 " + SelectTaxPayerDocumentEntity.TaxPayerDocumentName); lConfirmWindow.Closed += lConfirmWindow_Closed; lConfirmWindow.Show(); }
/// <summary> /// 通用确认窗口 /// </summary> /// <param name="content">提示内容</param> /// <param name="title">标题</param> /// <param name="okBtnText">确定按钮文本</param> /// <param name="cancelBtnText">取消按钮文本</param> /// <param name="module">所属模块</param> /// <returns></returns> public static ConfirmWindow ShowConfirmWindow(string content, string title = null, string okBtnText = null, string cancelBtnText = null, IModule module = null) { if (title == null) { title = I18NManager.Get("Common_Hint"); } if (okBtnText == null) { okBtnText = I18NManager.Get("Common_OK2"); } if (cancelBtnText == null) { cancelBtnText = I18NManager.Get("Common_Cancel2"); } ConfirmWindow win = ShowWindow <ConfirmWindow>(Constants.ConfirmWindowPath); win.Content = content; win.Container = module; win.Title = title; win.OkText = okBtnText; win.CancelText = cancelBtnText; return(win); }
public static bool CheckPermission(OperationRequest request) { var checksum = request.GetCheckSum(); if (Properties.Settings.Default.AllowedScripts?.Contains(checksum) ?? false) { return(true); } return(Application.Current.Dispatcher.Invoke(() => { var window = new ConfirmWindow(); window.OperationName = request.OperationName; window.CompanyName = request.CompanyName; var dialogResult = window.ShowDialog(); if (dialogResult.HasValue && !dialogResult.Value) { return false; } if (window.AlwaysYes) { if (Properties.Settings.Default.AllowedScripts == null) { Properties.Settings.Default.AllowedScripts = new System.Collections.Specialized.StringCollection(); } Properties.Settings.Default.AllowedScripts.Add(checksum); Properties.Settings.Default.Save(); } return true; })); }
public void DestroyStructure(StructureData structure) { if (!structure) { return; } ConfirmWindow.StartConfirm(string.Format("确定拆毁{0}{1}吗?", structure.Name, (Vector2)transform.position), delegate { if (structure) { if (this.structures.TryGetValue(structure.Info.ID, out var structures)) { structures.Remove(structure); if (structures.Count < 1) { this.structures.Remove(structure.Info.ID); } } if (structure.entity && structure.entity.gameObject) { UpdateAStar(structure.entity); structure.entity.Destroy(); } else if (structure.preview && structure.preview.gameObject) { UpdateAStar(structure.preview); structure.preview.Destroy(); } NotifyCenter.PostNotify(StructureDestroy, structure, structures); } });
public void BackToMenu() { ConfirmWindow confirm = new ConfirmWindow(); confirm.NotifCancel += HandleCancel; confirm.NotifOk += HandleBack; }
public void AddConfirmWindow(ConfirmWindow confirmWindow) { if (!ConfirmWindows.Contains(confirmWindow)) { ConfirmWindows.Push(confirmWindow); } }
static void Create(Action action) { ConfirmWindow window = (ConfirmWindow)EditorWindow.GetWindow(typeof(ConfirmWindow)); window.action = action; window.Show(); }
public async Task <Unit> DeleteSelectedDevice() { using (var disposables = new CompositeDisposable()) { try { Logger.Debug($"User pressed 'Delete Selcted Device'"); var dialog = new ConfirmWindow(); var viewModel = viewModelFactory.CreateViewModel <ConfirmWindowViewModel>(); viewModel.AddDisposableTo(disposables); viewModel.Window = dialog; dialog.DataContext = viewModel; dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen; var finished = dialog.ShowDialog(); Logger.Debug($"Opend Dialog Window to Confirm if User want to delete the selected Device"); if (viewModel.DeleteDevice) { Logger.Debug($"User Confirm with 'Yes Delete'"); await azureService.DeleteSelectedDevice(hubName, selectedIoTDeviceInfo.DeviceId); Logger.Debug($"Selected Device was deleted"); await Reload(); } } catch (Exception e) { Logger.Error("Error in Reactive command", e); } return(Unit.Default); } }
private void ClearAll() { Boolean checkPayment = (Convert.ToDouble(label4.Text) >= Convert.ToDouble(label6.Text)); Boolean clearConfirm = false; if (checkPayment == true) { clearConfirm = true; } else { // Warning Window ConfirmWindow CW = new ConfirmWindow(); CW.ShowDialog(); if (CW.getResponse() == DialogResult.OK) { clearConfirm = true; } else { } } if (clearConfirm == true) { dataGridView1.Rows.Clear(); new MainDatabase().InteractDB_resetDiscStat(); label4.Text = "0.00"; label6.Text = "0.00"; label8.Text = "0.00"; } }
public void Confirm() { if (copySlots.Count < 1) { MessageManager.Instance.New("未选择任何物品"); return; } List <ItemWithAmount> items = new List <ItemWithAmount>(); foreach (var kvp in copySlots) { items.Add(new ItemWithAmount(kvp.Value.Item, kvp.Value.Data.amount)); } confirm = true; if (string.IsNullOrEmpty(dialog)) { onConfirm?.Invoke(items); Close(); } else { ConfirmWindow.StartConfirm(dialog, delegate { onConfirm?.Invoke(items); Close(); }); } }
#pragma warning restore IDE0051 private void OnOptionClickHandler(object sender, RoutedEventArgs e) { var menuItem = sender as MenuItem; string itemTag = Convert.ToString(menuItem.Tag); if (itemTag == "edit") { CalendarDayControl.CalendarPage.MainWindow.ShowTaskgroup(taskgroup); } if (itemTag == "move") { DatepickerWindow datepicker = new DatepickerWindow( "Deadline verschieben", "Neue Deadline:", RescheduleDeadline); datepicker.DateTimePicker.SelectedDate = Taskgroup.Deadline; datepicker.ShowDialog(); } if (itemTag == "delete") { ConfirmWindow confirmDeleteWindow = new ConfirmWindow( "Aufgabengruppe löschen", "Sind Sie sicher, dass Sie die Aufgabengruppe \"" + taskgroup.Title + "\" inkl. aller Aufgaben löschen möchten?", ConfirmDeleteHandler); confirmDeleteWindow.ShowDialog(); } }
public void DestroyCrop() { ConfirmWindow.StartConfirm("销毁作物不会有任何产物,确定销毁吗?", delegate { window.Remove(Data); }); }
private void BtnDelete_Click(object sender, RoutedEventArgs e) { if (LBTitle.Text == "Bicycle") { TBikeDAL MyDAL = new TBikeDAL(); ConfirmWindow confirm = new ConfirmWindow(ImageType.Question, "Delete?", "Are you sure to delete this bicycle?", "Yes", "No! Turn Back!"); if (confirm.Confirmed) { MyDAL.DeleteBicycleByID(LBID.Text); PopulateBikeDataTable(); PopWindow pop = new PopWindow(ImageType.Information, "Bicycle Deleted", "Bicycle: " + LBName.Text + " Has been Deleted By " + TLUsername.Text, "Okay"); pop.ShowDialog(); } } else if (LBTitle.Text == "Snacks") { TBikeDAL MyDAL = new TBikeDAL(); ConfirmWindow confirm = new ConfirmWindow(ImageType.Question, "Delete?", "Are you sure to delete this Snack?", "Yes", "No! Turn Back!"); if (confirm.Confirmed) { MyDAL.DeleteSnackByID(LBID.Text); PopulateBikeDataTable(); PopWindow pop = new PopWindow(ImageType.Information, "Snack Deleted", "Snack: " + LBName.Text + " Has been Deleted By " + TLUsername.Text, "Okay"); pop.ShowDialog(); } } }
private void ask(QuestionMessage obj) { ConfirmWindow wnd = new ConfirmWindow(); wnd.Title = obj.Message; bool result = wnd.ShowDialog().GetValueOrDefault(); obj.Parameter = wnd.sldValue.Value; if (result) { obj.Yes?.Invoke(); } else { obj.No?.Invoke(); } //MessageBoxResult result = MessageBox.Show(obj.Message, obj.Title, // MessageBoxButton.YesNo, MessageBoxImage.Question); //if (result == MessageBoxResult.Yes) //{ // obj.Yes?.Invoke(); //} //else //{ // obj.No?.Invoke(); //} }
private void onDeleteTaxPayer() { ConfirmWindow lConfirmWindow = new ConfirmWindow("删除纳税人", "是否确认删除纳税人: " + SelectTaxPayerEntity.TaxPayerName + "? 与之关联的台账和档案将丢失!"); lConfirmWindow.Closed += new EventHandler(DeleteTaxPayerConfirm_Closed); lConfirmWindow.Show(); }
void on_button_delete_type_clicked(object o, EventArgs args) { string [] tests = findTestTypesInSessions(); //this will be much better doing a select distinct(session) instead of using SelectJumps or Runs ArrayList sessionValues = new ArrayList(); foreach (string t in tests) { string [] tFull = t.Split(new char[] { ':' }); Util.AddToArrayListIfNotExist(sessionValues, tFull[3]); } //if exist tell user to edit or delete them if (tests.Length > 0) { new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("There are tests of that type on database on sessions:") + "\n" + Util.ArrayListToSingleString(sessionValues, ", ") + "\n\n" + Catalog.GetString("please first edit or delete them.")); } else { ConfirmWindow confirmWin = ConfirmWindow.Show(Catalog.GetString("Are you sure you want to delete this test type?"), "", selectedEventName); confirmWin.Button_accept.Clicked += new EventHandler(on_button_delete_type_accepted); } }
void on_button_export_clicked(object o, EventArgs args) { Gtk.FileChooserDialog fc = new Gtk.FileChooserDialog(Catalog.GetString("Export to file"), encoder_configuration, FileChooserAction.Save, Catalog.GetString("Cancel"), ResponseType.Cancel, Catalog.GetString("Accept"), ResponseType.Accept ); if (fc.Run() == (int)ResponseType.Accept) { exportFileName = fc.Filename; exportFileName = Util.AddTxtIfNeeded(exportFileName); try { if (File.Exists(exportFileName)) { LogB.Information(string.Format( "File {0} exists with attributes {1}, created at {2}", exportFileName, File.GetAttributes(exportFileName), File.GetCreationTime(exportFileName))); LogB.Information("Overwrite..."); ConfirmWindow confirmWin = ConfirmWindow.Show(Catalog.GetString( "Are you sure you want to overwrite file: "), "", exportFileName); confirmWin.Button_accept.Clicked += new EventHandler(on_overwrite_file_export_accepted); } else { on_file_export_accepted(); string myString = string.Format(Catalog.GetString("Saved to {0}"), exportFileName); new DialogMessage(Constants.MessageTypes.INFO, myString); } } catch { string myString = string.Format( Catalog.GetString("Cannot save file {0} "), exportFileName); new DialogMessage(Constants.MessageTypes.WARNING, myString); } } else { LogB.Information("cancelled"); new DialogMessage(Constants.MessageTypes.INFO, Catalog.GetString("Cancelled.")); fc.Hide(); return; } //Don't forget to call Destroy() or the FileChooserDialog window won't get closed. fc.Destroy(); return; }
public void SetConfirmWindow(string info, UnityAction confirmAction) { ConfirmWindow script = confirmWindow.GetComponent <ConfirmWindow>(); script.ChangeConfirmFunction(confirmAction); script.SetMessage(info); confirmWindow.SetActive(true); }
public void Restart() { ConfirmWindow confirm = new ConfirmWindow(); confirm.NotifOk += HandleRestart; confirm.NotifCancel += HandleCancel; confirm.ShowDialog(); }
static void Create(string tipText, Action action) { ConfirmWindow window = (ConfirmWindow)EditorWindow.GetWindow(typeof(ConfirmWindow)); window.tipText = tipText; window.action = action; window.Show(); }
void onDeleteStandBook() { ConfirmWindow lConfirmWindow = new ConfirmWindow("是否删除台账" , "是否删除台账, 项目:" + SelectStandBookEntity.ProjectName + ", 本次拨款金额:" + SelectStandBookEntity.ThisPartMoney.GetValueOrDefault(0).ToString("#0,##0.0") + ",申报日期:" + SelectStandBookEntity.PayTime.GetValueOrDefault().ToString("yyyy年MM月dd日")); lConfirmWindow.Closed += new EventHandler(DeleteStandBookConfirmWindow_Closed); lConfirmWindow.Show(); }
public void ConfirmLeave() { if (systemManageDomainContext.HasChanges) { ConfirmWindow confirmWindow = new ConfirmWindow("保存", "有改变,是否保存?"); confirmWindow.Closed += new EventHandler(Confirm_Closed); confirmWindow.Show(); } }
#pragma warning restore IDE0051 private void OnDeleteClicked(object sender, RoutedEventArgs e) { ConfirmWindow confirmWindow = new ConfirmWindow( "Ziel löschen", "Sind Sie sicher, dass Sie das Ziel \"" + goal.Title + "\" inkl. aller Projekte löschen möchten?", ConfirmDeleteCallback ); confirmWindow.ShowDialog(); }
static public ConfirmWindow Show(string text1, string link, string question) { if (ConfirmWindowBox == null) { ConfirmWindowBox = new ConfirmWindow(text1, link, question); } ConfirmWindowBox.confirm_window.Show(); return(ConfirmWindowBox); }
private void OnDeleteClicked(object sender, RoutedEventArgs e) { ConfirmWindow confirmWindow = new ConfirmWindow( "Projekt löschen", "Sind sie sicher, dass sie das Projekt \"" + project.Name + "\" inkl. aller Aufgaben löschen möchten?", ConfirmDeleteCallback ); confirmWindow.ShowDialog(); }
protected void on_show_repetitions_row_delete_pre(object o, EventArgs args) { if(askDeletion) { confirmWin = ConfirmWindow.Show(Catalog.GetString( "Are you sure you want to delete this repetition?"), "", ""); confirmWin.Button_accept.Clicked -= new EventHandler(on_show_repetitions_row_delete); confirmWin.Button_accept.Clicked += new EventHandler(on_show_repetitions_row_delete); } else on_show_repetitions_row_delete (o, args); }
protected void on_button_cancel_clicked(object o, EventArgs args) { ConfirmWindowBox.confirm_window.Hide(); ConfirmWindowBox = null; }
public static ConfirmWindow Show(string text1, string link, string question) { if (ConfirmWindowBox == null) { ConfirmWindowBox = new ConfirmWindow(text1, link, question); } ConfirmWindowBox.confirm_window.Show (); return ConfirmWindowBox; }