Exemplo n.º 1
0
    }// END MainForm_Resize

    private void OptionsMenuItem_Click(object sender, EventArgs e)
    {
        lock (mThreadLock)
        {
            // show the modal dialog until the OK Cancel is	pressed
            OptionsDialog optionsDialog = new OptionsDialog();
            if (optionsDialog.ShowDialog() == DialogResult.OK)
            {
                DllInterface.SetTorrentClientOptions(optionsDialog.mOptions);
            }
        }
    }    // END OptionsMenuItem_Click
Exemplo n.º 2
0
        private void OptionsClick(object sender, RoutedEventArgs e)
        {
            var optionsDialog = new OptionsDialog();

            optionsDialog.SetTags(_projectCollection.Tags);
            if (optionsDialog.ShowDialog() != true)
            {
                return;
            }
            ShowTags();
            UpdateTagsOnAllItems();
            SaveCollection();
        }
Exemplo n.º 3
0
        private void DoOptions(object sender, EventArgs e)
        {
            var dialog = new OptionsDialog();

            dialog.ActiveSheet = "/OrqaOptions/general";

            DialogResult result = dialog.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                SetOptions();
            }
        }
Exemplo n.º 4
0
 private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (optionsDialog.ShowDialog() == DialogResult.OK)
     {
         foreach (TabPage tb in tabControl1.TabPages)
         {
             if (tb is EditorTabPage)
             {
                 EditorTabPage etb = tb as EditorTabPage;
                 etb.ReloadSettings();
             }
         }
     }
 }
Exemplo n.º 5
0
    public static void ShowOptions(object options, Form parentform)
    {
        var form = new OptionsDialog();

        form.propertyGrid.SelectedObject = options;
        if (parentform == null)
        {
            form.Show();
        }
        else
        {
            form.ShowDialog(parentform);
        }
    }
Exemplo n.º 6
0
        public override void Run()
        {
            var wb = Workbench.Instance;

            using (var dlg = new OptionsDialog())
            {
                if (dlg.ShowDialog(wb) == System.Windows.Forms.DialogResult.OK)
                {
                    if (dlg.RestartRequired && MessageService.AskQuestion(Strings.PrefsRestartRequired))
                    {
                        Application.Restart();
                    }
                }
            }
        }
        public override void Execute(object sender, HandledEventArgs e)
        {
            OptionsDialog options = new OptionsDialog();

            options.ShowDialog();
            if (options.DialogResult == DialogResult.OK)
            {
                UserSettings settings = UserSettings.Instance;
                if (settings.UILanguageCode != Thread.CurrentThread.CurrentUICulture.LCID)
                {
                    Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(settings.UILanguageCode);
                }
                if (options.KeyboardSettingsChanged)
                {
                    bufferHolder.ReRegisterHotkeys();
                }
            }
        }
Exemplo n.º 8
0
        private void tsbOptions_Click(object sender, EventArgs e)
        {
            using (var dlg = new OptionsDialog())
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    //var curDisplayCfg = AppConfig.Current.DisplayConfig;
                    //foreach(var layoutPanel in OpenDocumentPanels)
                    //	layoutPanel.Viewer.SetDisplayColors(curDisplayCfg);
                }

                var curDisplayCfg = AppConfig.Current.DisplayConfig;
                foreach (var layoutPanel in OpenDocumentPanels)
                {
                    layoutPanel.Viewer.SetDisplayColors(curDisplayCfg);
                }
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Handles the Click event of the Options menu item
        /// </summary>
        /// <param name="tabIndex">The index of the options dialog tab </param>
        protected void OnOptionsClicked(OptionsDialog.OptionsTabIndex tabIndex)
        {
            OptionsDialog dlg = new OptionsDialog(this, tabIndex);

            try
            {
                dlg.ApplyChanges += new OptionsDialog.ApplyChangesHandler(OnApplyChanges);
                DialogResult result = dlg.ShowDialog();
                if (result == DialogResult.OK)
                {
                    OnOptionsChanged();
                }
            }
            finally
            {
                dlg.Close();
                dlg.Dispose();
            }
        }
