コード例 #1
0
        private void Options_Button_Click(object sender, RoutedEventArgs e)
        {
            OptionsWindow optionsWindow = new OptionsWindow(this.Left, this.Top, this.Height, this.Width, 0.8);

            optionsWindow.ShowDialog();
            optionsWindow.Close();
        }
コード例 #2
0
 // Tools
 private void MenuToolsOptions_Click(object sender, EventArgs e)
 {
     using (OptionsWindow optionsWindow = new OptionsWindow())
     {
         _ = optionsWindow.ShowDialog(this);
     }
 }
コード例 #3
0
        private void OpenOptionsWindow(object sender, RoutedEventArgs e)
        {
            OptionsWindow oW = new OptionsWindow();

            oW.ShowDialog();
            oW.Focus();
        }
コード例 #4
0
        public ITranslationProvider[] Browse(IWin32Window owner, LanguagePair[] languagePairs, ITranslationProviderCredentialStore credentialStore)
        {
            try
            {
                var options     = new SdlMTCloudTranslationOptions();
                var credentials = SplitCredentials(credentialStore, options);
                var window      = new OptionsWindow();
                var languages   = new Languages.Provider.Languages();

                var model = new OptionsWindowModel(window, options, credentials, languagePairs, languages);

                window.DataContext = model;

                window.ShowDialog();
                if (window.DialogResult.HasValue && window.DialogResult.Value)
                {
                    var clientId     = model.Options.ClientId;
                    var clientSecret = model.Options.ClientSecret;
                    var resendDraft  = model.Options.ResendDrafts;

                    var provider = new SdlMTCloudTranslationProvider(options)
                    {
                        Options = model.Options
                    };

                    SetCredentials(credentialStore, clientId, clientSecret, resendDraft, true);
                    return(new ITranslationProvider[] { provider });
                }
            }
            catch (Exception e)
            {
                Log.Logger.Error($"{Constants.Browse} {e.Message}\n {e.StackTrace}");
            }
            return(null);
        }
コード例 #5
0
        private void Menu_OpenOptions(object sender, RoutedEventArgs e)
        {
            var optionsWindow = new OptionsWindow {
                Owner = this, ShowInTaskbar = false
            };

            optionsWindow.ShowDialog();
        }
コード例 #6
0
 /// <summary>
 /// Show the options menu
 /// Task finishes when the window is closed
 /// </summary>
 public async Task RunShowOptionsMenu()
 {
     if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
     {
         var optionsWindow = new OptionsWindow(CurrentOptions);
         await optionsWindow.ShowDialog(desktop.MainWindow);
     }
 }
コード例 #7
0
ファイル: MainWindow.xaml.cs プロジェクト: Kuh4ku/Mercybot
        private void BtnOptions_Click(object sender, RoutedEventArgs e)
        {
            var optionsWindow = new OptionsWindow {
                Owner = this
            };

            optionsWindow.ShowDialog();
        }
コード例 #8
0
        private void OptionsMenuItem_Click(object sender, RoutedEventArgs e)
        {
            OptionsWindow optionWindow = new OptionsWindow();

            if (optionWindow.ShowDialog() == false)
            {
            }
        }
コード例 #9
0
        private void Options_Button_Click(object sender, RoutedEventArgs e)
        {
            OptionsWindow optionsWindow = new OptionsWindow(this.Left, this.Top, this.Height, this.Width, 0.8);

            //setup the options window while it exists
            GuiController.GetController().SetupOptionsWindow(optionsWindow);
            optionsWindow.ShowDialog();
            optionsWindow.Close();
        }
コード例 #10
0
        /// <summary>
        /// Shows the options window.
        /// </summary>
        private void ShowOptionsWindow()
        {
            OptionsWindow window = new OptionsWindow()
            {
                Owner = Application.Current.MainWindow, WindowStartupLocation = WindowStartupLocation.CenterOwner
            };

            window.ShowDialog();
        }
コード例 #11
0
        private bool ShowOptionsWindow()
        {
            var optionsWindow = new OptionsWindow
            {
                DataContext = optionsViewModel,
            };

            optionsViewModel.SetOptionsWindow(optionsWindow);
            return(optionsWindow.ShowDialog() == true);
        }
コード例 #12
0
ファイル: RootViewModel.cs プロジェクト: cg123/xenko
        private bool ShowOptionsWindow()
        {
            var optionsWindow = new OptionsWindow
            {
                DataContext = optionsViewModel,
            };

            optionsViewModel.SetOptionsWindow(optionsWindow);
            return optionsWindow.ShowDialog() == true;
        }
