/// <summary> /// Ввод значения из модального диалога /// </summary> /// <param name="caption">заголовок окна диалога</param> /// <param name="label">надпись в окне слева от поля ввода</param> /// <param name="enableCancel">видимость кнопки "Отмена"</param> /// <param name="inputText">начальное значение</param> /// <param name="rst">DialogResult.OK - нажата кнопка "Принять", DialogResult.Cancel - нажата кнопка "Отмена"</param> /// <returns></returns> public static string ShowInputDialog(string caption, string label, bool enableCancel, string inputText, out DialogResult rst) { var dlg = new SimpleDialog(caption, label, enableCancel, inputText); rst = dlg.ShowDialog(); return(dlg.InputValue); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { var str = ""; if (value != null) { str = (string)value; } var form = new SimpleDialog(Localizer.GetString("TitleInput"), Localizer.GetString("MessageEnterText"), true, str) { InputRichText = true }; if (form.ShowDialog() == DialogResult.Cancel) { return(value); } return(form.InputValue); }
private void SaveButtonClick(object sender, EventArgs e) { var dialog = new SimpleDialog(Localizer.GetString("TitleExpressionCreation"), Localizer.GetString("MessageEnterFormulaComment"), true, SelectedFunction.Description); if (dialog.ShowDialog(this) == DialogResult.Cancel) { return; } var newF = new PerformerCriteriaFunction(SelectedFunction) { Description = dialog.InputValue }; PerformerCriteriaFunctionCollection.Instance.criterias.Add(newF); PerformerCriteriaFunctionCollection.Instance.SelectedFunction = newF; PerformerCriteriaFunctionCollection.Instance.WriteToFile(); if (PerformerCriteriaFunctionCollectionChanged != null) { PerformerCriteriaFunctionCollectionChanged(this, new EventArgs()); } }
private void SetupViews() { Messenger.Default.Register <string>(this, "OpenAboutView", (string s) => About.ShowDialog()); Messenger.Default.Register <string>(this, "CloseAboutView", (string s) => About.Close()); Messenger.Default.Register <string>(this, "OpenCreateWalletView", (string s) => CreateWallet.ShowDialog()); Messenger.Default.Register <string>(this, "CloseCreateWalletView", (string s) => CreateWallet.Close()); Messenger.Default.Register <string>(this, "OpenLicenseView", (string s) => License.ShowDialog()); Messenger.Default.Register <string>(this, "CloseLicenseView", (string s) => License.Close()); Messenger.Default.Register <string>(this, "OpenManageWalletView", (string s) => ManageWallet.ShowDialog()); Messenger.Default.Register <string>(this, "CloseManageWalletView", (string s) => ManageWallet.Close()); Messenger.Default.Register <string>(this, "OpenPromptPasswordView", (string s) => PromptPassword.ShowDialog()); Messenger.Default.Register <string>(this, "ClosePromptPasswordView", (string s) => PromptPassword.Close()); Messenger.Default.Register <string>(this, "OpenReceiveView", (string s) => Receive.ShowDialog()); Messenger.Default.Register <string>(this, "CloseReceiveView", (string s) => Receive.Close()); Messenger.Default.Register <string>(this, "OpenRecoverWalletView", (string s) => RecoverWallet.ShowDialog()); Messenger.Default.Register <string>(this, "CloseRecoverWalletView", (string s) => RecoverWallet.Close()); Messenger.Default.Register <string>(this, "OpenRecoveryPhraseView", (string s) => RecoveryPhrase.ShowDialog()); Messenger.Default.Register <string>(this, "CloseRecoveryPhraseView", (string s) => RecoveryPhrase.Close()); Messenger.Default.Register <string>(this, "OpenSendView", (string s) => Send.ShowDialog()); Messenger.Default.Register <string>(this, "CloseSendView", (string s) => Send.Close()); Messenger.Default.Register <string>(this, "OpenSetLanguageView", (string s) => SetLanguage.ShowDialog()); Messenger.Default.Register <string>(this, "CloseSetLanguageView", (string s) => SetLanguage.Close()); Messenger.Default.Register <string>(this, "OpenSetPasswordView", (string s) => SetPassword.ShowDialog()); Messenger.Default.Register <string>(this, "CloseSetPasswordView", (string s) => SetPassword.Close()); Messenger.Default.Register <string>(this, "OpenSimpleDialogView", (string s) => SimpleDialog.ShowDialog()); Messenger.Default.Register <string>(this, "CloseSimpleDialogView", (string s) => SimpleDialog.Close()); Messenger.Default.Register <string>(this, "OpenTxInfoView", (string s) => TxInfo.ShowDialog()); Messenger.Default.Register <string>(this, "CloseTxInfoView", (string s) => TxInfo.Close()); Messenger.Default.Register <string>(this, "OpenWalletInfoView", (string s) => WalletInfo.ShowDialog()); Messenger.Default.Register <string>(this, "CloseWalletInfoView", (string s) => WalletInfo.Close()); Messenger.Default.Register <string>(this, "OpenWelcomeView", (string s) => Welcome.ShowDialog()); Messenger.Default.Register <string>(this, "CloseWelcomeView", (string s) => Welcome.Close()); }