Exemplo n.º 10
0
        private void ToolsOptionsExecuted(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
        {
            OptionsDialog dlg = new OptionsDialog();

            dlg.Owner = MainWindow.Window;
            dlg.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            dlg.VerticalAlignment   = System.Windows.VerticalAlignment.Center;

            dlg.Culture = ViewModel.Culture;
            dlg.ShowWelcomeOnStartup   = ViewModel.ShowWelcomeOnStartup;
            dlg.CheckForNewerVersion   = ViewModel.CheckForNewerVersion;
            dlg.PreserveWindowPosition = ViewModel.PreserveWindowPosition;

            dlg.SetContentTypeAutomtically = ViewModel.SetContentTypeAutomatically;
            dlg.ContentTypes = ViewModel.ContentTypes;

            if (dlg.ShowDialog().Value)
            {
                if (ViewModel.Culture != dlg.Culture)
                {
                    MessageBox.Show("Culture changes will apply the next time you launch Azure Storage Explorer",
                                    "Culture Changed", MessageBoxButton.OK, MessageBoxImage.Information);
                }

                Cursor = Cursors.Wait;

                ViewModel.AutoSaveConfiguration = false;

                ViewModel.Culture = dlg.Culture;
                ViewModel.ShowWelcomeOnStartup   = dlg.ShowWelcomeOnStartup;
                ViewModel.PreserveWindowPosition = dlg.PreserveWindowPosition;

                ViewModel.SetContentTypeAutomatically = dlg.SetContentTypeAutomtically;
                ViewModel.CheckForNewerVersion        = dlg.CheckForNewerVersion;
                ViewModel.ContentTypes = dlg.ContentTypes;

                ViewModel.SaveConfiguration();

                ViewModel.AutoSaveConfiguration = true;

                Cursor = Cursors.Arrow;
            }
        }
Exemplo n.º 11
0
        private void TsbOptionsClick(object sender, EventArgs e)
        {
            var oDialog = new OptionsDialog(currentOptions);

            if (oDialog.ShowDialog(this) == DialogResult.OK)
            {
                bool reinitDisplay = currentOptions.DisplayMostUsedFirst != oDialog.Option.DisplayMostUsedFirst ||
                                     currentOptions.MostUsedList.Count != oDialog.Option.MostUsedList.Count ||
                                     currentOptions.DisplayLargeIcons != oDialog.Option.DisplayLargeIcons ||
                                     !oDialog.Option.HiddenPlugins.SequenceEqual(currentOptions.HiddenPlugins);

                currentOptions = oDialog.Option;

                if (reinitDisplay)
                {
                    tabControl1.SelectedIndex = 0;
                    DisplayPlugins();
                }
            }
        }
Exemplo n.º 12
0
        private void TsbOptionsClick(object sender, EventArgs e)
        {
            var oDialog = new OptionsDialog(currentOptions, pManager);

            if (oDialog.ShowDialog(this) == DialogResult.OK)
            {
                bool reinitDisplay = currentOptions.DisplayMostUsedFirst != oDialog.Option.DisplayMostUsedFirst ||
                                     currentOptions.MostUsedList.Count != oDialog.Option.MostUsedList.Count ||
                                     currentOptions.DisplayLargeIcons != oDialog.Option.DisplayLargeIcons ||
                                     !oDialog.Option.HiddenPlugins.SequenceEqual(currentOptions.HiddenPlugins);

                currentOptions = oDialog.Option;

                if (reinitDisplay)
                {
                    //pManager.PluginsControls.Clear();
                    pluginsModels.Clear();
                    tabControl1.SelectedIndex = 0;
                    DisplayPlugins(tstxtFilterPlugin.Text);
                    AdaptPluginControlSize();
                }
            }
        }
Exemplo n.º 13
0
        protected void OnOptionsClicked(OptionsDialog.OptionsTabIndex tabIndex)
        {
            if (mainform == null)
            {
                mainform = new MainForm();
            }
            OptionsDialog dlg = new OptionsDialog(mainform, tabIndex);

            try
            {
                dlg.ApplyChanges += new OptionsDialog.ApplyChangesHandler(OnApplyChanges);
                System.Windows.Forms.DialogResult result = dlg.ShowDialog();
                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    OnOptionsChanged();
                }
            }
            finally
            {
                dlg.Close();
                dlg.Dispose();
            }
        }