コード例 #13
0
        private void ShowOptionsWindowMethod()
        {
            OptionsModel     model     = new OptionsModel();
            OptionsViewModel viewModel = new OptionsViewModel(model);

            OptionsWindow view = new OptionsWindow();

            view.DataContext = viewModel;

            view.ShowDialog();
        }
コード例 #14
0
        private void MenuItemOptionsWindow_Click(object sender, RoutedEventArgs e)
        {
            var wnd = new OptionsWindow(new List <IOutputDevicePlugin>()
            {
                new WasapiOutPlugin(),
                new WaveOutPlugin(),
                new DirectSoundOutPlugin(),
                new NullOutPlugin()
            });

            wnd.ShowDialog();
        }
コード例 #15
0
        public bool ShowOptions(OptionsCollectionViewModel viewModel)
        {
            var window = new OptionsWindow();

            window.DataContext = viewModel;
            window.Icon        = BitmapFrame.Create(new Uri("pack://application:,,,/CalDavSynchronizer;component/Resources/ApplicationIcon.ico"));
            ElementHost.EnableModelessKeyboardInterop(window);

            viewModel.RequestBringIntoView += delegate { window.BringIntoView(); };

            return(window.ShowDialog().GetValueOrDefault(false));
        }
コード例 #16
0
 /// <summary>
 /// Handles the Click event of the OptionsButton control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void OptionsButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         OptionsWindow childWindow = new OptionsWindow();
         this.Close();
         childWindow.ShowDialog();
     }
     catch (Exception error)
     {
         errorLogViewModel.LogError(error);
     }
 }
コード例 #17
0
 public void AppStart(object sender, StartupEventArgs args)
 {
     Bootstrap.Build();
     if (CfgService.ReadPropertyParseBool("showCfgWndOnStartup"))
     {
         Window optionsWindow = new OptionsWindow();
         optionsWindow?.ShowDialog();
     }
     else
     {
         Window mainWindow = new MainWindow();
         mainWindow?.Show();
     }
 }
コード例 #18
0
        private void ShowOptions()
        {
            var options = new OptionsWindow();

            options.ShowDialog();

            if (options.RefreshRecentLists)
            {
                recentQueries.Clear();
                LoadList(recentQueries, Settings.RecentQueries);

                recentDestinations.Clear();
                LoadList(recentDestinations, Settings.RecentPaths);
            }
        }
コード例 #19
0
        private void SetOptions(object sender, RoutedEventArgs e)
        {
            OptionsWindow optionWindow = new OptionsWindow(options);

            optionWindow.ShowDialog();
            if (optionWindow.DialogResult == true)
            {
                ComboBoxItem DefaultGame = (ComboBoxItem)optionWindow.DefaultGame.SelectedItem;
                int          defaultGame = Convert.ToInt32(DefaultGame.Tag);
                options = new Options(optionWindow.DefaultImport.Text, optionWindow.DefaultExport.Text, (SupportedGames)defaultGame, optionWindow.WWiseExePath.Text, optionWindow.DefaultProjectPath.Text);
                options.WriteOptions();
                mode = options.defaultGame;
                ChangeView();
            }
        }
コード例 #20
0
        private void Options_Click(object sender, RoutedEventArgs e)
        {
            Logger.Add(new Log(this.GetType().Name, MethodBase.GetCurrentMethod().Name, "Menu -> Options"));
            OptionsWindow view = new OptionsWindow();

            this.Visibility = Visibility.Hidden;
            if (bool.Parse(view.ShowDialog().ToString()))
            {
                this.Visibility = Visibility.Visible;
                PlayerName      = ConfigurationManager.AppSettings["PlayerName"];
                Logger.Add(new Log(this.GetType().Name, MethodBase.GetCurrentMethod().Name, "Options was changed"));
            }
            else
            {
                KILL();
            }
        }
コード例 #21
0
        public static void EditOptions(Options options)
        {
            var toEdit = new Options
            {
                OfficeVersion     = options.OfficeVersion,
                OfficeApplication = options.OfficeApplication
            };

            var window = new OptionsWindow(toEdit);

            var result = window.ShowDialog();

            if (result.HasValue && result.Value)
            {
                options.OfficeVersion     = toEdit.OfficeVersion;
                options.OfficeApplication = toEdit.OfficeApplication;
            }
        }
