Beispiel #1
0
        public static CommandResult OpenOptionDialog(ICommandTarget target)
        {
            IPoderosaMainWindow window = CommandTargetUtil.AsWindow(target);
            OptionDialog        dlg    = new OptionDialog();

            if (dlg.ShowDialog(window.AsForm()) == DialogResult.OK)
            {
                return(CommandResult.Succeeded);
            }
            else
            {
                return(CommandResult.Cancelled);
            }
        }
        private void OpenOptionDialog()
        {
            OptionDialog dialog = new OptionDialog
            {
                Owner       = Application.Current.MainWindow,
                DataContext = OptionsViewModel
            };
            bool?dialogResult = dialog.ShowDialog();

            if (dialogResult.HasValue && dialogResult.Value)
            {
                OptionsViewModel.Save(CurrentProfile.Header);
            }
            else
            {
                OptionsViewModel.CancelDialog(CurrentProfile.Header);
            }
        }
Beispiel #3
0
 private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     OptionDialog options = new OptionDialog();
     options.ShowDialog();
 }