Exemplo n.º 14
0
        private void ShowOptionsDialog()
        {
            if (OwnedWindows.OfType <OptionsDialog>().Any())
            {
                return;
            }

            OptionsDialogModel optionsDialogModel = new OptionsDialogModel {
                LastOptionsPageType = _LastOptionsPageType
            };
            OptionsDialog dialog = new OptionsDialog
            {
                Owner = this,
                WindowStartupLocation = (WindowState == WindowState.Minimized ? WindowStartupLocation.CenterScreen : WindowStartupLocation.CenterOwner),
                DataContext           = optionsDialogModel
            };

            if (dialog.ShowDialog() == true)
            {
                optionsDialogModel.SaveOptions();
                _LastOptionsPageType = optionsDialogModel.LastOptionsPageType;
            }
        }
Exemplo n.º 15
0
        public void DisplayOptionsDialog()
        {
            OptionsDialog optionsDialog = new OptionsDialog(this);

            if (optionsDialog.ShowDialog() == true)             // User hit Save
            {
                // General Options
                foreach (var boolOption in optionsDialog.Changeset.BoolOptionsChangeset)
                {
                    _sqliteProvider.UpdateBoolOption(boolOption.Key, boolOption.Value);
                    _config.BoolOptions[boolOption.Key] = boolOption.Value;
                    if (boolOption.Key == Constants.BoolOptionsNames.UseDTW)
                    {
                        _classifier.UseDTW = boolOption.Value;
                    }
                }
                // Bone Colors
                foreach (var boneColor in optionsDialog.Changeset.BoneColorsChangeset)
                {
                    _sqliteProvider.UpdateBoneColor(boneColor.Key, boneColor.Value);
                    _config.BoneColors[boneColor.Key] = boneColor.Value;
                }
            }
        }
Exemplo n.º 16
0
 private void optionsToolStripButton_Click(object sender, EventArgs e)
 {
     //Create Options Dialog
     using (OptionsDialog optDlg = new OptionsDialog())
         optDlg.ShowDialog();
 }
Exemplo n.º 17
0
        private void OptionsIcon_Clicked(object sender, MouseButtonEventArgs e)
        {
            //new OptionsDialog(Settings).ShowDialog();

            OptionsDialog od = new OptionsDialog(Settings.GetCopy());

            bool? result = od.ShowDialog();

            if (result != null && result.HasValue && result.Value)
            {
                od.Settings.CopyTo(Settings);

                Settings.Save(Path.Combine(AppFolder, "settings.xml"));
            }
        }