コード例 #22
0
        private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            System.Diagnostics.Debug.Print(e.Key.ToString());

            OnWindowKeyDown(sender, e);
            var isCtrl = (System.Windows.Input.Keyboard.IsKeyDown(Key.LeftCtrl) || System.Windows.Input.Keyboard.IsKeyDown(Key.RightCtrl));

            if (e.Key == Key.O && isCtrl)
            {
                var wnd = new OptionsWindow(new List <IOutputDevicePlugin>()
                {
                    new WasapiOutPlugin(),
                    new WaveOutPlugin(),
                    new DirectSoundOutPlugin(),
                    new NullOutPlugin()
                });

                wnd.ShowDialog();
            }
        }
コード例 #23
0
ファイル: Toolbar.cs プロジェクト: ckaczor/FeedCenter
        private void HandleOptionsToolbarButtonClick(object sender, RoutedEventArgs e)
        {
            // Create the options form
            var optionsWindow = new OptionsWindow {
                Owner = this
            };

            // Show the options form and get the result
            var result = optionsWindow.ShowDialog();

            // If okay was selected
            if (result.HasValue && result.Value)
            {
                // Reset the database to current settings
                ResetDatabase();

                // Re-initialize the feed display
                DisplayFeed();
            }
        }
コード例 #24
0
        public MainWindow()
        {
            this.InitializeComponent();

            this.Logger = new Logger(this.LogStackPanel, true);
            AlertManager.SetupAlert(this.AlertBox, this.AlertBody);

            this.SetupPages();

            SavedData.LoadData();

            this.ToOptionsButton.Click += (sender, args) =>
            {
                var options = new OptionsWindow {
                    Owner = this
                };

                options.ShowDialog();
            };
        }
コード例 #25
0
        public bool Edit(IWin32Window owner, ITranslationProvider translationProvider, LanguagePair[] languagePairs,
                         ITranslationProviderCredentialStore credentialStore)
        {
            try
            {
                if (!(translationProvider is SdlMTCloudTranslationProvider editProvider))
                {
                    return(false);
                }

                //get saved key if there is one and put it into options
                var credentials = SplitCredentials(credentialStore, editProvider.Options);
                var window      = new OptionsWindow();
                var languages   = new Languages.Provider.Languages();

                var model = new OptionsWindowModel(window, editProvider.Options, credentials, languagePairs, languages);

                window.DataContext = model;

                window.ShowDialog();
                if (window.DialogResult.HasValue && window.DialogResult.Value)
                {
                    editProvider.Options = model.Options;
                    var clientId     = editProvider.Options.ClientId;
                    var clientSecret = model.Options.ClientSecret;
                    var resendDraft  = model.Options.ResendDrafts;
                    SetCredentials(credentialStore, clientId, clientSecret, resendDraft, true);
                    return(true);
                }
            }
            catch (Exception e)
            {
                Log.Logger.Error($"{Constants.EditWindow} {e.Message}\n {e.StackTrace}");
            }
            return(false);
        }
コード例 #26
0
        public void OptionsCommand_Execute()
        {
            var optionsWindow = new OptionsWindow();

            optionsWindow.ShowDialog();
        }
コード例 #27
0
ファイル: Window1.xaml.cs プロジェクト: Team624/2015Beta
		private void options_popup(object sender, EventArgs e)
		{
			OptionsWindow popup = new OptionsWindow();
			popup.ShowDialog();
			reloadOptions();
		}
コード例 #28
0
        private void OptionsButton_Click(object sender, RoutedEventArgs e)
        {
            var options = new OptionsWindow(AnalysisJobViewModel.Options);

            options.ShowDialog();
        }
コード例 #29
0
        private void MenuToolsOptions_Click(object sender, EventArgs e)
        {
            var optionsWindow = new OptionsWindow();

            optionsWindow.ShowDialog(this);
        }
コード例 #30
0
        void ShowOptions(object obj)
        {
            var options = new OptionsWindow();

            options.ShowDialog();
        }
コード例 #31
0
 private void ShowOptionsWindow()
 {
     OptionsWindow = new OptionsWindow();
     OptionsWindow.ShowDialog();
 }
コード例 #32
0
ファイル: MainWindowViewModel.cs プロジェクト: wushian/runcmd
        private void ExecOpenOptionsWinCmd(object obj)
        {
            var optWin = new OptionsWindow();

            optWin.ShowDialog();
        }
コード例 #33
0
ファイル: MainWindow.xaml.cs プロジェクト: chembergj/VSPC
 private void buttonOptions_Click(object sender, RoutedEventArgs e)
 {
     var optionsWindow = new OptionsWindow();
     optionsWindow.ShowDialog();
 }