void OnGUI() { if (confirmDialog.IsConfirming()) { string message = "\"" + saveName + "\" already exists. Do you widh to continue?"; confirmDialog.Show(message, mySkin); } else if (confirmDialog.MadeChoice()) { if (confirmDialog.ClickedYes()) { SaveGame(); } confirmDialog.EndConfirmation(); } else { if (SelectionList.MouseDoubleClick()) { PlayClick(); saveName = SelectionList.GetCurrentEntry(); StartSave(); } GUI.skin = mySkin; DrawMenu(); // Handle enter being hit when typing in the text field if (Event.current.keyCode == KeyCode.Return) { StartSave(); } // If typing and cancel is hit, nothing happens.. // doesn't appear to be a quick fix either.. } }
void OnGUI() { if (confirmDialog.IsConfirming()) { string message = "\"" + saveName + "\" already exists. Do you wish to continue?"; confirmDialog.Show(message, mySkin); } else if (confirmDialog.MadeChoice()) { if (confirmDialog.ClickedYes()) { SaveGame(); } confirmDialog.EndConfirmation(); } else { if (SelectionList.MouseDoubleClick()) { PlayClick(); saveName = SelectionList.GetCurrentEntry(); StartSave(); } } GUI.skin = mySkin; DrawMenu(); if (Event.current.keyCode == KeyCode.Return) { StartSave(); } }
private IEnumerator RemoveRoutine() { ConfirmDialog dialog = FindObjectOfType <ConfirmDialog>(); dialog.ApplyColours(); dialog.Show(); dialog.SetInfoMessage("Remove '<b>" + nameText.text + "</b>'?"); dialog.SetNone(); while (dialog.IsNone()) { yield return(null); } if (dialog.IsNo() || dialog.IsCancel()) { dialog.Hide(); yield break; } if (dialog.IsYes()) { dialog.Hide(); string url = string.Format("{0}/{1}/close", Endpoints.instance.TODOIST_TASKS(), taskId); UnityWebRequest request = Postman.CreatePostRequest(url, new JSONObject()); request.SetRequestHeader("Authorization", "Bearer " + apiKey); yield return(request.SendWebRequest()); Destroy(this.gameObject); } }
private void OnCloseBtnClicked(object sender, EventArgs a) { if (changes) { ResponseType res = ConfirmDialog.Show(symbolLabelDialog, "¿Quieres guardar los cambios?"); if (res == ResponseType.Yes) { List <SymbolLabelInfo> symbols = new List <SymbolLabelInfo>(); foreach (object[] row in symbolLabelsModel) { SymbolLabelInfo info = new SymbolLabelInfo(); info.Symbol = (string)(row[0]); info.Label = (string)(row[1]); symbols.Add(info); } LibraryConfig.Instance.Symbols = symbols; LibraryConfig.Instance.Save(); } } }
/// <summary> /// Displays a popup dialog box for users to delete a rule /// </summary> /// <param name="rule"></param> /// <param name="partition"></param> public void OnDeleteRule(ServerRule rule, ServerPartition partition) { ConfirmDialog.Message = string.Format(SR.AdminServerRules_DeleteDialog_AreYouSure, rule.RuleName, partition.AeTitle); ConfirmDialog.MessageType = MessageBox.MessageTypeEnum.YESNO; ConfirmDialog.Data = rule.GetKey(); ConfirmDialog.Show(); }
private void OnBlackboardClearItemActivate(object sender, EventArgs args) { ResponseType res = ConfirmDialog.Show(this.MainRecognizerWindow.Window, "Se borrará toda la imagen, ¿quieres continuar?"); if (res == ResponseType.Yes) { handwritingArea.Clear(); } }
/// <summary> /// Maneja el uso del boton encargado de guardar la seleccion actual de /// procesados como seleccion por defecto. /// </summary> /// <param name="e"> /// A <see cref="System.Object"/> /// </param> /// <param name="args"> /// A <see cref="EventArgs"/> /// </param> private void OnMakeDefaultBtnClicked(object e, EventArgs args) { ResponseType res = ConfirmDialog.Show(this.Assistant.Window, "Se va a cambiar la configuración por defecto, ¿desea continuar?"); if (res == ResponseType.Yes) { // Guardamos la seleccion actual como la por defecto. LearnerConfig.Instance.DefaultProcesses = this.Processes; LearnerConfig.Instance.Save(); } }
/// <summary> /// Launches the save as dialog. /// </summary> /// <returns> /// The path the file was saved into, if any. /// </returns> private string SaveDatabaseAs() { string file; if (DatabaseSaveDialog.Show(mainWindow, out file) == ResponseType.Ok) { string ext = Path.GetExtension(file); if (!(ext == ".xml" || ext == ".XML" || ext == ".jilfml" || ext == ".JILFML")) { file += ".jilfml"; } bool save = true; if (File.Exists(file) && ConfirmDialog.Show( mainWindow, "El archivo «{0}» ya existe. ¿Deseas sobreescibirlo?", Path.GetFileName(file)) == ResponseType.No) { // No queremos sobreescribir un archivo existente. save = false; } if (save) { database.Save(file); OkDialog.Show( mainWindow, MessageType.Info, "Base de datos guardada correctamente en «{0}»", Path.GetFileName(file)); LogLine( "¡Base de datos guardada con éxito en «{0}»!", Path.GetFileName(file)); return(file); } } return(""); }
public void SignOut() { // Chưa chạy chuẩn ConfirmDialog confirmDialog = new ConfirmDialog("SIGN OUT", "Are you really want to sign out?", () => { SignInPage signInPage = new SignInPage(); signInPage.Show(); CloseWindowManager.CloseMainWindow(); }); confirmDialog.Show(); }
/// <summary> /// Removes the widget from its container. /// </summary> protected void Remove() { ResponseType res = ConfirmDialog.Show(this.container.Window, "¿Realmente quieres eliminar este elemento?"); if (res == ResponseType.No) { return; } container.RemoveItem(this); }
private void OnBackBtnClick() { AudioManager.instance.PlayAudio(AudioType.Button); GameManager.instance.LineActive(false); dialog.BindEnter(() => { SceneManager.LoadScene("Start"); }); dialog.BindCancel(() => { AudioManager.instance.PlayAudio(AudioType.Button); GameManager.instance.LineActive(true); }); dialog.SetText("Are you sure you want to quit?"); dialog.Show(); }
private IEnumerator AddToShoppingListRoutine() { ConfirmDialog dialog = FindObjectOfType <ConfirmDialog>(); dialog.ApplyColours(); dialog.Show(); dialog.SetNone(); dialog.SetInfoMessage("Add all ingredients from each recipe to the shopping list?"); while (dialog.IsNone()) { yield return(null); } if (dialog.IsNo()) { dialog.Hide(); dialog.SetNone(); yield break; } if (dialog.IsYes()) { TMP_Text addButtonText = addButton.GetComponentInChildren <TMP_Text>(); addButtonText.text = "Please wait..."; addButton.interactable = false; dialog.Hide(); OnlineList shoppingList = FindObjectsOfType <OnlineList>().Where(x => x.GetListType().Equals(TodoistList.shoppingList)).First(); UnityWebRequest request = Postman.CreateGetRequest(Endpoints.instance.SHOPPING_LIST()); yield return(request.SendWebRequest()); JSONArray json = JSON.Parse(request.downloadHandler.text).AsArray; foreach (KeyValuePair <string, JSONNode> obj in json) { string item = obj.Value.Value; yield return(StartCoroutine(shoppingList.AddItemRoutine(item))); } shoppingList.Refresh(); dialog.SetNone(); addButton.interactable = true; addButtonText.text = "Add To Shopping List"; yield break; } }
/// <summary> /// Maneja el evento de uso del boton de eliminar un icono de la vista /// de iconos. /// </summary> private void OnRemoveButtonClicked(object o, EventArgs a) { TreeIter iter; fileStore.GetIter(out iter, filesIconView.SelectedItems[0]); // Primero pedimos confirmación if (ConfirmDialog.Show( this.Assistant.Window, "¿Desea eliminar la imagen «{0}» de la lista?", fileStore.GetValue(iter, 1)) == ResponseType.Yes) { fileStore.Remove(ref iter); } }
private void OnOcrBackBtnClicked(object sender, EventArgs args) { if (recognizementFinished) { // The parsing finished and was successful ResponseType res = ConfirmDialog.Show(MainRecognizerWindow.Window, "Si vuelves al paso anterior se perderá el segmentado realizado, ¿quieres continuar?"); if (res == ResponseType.No) { return; } } PreviousStage(); }
/// <summary> /// Ask the user for his permissions to perform a new lexical /// analysis on the selected sequence. /// </summary> /// <param name="sender"> /// A <see cref="System.Object"/> /// </param> /// <param name="arg"> /// A <see cref="EventArgs"/> /// </param> private void OnForceTokenizingItemActivate(object sender, EventArgs arg) { if (selectedNode.FoundToken != null || selectedNode.ChildCount > 0) { // We need that the user confirm the operation as, it is desctructive. ResponseType res = ConfirmDialog.Show(this.MainRecognizerWindow.Window, "Se van a perder los items identificados en la secuencia seleccionada (o sus hijos), ¿deseas continuar?"); if (res == ResponseType.No) { return; } } selectedNode.RemoveSequenceChildren(); selectedNode.FoundToken = null; List <LexicalRule> rules = Config.RecognizerConfig.Instance.LexicalRules; controller.SetLexicalRules(rules); ListStore store = new ListStore(typeof(string), typeof(string)); foreach (LexicalRule rule in rules) { store.AppendValues(rule.Name, String.Join(" | ", rule.LexicalExpressions.ToArray())); } this.tokenizingRulesTV.Model = store; // We set again the rules, because the user _should_ have modified them. controller.SetLexicalRules(Config.RecognizerConfig.Instance.LexicalRules); controller.SetSequenceForTokenizing(selectedNode); tokenizingButtonsNB.Page = 1; tokenizingNextButtonsAlign.Sensitive = true; // We lauch the tokenizer again. NextStep(ControllerStepMode.StepByStep); }
private void OnParsingBackBtnClicked(object sender, EventArgs args) { if (parsingShowOutputBtn.Sensitive) { // The parsing finished and was successful ResponseType res = ConfirmDialog.Show(MainRecognizerWindow.Window, "Si vuelves al paso anterior se perderá el análisis realizado, ¿quieres continuar?"); if (res == ResponseType.No) { return; } } controller.DeregisterEvents(); PreviousStage(); }
private void OnTokenizingBackBtnClicked(object sender, EventArgs args) { if (processFinished) { // The parsing finished and was successful ResponseType res = ConfirmDialog.Show(MainRecognizerWindow.Window, "Si regresas al paso anterior se perderá el análisis realizado, ¿quieres continuar?"); if (res == ResponseType.No) { return; } } PreviousStage(); }
/// <summary> /// Handles the clicking on the load image button. /// </summary> private void OnLoadImageClicked(object sender, EventArgs arg) { ResponseType res = ResponseType.Yes; if (recognizementFinished) { res = ConfirmDialog.Show(mainWindow, "Si cargas una nueva imágen perderás el reconocimiento realizado.\n" + "¿Deseas continuar?"); } if (res == ResponseType.Yes) { (recognizingStepsNB.Children[1] as RecognizingStageWidget).SetInitialData(); } }
/// <summary> /// Removes the widget from the list. /// </summary> private void OnRemoveBtnClicked(object sender, EventArgs args) { ResponseType res = ResponseType.Yes; // If the widget isn't empty, we have to ask. if (!String.IsNullOrEmpty(this.Expression.Trim())) { res = ConfirmDialog.Show(parentWindow, "¿Quieres eliminar la expresión?"); } if (res == ResponseType.Yes) { this.Destroy(); } }
/// <summary> /// Removes the expression from the rule. /// </summary> /// <param name="sender"> /// A <see cref="System.Object"/> /// </param> /// <param name="args"> /// A <see cref="EventArgs"/> /// </param> private void OnExpRemoveBtnClicked(object sender, EventArgs args) { ResponseType res = ResponseType.Yes; if (expItemsBox.Children.Length > 0 || !String.IsNullOrEmpty(expFormatEntry.Text)) { res = ConfirmDialog.Show(dialog.Window, "¿Realmente quieres eliminar la expresión?"); } if (res == ResponseType.No) { return; } dialog.RemoveExpression(this); }
public override void Invoke() { if (EditorContext.Dirty) { confirmDialog.Show( "Unsaved changes to the track will be discarded. Continue?", "discard", "cancel", () => { ForceTransition(); }); } else { ForceTransition(); } }
/// <summary> /// Handles the event lauched when the "edit label" option is clicked /// in the formula node's contextual menu. /// </summary> /// <param name="sender"> /// A <see cref="System.Object"/> /// </param> /// <param name="a"> /// A <see cref="EventArgs"/> /// </param> private void OnEditLabeItemActivate(object sender, EventArgs a) { Dialogs.SymbolLabelEditorDialog dialog = new Dialogs.SymbolLabelEditorDialog(MainRecognizerWindow.Window, selectedNode); if (dialog.Show() == ResponseType.Ok) { bool changeLabel = true; if (selectedNode.ChildCount > 0) { ResponseType res = ConfirmDialog.Show(MainRecognizerWindow.Window, "Este nodo tiene hijos, y se estableces " + "una etiqueta se eliminarán, ¿quieres" + " continuar?"); if (res == ResponseType.Yes) { // We remove the nodes. while (selectedNode.ChildCount > 0) { selectedNode.RemoveChild((TreeNode)(selectedNode[0])); } } else { changeLabel = false; } } if (changeLabel) { // We remove all the symbols, then add the new one. selectedNode.Symbols.Clear(); selectedNode.Symbols.Add(new MathSymbol(dialog.Label)); selectedNode.SetLabels(); } } dialog.Destroy(); }
/// <summary> /// Removes the selected rule from the rule-list, if the user /// gives its confirmation. /// </summary> /// <param name="sender"> /// A <see cref="System.Object"/> /// </param> /// <param name="args"> /// A <see cref="EventArgs"/> /// </param> private void OnRemoveBtnClicked(object sender, EventArgs args) { TreeIter selected; rulesTV.Selection.GetSelected(out selected); // We retrieve the selected row's rule name. string ruleName = (string)(rulesStore.GetValue(selected, 0)); ResponseType res; res = ConfirmDialog.Show(lexicalRulesManagerDialog, "¿Realmente quieres eliminar la regla «{0}»?", ruleName); if (res == ResponseType.Yes) { rulesStore.Remove(ref selected); } }
/// <summary> /// Asks the user for confirmation and then saves a modified database. /// </summary> private void SaveDatabase() { if (databaseModified) { ResponseType res = ConfirmDialog.Show(mainWindow, "¿Quieres guardar " + "los cambios de la base de datos?"); if (res == ResponseType.Yes) { if (!String.IsNullOrEmpty(databasePath)) { // We save the database in the same path as it was loaded. database.Save(databasePath); SetModified(false); OkDialog.Show( mainWindow, MessageType.Info, "Base de datos guardada correctamente en «{0}»", Path.GetFileName(databasePath)); LogLine( "¡Base de datos guardada con éxito en «{0}»!", Path.GetFileName(databasePath)); } else { // If it is a new database, we make use the save as method. string path = SaveDatabaseAs(); if (!String.IsNullOrEmpty(path)) { SetTitle(path); SetModified(false); } } } } }
private void OnDeleteClick(object sender, EventArgs e) { ConfirmDialog.Show(this, "Do you want to delete service?", new List <string> { "Yes", "No" }, index => { if (index == 0) { var serviceId = ((Button)sender).GetValue(UIUtils.TagProperty).ToString(); var spinner = UIUtils.ShowSpinner(this); DataGate.ServiceDelete(serviceId, data => { UIUtils.HideSpinner(this, spinner); Device.BeginInvokeOnMainThread(() => { RefreshList(); }); }); } }); }
/// <summary> /// Handles the selection of the "force segmenting" context menu item. /// </summary> /// <param name="sender"> /// A <see cref="System.Object"/> /// </param> /// <param name="args"> /// A <see cref="EventArgs"/> /// </param> private void OnForceSegmentItemClicked(object sender, EventArgs args) { ResponseType res = ConfirmDialog.Show(this.MainRecognizerWindow.Window, "Si fuerza el segmentado perderás el " + "reconocimiento realizado, ¿quieres continuar?"); if (res == ResponseType.Yes) { // We reload the databases because the new segmentation may be // due a database change. controller.Databases = Config.RecognizerConfig.Instance.Databases; controller.StartNode = selectedNode; controller.SearchDatabase = false; buttonsNB.Page = 1; alignNextButtons.Sensitive = true; controller.Next(ControllerStepMode.NodeByNode); } }
public void Delete(object sender, RoutedEventArgs e) { if (ConfirmDialog.Show("Você tem certeza que quer deletar " + _produtoAtual.NomeLivro)) { using var db = new TCCFEntities(); var prodToDelete = db.tblProduto.First(p => p.IDProduto == _produtoAtual.IDProduto); db.tblFavoritos.RemoveRange(prodToDelete.tblFavoritos); db.tblReserva.RemoveRange(prodToDelete.tblReserva); db.tblGeneroProduto.RemoveRange(prodToDelete.tblGeneroProduto); db.tblEmprestimo.RemoveRange(prodToDelete.tblEmprestimo); db.tblProduto.Remove(prodToDelete); db.SaveChanges(); StateRepository.currentView.Set(new AcervoView()); } }
/// <summary> /// Handles the click on the "learn image" treeview's context menu item. /// </summary> /// <param name="sender"> /// A <see cref="System.Object"/> /// </param> /// <param name="args"> /// A <see cref="EventArgs"/> /// </param> private void OnLearnImageItemActivate(object sender, EventArgs args) { // We ask for confirmation ResponseType res = ConfirmDialog.Show(MainRecognizerWindow.Window, "¿Realmente quieres añadir el símbolo «{0}» a una base de datos?", selectedNode.Name); if (res == ResponseType.Yes) { // We let the user select the database to be modified. LearnSymbolDatabaseChooserDialog databaseDialog = new LearnSymbolDatabaseChooserDialog(MainRecognizerWindow.Window, Config.RecognizerConfig.Instance.DatabaseFilesInfo); res = databaseDialog.Show(); databaseDialog.Destroy(); if (res == ResponseType.Ok) { DatabaseFileInfo selectedDatabase = databaseDialog.ChoosenDatabase; MathTextDatabase database = null; string databasePath = ""; if (selectedDatabase != null) { database = selectedDatabase.Database; databasePath = selectedDatabase.Path; } new MainLearnerWindow(this.MainRecognizerWindow.Window, database, databasePath, selectedNode.MathTextBitmap.Pixbuf, selectedNode.Name); } } }
/// <summary> /// Handles the click on the "Save image" formula node context menu item. /// </summary> /// <param name="sender"> /// A <see cref="System.Object"/> /// </param> /// <param name="args"> /// A <see cref="EventArgs"/> /// </param> private void OnSaveImageItemActivate(object sender, EventArgs args) { ResponseType res = ConfirmDialog.Show(MainRecognizerWindow.Window, "¿Deseas guardar la imagen del nodo «{0}»?", selectedNode.Name); if (res == ResponseType.Yes) { string filename = ""; res = ImageSaveDialog.Show(MainRecognizerWindow.Window, out filename); if (res == ResponseType.Ok) { string extension = System.IO.Path.GetExtension(filename).ToLower().Trim('.'); if (String.IsNullOrEmpty(extension)) { extension = "png"; } selectedNode.MathTextBitmap.Pixbuf.Save(filename, extension); } } }
/// <summary> /// Removes the selected rule from the list. /// </summary> /// <param name="sender"> /// A <see cref="System.Object"/> /// </param> /// <param name="args"> /// A <see cref="EventArgs"/> /// </param> private void OnRmSynRuleBtnClicked(object sender, EventArgs args) { TreeIter selected; synRulesTree.Selection.GetSelected(out selected); // We retrieve the selected rule. SyntacticalRule rule = synRulesModel.GetValue(selected, 2) as SyntacticalRule; ResponseType res = ConfirmDialog.Show(syntacticalRulesManagerDialog, "¿Realemente quieres eliminar la regla «{0}»?", rule.Name); if (res == ResponseType.No) { // The user doesn't want the removal of the rule, so we abort. return; } // The user accepted, so there we go! synRulesModel.Remove(ref selected); }
private void FindByPassport_Completed(object sender, EventArgs e) { if (context.Donors.Count != 0) { // Нашли донора. donor = context.Donors.ElementAt(0); gridDonor.DataContext = donor; SetTransplantantList(); } else { // Не нашли донора - спрашиваем о добавлении. ConfirmDialog addDonorDialog = new ConfirmDialog("Нет записи с такими данными. Добавить нового донора?", donor); addDonorDialog.Title = "Не найдено"; addDonorDialog.Show(); addDonorDialog.Closed += (s, e1) => { if ((s as ChildWindow).DialogResult == true) { // Добавить нового донора. DonorForm form = new DonorForm(donor); form.Show(); form.Closed += form_Closed; } }; }; }