Exemplo n.º 18
0
        private void HandleEditOptions([NotNull] object sender, [NotNull] RoutedEventArgs e)
        {
            Assert.ArgumentNotNull(sender, "sender");
            Assert.ArgumentNotNull(e, "e");

            var model = new OptionsViewModel()
            {
                AutoClearInput     = SettingsHolder.Instance.Settings.AutoClearInput,
                AutoReconnect      = SettingsHolder.Instance.Settings.AutoReconnect,
                CommandChar        = SettingsHolder.Instance.Settings.CommandChar,
                CommandDelimiter   = SettingsHolder.Instance.Settings.CommandDelimiter,
                StartOfLine        = SettingsHolder.Instance.Settings.CursorPosition == CursorPositionHistory.StartOfLine,
                EndOfLine          = SettingsHolder.Instance.Settings.CursorPosition == CursorPositionHistory.EndOfLine,
                HistorySize        = SettingsHolder.Instance.Settings.CommandsHistorySize.ToString(),
                MinLengthHistory   = SettingsHolder.Instance.Settings.MinLengthHistory.ToString(),
                ScrollBuffer       = SettingsHolder.Instance.Settings.ScrollBuffer.ToString(),
                SettingsFolder     = SettingsHolder.Instance.SettingsFolder == SettingsFolder.DocumentsAndSettings,
                AutoConnect        = SettingsHolder.Instance.Settings.AutoConnect,
                SelectedFont       = SettingsHolder.Instance.Settings.MUDFontName,
                SelectedFontSize   = SettingsHolder.Instance.Settings.MUDFontSize,
                SelectedFontWeight = SettingsHolder.Instance.Settings.MudFontWeight,
            };

            var optionsDialog = new OptionsDialog()
            {
                DataContext = model, Owner = this
            };
            var dialogResult = optionsDialog.ShowDialog();

            if (dialogResult.HasValue && dialogResult.Value)
            {
                SettingsHolder.Instance.Settings.AutoClearInput   = model.AutoClearInput;
                SettingsHolder.Instance.Settings.AutoReconnect    = model.AutoReconnect;
                SettingsHolder.Instance.Settings.CommandChar      = model.CommandChar;
                SettingsHolder.Instance.Settings.CommandDelimiter = model.CommandDelimiter;
                SettingsHolder.Instance.Settings.AutoConnect      = model.AutoConnect;
                SettingsHolder.Instance.Settings.ColorTheme       = model.SelectedTheme.Name;
                ThemeManager.Instance.ActiveTheme              = model.SelectedTheme;
                SettingsHolder.Instance.Settings.MUDFontName   = model.SelectedFont;
                SettingsHolder.Instance.Settings.MUDFontSize   = model.SelectedFontSize;
                SettingsHolder.Instance.Settings.MudFontWeight = model.SelectedFontWeight;

                if (model.StartOfLine)
                {
                    SettingsHolder.Instance.Settings.CursorPosition = CursorPositionHistory.StartOfLine;
                }
                else
                {
                    SettingsHolder.Instance.Settings.CursorPosition = CursorPositionHistory.EndOfLine;
                }

                if (model.SettingsFolder)
                {
                    SettingsHolder.Instance.SettingsFolder = SettingsFolder.DocumentsAndSettings;
                }
                else
                {
                    SettingsHolder.Instance.SettingsFolder = SettingsFolder.ProgramFolder;
                }

                int val;
                if (int.TryParse(model.HistorySize, out val))
                {
                    SettingsHolder.Instance.Settings.CommandsHistorySize = val;
                }

                if (int.TryParse(model.MinLengthHistory, out val))
                {
                    SettingsHolder.Instance.Settings.MinLengthHistory = val;
                }

                if (int.TryParse(model.ScrollBuffer, out val))
                {
                    SettingsHolder.Instance.Settings.ScrollBuffer = val < 100000 ? val : 100000;
                }

                SettingsHolder.Instance.SaveCommonSettings();
            }
        }
Exemplo n.º 19
0
        private void optionsMenuItem_Click(object sender, EventArgs e)
        {
            OptionsDialog optionsForm = new OptionsDialog();

            optionsForm.UserAgent = scp.UserAgent;

            if (optionsForm.ShowDialog() == DialogResult.OK)
            {
                bool saveOptions = false;
                if (scp.UserAgent != optionsForm.UserAgent)
                {
                    Properties.Settings.Default.UserAgentCurrent = optionsForm.UserAgent;
                    saveOptions = true;

                    scp.UserAgent = optionsForm.UserAgent;
                    scp.Rescan();
                }

                if (saveOptions)
                {
                    Properties.Settings.Default.Save();
                }
            }
        }
        private void linkLabelOptions_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var optionsDialog = new OptionsDialog();

            optionsDialog.ShowDialog(this);
        }
        private void MenuItem_Options_Click(object sender, RoutedEventArgs e)
        {
            OptionsDialog optionsDlg = new OptionsDialog(Controller);

            optionsDlg.ShowDialog();
        }
Exemplo n.º 22
0
        private void optionsMenuItem_Click(object sender, EventArgs e)
        {
            var od = new OptionsDialog();

            od.ShowDialog();
        }
Exemplo n.º 23
0
        // Tools
        private void MenuToolsOptions_Click(object sender, EventArgs e)
        {
            var optionsWindow = new OptionsDialog();

            optionsWindow.ShowDialog(this);
        }
Exemplo n.º 24
0
        private void Options_Click(object sender, EventArgs e)
        {
            OptionsDialog options = new OptionsDialog();

            if ((ToolStripMenuItem)sender == this.Options)
            {
                options.ShowDialog();

                if (options.DialogResult == DialogResult.Cancel)
                {
                    return;
                }
            }
            if (!Game.GameOver & !Game.Finished & !IsFirst)
            {
                return;
            }

            switch (OptionsDialog.Level)
            {
            case 1:
            {
                this.Clock.Location               = new Point(20, 265);
                this.RemainingMines.Location      = new Point(225, 270);
                this.ClockLabel.Location          = new Point(50, 270);
                this.RemainingMinesLabel.Location = new Point(190, 270);

                Game = new Game()
                {
                    Rows    = 10,
                    Columns = 10,
                    Bombs   = 10
                };

                Game.Location       = new Point(15, 25);
                Game.RemainingItems = 100;
                Game.RemainingBombs = 10;
                Game.Size           = new Size(240, 240);

                this.Size = new Size(285, 335);
                this.RemainingMinesLabel.Text = "10";
                this.ClockLabel.Text          = "0";
                this.Controls.RemoveAt(5);
                this.Controls.Add(Game);

                Game.MouseClick      += new MouseEventHandler(Game_MouseClick);
                Game.PropertyChanged += new PropertyChangedEventHandler(Game_PropertyChanged);

                Timer          = new Timer();
                Timer.Tick    += new EventHandler(Time_Tick);
                Timer.Interval = 1000;
                IsFirst        = true;
                TimeSeconds    = 1;
                break;
            }

            case 2:
            {
                this.Clock.Location               = new Point(20, 385);
                this.RemainingMines.Location      = new Point(350, 390);
                this.ClockLabel.Location          = new Point(50, 390);
                this.RemainingMinesLabel.Location = new Point(315, 390);

                Game = new Game()
                {
                    Rows    = 15,
                    Columns = 15,
                    Bombs   = 30
                };

                Game.Location       = new Point(15, 25);
                Game.RemainingItems = 15 * 15;
                Game.RemainingBombs = 30;
                Game.Size           = new Size(24 * 15, 24 * 15);

                this.Size = new Size(410, 460);
                this.RemainingMinesLabel.Text = "30";
                this.ClockLabel.Text          = "0";
                this.Controls.RemoveAt(5);
                this.Controls.Add(Game);

                Game.MouseClick      += new MouseEventHandler(Game_MouseClick);
                Game.PropertyChanged += new PropertyChangedEventHandler(Game_PropertyChanged);

                Timer          = new Timer();
                Timer.Tick    += new EventHandler(Time_Tick);
                Timer.Interval = 1000;
                IsFirst        = true;
                TimeSeconds    = 1;
                break;
            }

            case 3:
            {
                this.Clock.Location               = new Point(20, 505);
                this.RemainingMines.Location      = new Point(465, 510);
                this.ClockLabel.Location          = new Point(50, 510);
                this.RemainingMinesLabel.Location = new Point(430, 510);

                Game = new Game()
                {
                    Rows    = 20,
                    Columns = 20,
                    Bombs   = 50
                };

                Game.Location       = new Point(15, 25);
                Game.RemainingItems = 20 * 20;
                Game.RemainingBombs = 50;
                Game.Size           = new Size(24 * 20, 24 * 20);

                this.Size = new Size(527, 575);
                this.UpdateBounds();
                this.RemainingMinesLabel.Text = "50";
                this.ClockLabel.Text          = "0";
                this.Controls.RemoveAt(5);
                this.Controls.Add(Game);

                Game.MouseClick      += new MouseEventHandler(Game_MouseClick);
                Game.PropertyChanged += new PropertyChangedEventHandler(Game_PropertyChanged);

                Timer          = new Timer();
                Timer.Tick    += new EventHandler(Time_Tick);
                Timer.Interval = 1000;
                IsFirst        = true;
                TimeSeconds    = 1;
                break;
            }
            }
        }
Exemplo n.º 25
0
        private void OnOpenScreenSaverOptions(object sender, EventArgs e)
        {
            Form dialog = new OptionsDialog();

            dialog.ShowDialog();
        }