Esempio n. 1
0
        public static void Main(string[] args)
        {
            API.RSA.Init();
            API.Server.StartServer();


            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.Run(OptionsForm = new OptionsForm());
        }
Esempio n. 2
0
        void TsbtnOptionsClick(object sender, EventArgs e)
        {
            // запуск диалога Настроек
            OptionsForm ofrm = new OptionsForm();

            ofrm.ShowDialog();
            // задание для кнопок ToolStrip стиля и положения текста и картинки
            sfbTpArchiveManager.SetToolButtonsSettings();
            sfbTpFB2Dublicator.SetToolButtonsSettings();
            ofrm.Dispose();
        }
Esempio n. 3
0
        private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var of = new OptionsForm();

            if (of.ShowDialog() == DialogResult.OK)
            {
                foreach (IDockContent content in this.dockPanel.Contents)
                {
                    content.DockHandler.Form.Invalidate();
                }
            }
        }
Esempio n. 4
0
        private void EngineAnalysisForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            UnloadEngine();
            if (OptionsForm != null)
            {
                OptionsForm.Close();
            }

            InfoUpdateTimer.Dispose();

            SaveSettings();
        }
Esempio n. 5
0
        private void OptionsButtonClick(object sender, EventArgs e)
        {
            var optionsForm = new OptionsForm(_increaseHotkey.KeyCode, _decreaseHotkey.KeyCode);

            optionsForm.ShowDialog();

            _increaseHotkey.KeyCode = optionsForm.IncreaseHotkey;
            _decreaseHotkey.KeyCode = optionsForm.DecreaseHotkey;

            Settings.Default.decreaseHotkey = optionsForm.DecreaseHotkey;
            Settings.Default.increaseHotkey = optionsForm.IncreaseHotkey;
            Settings.Default.Save();
        }
Esempio n. 6
0
        public FormsManager(GUIForm guiForm)
        {
            MainMenu     = new MainMenuForm(guiForm, this);
            Game         = new GameForm(guiForm, this);
            StageNumber  = new StageNumberForm(guiForm, this);
            GameOver     = new GameOverForm(guiForm, this);
            Construction = new ConstructionForm(guiForm, this, Game.Field);
            Options      = new OptionsForm(guiForm, this);
            Records      = new RecordsForm(guiForm, this);

            ActiveForm = MainMenu;
            SetMainMenuForm();
        }
Esempio n. 7
0
        /// <summary>
        /// Show the various options and allow the user to change certain settings.
        /// </summary>
        /// <param name="control"></param>
        public void OnManageMore(Office.IRibbonControl control)
        {
            if (null == _engine.Options)
            {
                return;
            }

            using (var optionsForm = new OptionsForm(_engine, _engine.Categories))
            {
                optionsForm.StartPosition = FormStartPosition.CenterScreen;
                optionsForm.ShowDialog( );
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Shows the options.
        /// </summary>
        public void ShowOptions()
        {
            OptionsForm form = new OptionsForm(this.SettingsService.DisplayLogo);

            form.ShowDialog();

            //// in case any of the setting have changed to do with logging reset them!
            TraceService.Initialize(
                this.SettingsService.LogToTrace,
                this.SettingsService.LogToFile,
                this.SettingsService.LogFilePath,
                this.SettingsService.DisplayErrors);
        }
Esempio n. 9
0
        /// <summary>
        /// Shows the options dialog.
        /// </summary>
        /// <param name="hParentWnd">Handle to parent window.</param>
        /// <param name="parameters">The parameter string.</param>
        /// <returns>The new parameter string.</returns>
        public string ShowOptionsDialog(IntPtr hParentWnd, string parameters)
        {
            PluginParameter parameter = new PluginParameter(parameters);

            OptionsForm options = new OptionsForm(parameter, ConfiguredProviders.Select(typeMapping => typeMapping.Name));

            if (options.ShowDialog() == DialogResult.OK)
            {
                return(options.Parameter.ParameterString());
            }

            return(parameters);
        }
Esempio n. 10
0
 private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     options            = new OptionsForm();
     options.Model      = model;
     options.manager    = manager;
     optionsPage        = new TabPage("Options");
     tabControl.Visible = true;
     tabControl.Dock    = DockStyle.Fill;
     tabControl.Controls.Add(optionsPage);
     optionsPage.Controls.Add(options);
     options.InitialiseUI();
     tabControl.SelectedTab = optionsPage;
 }
Esempio n. 11
0
        private void InitOptionsForm()
        {
            optionsForm = new OptionsForm();
            optionsForm.Init(
                trackFrm,
                airwayNetwork,
                countryCodesLocator,
                appOptionsLocator,
                updater);

            optionsForm.NavDataLocationChanged += (s, e) =>
                                                  fuelMenu.RefreshForNavDataLocationChange();
        }
Esempio n. 12
0
        public static void Options(BaseController Controller)
        {
            // ---------------------------------------------------------------
            // User wants to modify user interface options.
            // ---------------------------------------------------------------
            OptionsForm Form = new OptionsForm();

            Form.ShowDialog();
            MainUI F = (MainUI)Controller.MainForm;

            PlugIns.LoadAll();
            F.PopulateToolBoxStrip();
            F.SimulationToolStrip.Visible = Configuration.Instance.Setting("HideMainMenu") != "Yes";
        }
Esempio n. 13
0
        private void options_Click(object sender, EventArgs e)
        {
            using (OptionsForm frm = new OptionsForm())
            {
                IList <Camera> camCopy = new List <Camera>();

                foreach (Camera item in Configuration.Instance.Cameras)
                {
                    camCopy.Add(new Camera()
                    {
                        ID = item.ID, Name = item.Name, IpAddress = item.IpAddress, Mac = item.Mac, Status = item.Status
                    });
                }


                frm.Cameras = camCopy;
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    Properties.Settings setting = Properties.Settings.Default;

                    Configuration.Instance.Cameras = frm.Cameras;//这里添加设置摄像机的 IP 和 ID 对应的设置类文件 ResetCameraInfo
                    Configuration.Instance.Save();

                    setting.Save();

                    InitStatusBar();

                    this.Cameras = frm.Cameras.ToArray <Camera>();



                    var   minFaceWidth = int.Parse(setting.MinFaceWidth);
                    float ratio        = float.Parse(setting.MaxFaceWidth) / minFaceWidth;

                    SetupExtractor(setting.EnvMode,
                                   float.Parse(setting.IconLeftExtRatio),
                                   float.Parse(setting.IconRightExtRatio),
                                   float.Parse(setting.IconTopExtRatio),
                                   float.Parse(setting.IconBottomExtRatio),
                                   minFaceWidth,
                                   ratio,
                                   new Rectangle(int.Parse(setting.SrchRegionLeft),
                                                 int.Parse(setting.SrchRegionTop),
                                                 int.Parse(setting.SrchRegionWidth),
                                                 int.Parse(setting.SrchRegionHeight))
                                   );
                    StartSetCam(setting);
                }
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="settings">C45Settings object</param>
        /// <param name="windowOwner">Owner window handle interface</param>
        public C45InteropConfiguration(C45Settings settings,
                                       IWin32Window windowOwner)
        {
            this.settings = settings;
            OptionsForm form = new OptionsForm(settings);

            form.ShowDialog(windowOwner);

            if (form.DialogResult == DialogResult.OK)
            {
                this.settings = form.Settings;
                this.Changed  = true;
            }
        }
Esempio n. 15
0
 // Executed when the user clicks on Tools -> Options
 private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         using (OptionsForm of = new OptionsForm())
         {
             of.ShowDialog(this);
         }
     }
     catch (Exception ex)
     {
         Program.ShowMessageBox("FrmWebBrowser", ex);
     }
 }
Esempio n. 16
0
 public async Task WithKeys()
 {
     using var form = new OptionsForm(
               new Settings
     {
         AcceptAllHotKey = new HotKey
         {
             Shift = true,
             Key   = "A"
         }
     },
               x => Task.FromResult <IReadOnlyList <string> >(new List <string>()));
     await Verifier.Verify(form);
 }
Esempio n. 17
0
 public static void ShowOptions()
 {
     m_ActivatePluginTab = true;
     if (OptionsEnabled)
     {
         KeePass.Program.MainForm.ToolsMenu.DropDownItems["m_menuToolsOptions"].PerformClick();
     }
     else
     {
         m_of = new OptionsForm();
         m_of.InitEx(KeePass.Program.MainForm.ClientIcons);
         m_of.ShowDialog();
     }
 }
Esempio n. 18
0
 private static void OnWindowAdded(object sender, KeePass.UI.GwmWindowEventArgs e)
 {
     if (OptionsFormShown == null)
     {
         return;
     }
     if (e.Form is OptionsForm)
     {
         m_of        = e.Form as OptionsForm;
         m_of.Shown += OnOptionsFormShown;
         OptionsFormsEventArgs o = new OptionsFormsEventArgs(m_of);
         OptionsFormShown(sender, o);
     }
 }
    public static async Task Launch(KeyRegister keyRegister, Tracker tracker)
    {
        if (instance != null)
        {
            instance.BringToFront();
            return;
        }

        var settings = await SettingsHelper.Read();

        using var form = new OptionsForm(settings, newSettings => Save(keyRegister, tracker, newSettings));
        instance       = form;
        form.Closed   += formOnClosed;
        form.ShowDialog();
    }
Esempio n. 20
0
        private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Logger.Trace(System.Reflection.MethodBase.GetCurrentMethod().Name);
            string      currentLocale = MainForm.optionsData.selectedLocale;
            OptionsForm optionsForm   = new OptionsForm();

            optionsForm.ShowDialog();
            optionsJson.WriteOptionsJson();
            if (MainForm.optionsData.selectedLocale != currentLocale)
            {
                localeManager.SetLocale(this);
                SetTopMenuTexts();
                SetWindowTitle();
            }
        }
        private void OnCmdColumnsClick(object sender, EventArgs e)
        {
            OptionsForm optionForm = new OptionsForm();

            optionForm.InitializeColumns(RequestCollumns, SubRequestCollumns);

            if (sender == m_cmdColumnsRequest)
            {
                optionForm.ShowDialog(Tabs.RequestColumns);
            }
            else
            {
                optionForm.ShowDialog(Tabs.RowColumns);
            }
        }
Esempio n. 22
0
 private void OptionsButton_Click(object sender, RibbonControlEventArgs e)
 {
     try
     {
         var options = ThisAddIn.OptionsDataAccess.LoadOptions();
         if (OptionsForm.EditOptions(ThisAddIn.Session, options, out options))
         {
             ThisAddIn.OptionsDataAccess.SaveOptions(options);
             ThisAddIn.Scheduler.SetOptions(options);
         }
     }
     catch (Exception x)
     {
         ExceptionHandler.Instance.HandleException(x, s_logger);
     }
 }
Esempio n. 23
0
        public static void Setup()
        {
            var form = new OptionsForm();

            switch (form.ShowDialog())
            {
            case DialogResult.OK:
                HandymansManager.Save(Context.Current.Handymans);
                Properties.Settings.Default.Save();
                break;

            case DialogResult.Cancel:
                Properties.Settings.Default.Reload();
                break;
            }
        }
Esempio n. 24
0
        //OptionsClick
        //This is the event handler for clicking on the Options item under the tools menu
        //It will change basic options such as the background image, Database Filepath
        //Woot!! Jeremy was here!!
        protected void OptionsClick(object who, EventArgs e)
        {
            OptionsForm OpF;

            if (Db == null)
            {
                OpF = new OptionsForm(bgcolor, BackgroundFile);
            }
            else
            {
                OpF = new OptionsForm(bgcolor, BackgroundFile, Db.Connection.filepath);
            }
            if (OpF.ShowDialog() == DialogResult.OK)
            {
                if (!OpF.isImage)
                {
                    drawspace.BackgroundImage = null;
                    bgcolor             = OpF.BGColor;
                    drawspace.BackColor = bgcolor;
                }
                else
                {
                    drawspace.BackgroundImageLayout = ImageLayout.Stretch;
                    if (OpF.imageFilePath.Contains(".bmp"))
                    {
                        BackgroundFile = OpF.imageFilePath;
                        //drawspace.Size = new Bitmap(BackgroundFile);
                        drawspace.BackgroundImage = new Bitmap(BackgroundFile);
                        drawspace.Size            = drawspace.BackgroundImage.Size;
                        zoom = 1;
                    }
                }
                if (OpF.isDataBase && Db == null)
                {
                    Db = new DatabaseData(OpF.dbFilePath);
                    if (OpF.F2.isPassword)
                    {
                        Db.Connection.Passwrd = OpF.F2.Password;
                    }
                    Db.Connection.SetConnection();
                }
            }
            OpF.Dispose();
            //MessageBox.Show("Data base is made? FilePath = " + Db.Connection.filepath);
        }
 public void ShowOptionsNoThrow()
 {
     try
     {
         var options = _optionsDataAccess.LoadOptions();
         var shouldCheckForNewerVersions = ShouldCheckForNewerVersions;
         if (OptionsForm.EditOptions(_session, options, out options, shouldCheckForNewerVersions, out shouldCheckForNewerVersions))
         {
             _optionsDataAccess.SaveOptions(options);
             ShouldCheckForNewerVersions = shouldCheckForNewerVersions;
             _scheduler.SetOptions(options);
         }
     }
     catch (Exception x)
     {
         ExceptionHandler.Instance.HandleException(x, s_logger);
     }
 }
Esempio n. 26
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (IsGameRunning())
            {
                MessageBox.Show(Resources.MessageBox_Message_Game_Already_Running, Resources.MessageBox_Title_Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                Application.Exit();
                return;
            }

            OptionForm     = new OptionsForm();
            MainForm       = new LauncherForm();
            PatchNotesForm = new PatchNotesForm();

            Application.Run(MainForm);
        }
Esempio n. 27
0
        private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_gameRunning)
            {
                return;
            }

            var frm = new OptionsForm(Grid.Instance.Settings);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                Grid.Instance.Initialize();
                ResizeForm();
                lblScore.ForeColor = Grid.Instance.Settings.TetrisBorder;
                lblTime.ForeColor  = Grid.Instance.Settings.TetrisBorder;
                lblLevel.ForeColor = Grid.Instance.Settings.TetrisBorder;
                lblNext.ForeColor  = Grid.Instance.Settings.TetrisBorder;
            }
            TC.Refresh();
        }
Esempio n. 28
0
        private void options_Click(object sender, EventArgs e)
        {
            OptionsForm    frm     = OptionsForm.Instance;
            IList <Camera> camCopy = new List <Camera>();



            frm.Cameras = camCopy;
            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                Properties.Settings setting = Properties.Settings.Default;


                InitStatusBar();

                this.Cameras = frm.Cameras.ToArray <Camera>();

                var   minFaceWidth = int.Parse(setting.MinFaceWidth);
                float ratio        = float.Parse(setting.MaxFaceWidth) / minFaceWidth;
            }
        }
Esempio n. 29
0
        public static void Create(OptionsForm optionsForm, KeeThemeOptions options)
        {
            var controls = optionsForm.Controls.Find("m_tabMain", false);

            if (controls.Length != 1)
            {
                return;
            }

            var tabControl = controls[0] as TabControl;

            if (tabControl == null)
            {
                return;
            }

            if (tabControl.ImageList == null)
            {
                tabControl.ImageList           = new ImageList();
                tabControl.ImageList.ImageSize = new Size(DpiUtil.ScaleIntX(16), DpiUtil.ScaleIntY(16));
            }
            var imageIndex = tabControl.ImageList.Images.Add(Properties.Resource.PluginIcon, Color.Transparent);

            var optionsPanel = new OptionsPanel(options);
            var tabPage      = new TabPage("KeeTheme");

            tabPage.ImageIndex = imageIndex;
            tabPage.Controls.Add(optionsPanel);
            tabPage.UseVisualStyleBackColor = true;
            tabControl.TabPages.Add(tabPage);
            optionsPanel.Dock = DockStyle.Fill;

            optionsForm.FormClosed += (sender, args) =>
            {
                if (optionsForm.DialogResult == DialogResult.OK)
                {
                    optionsPanel.SaveOptions();
                }
            };
        }
Esempio n. 30
0
        internal static bool HandleHotKeyIntoSelf(int wParam)
        {
            try
            {
                OptionsForm f = (GlobalWindowManager.TopWindow as OptionsForm);
                if (f == null)
                {
                    return(false);
                }

                IntPtr h = NativeMethods.GetForegroundWindowHandle();
                if (h != f.Handle)
                {
                    return(false);
                }

                HotKeyControlEx c = (f.ActiveControl as HotKeyControlEx);
                if (c == null)
                {
                    return(false);
                }

                Keys k;
                if (!m_vRegKeys.TryGetValue(wParam, out k))
                {
                    return(false);
                }
                if (k == Keys.None)
                {
                    Debug.Assert(false); return(false);
                }

                c.HotKey = k;
                return(true);
            }
            catch (Exception) { Debug.Assert(false); }

            return(false);
        }
Esempio n. 31
0
        private void AdvancedButton_Click(object sender, EventArgs e)
        {
            OptionsForm f = new OptionsForm();
            f.StartPanel = OptionsFormStartPanel.Wipe;
            f.Options = _options;

            if(f.ShowDialog() == DialogResult.OK) {
                SDOptionsFile.TrySaveOptions(_options);
            }
        }
        public bool OpenOptionDialog()
        {
            OptionsForm options = new OptionsForm();
            options.ShowOptions(mOptions);

            return true;
        }
Esempio n. 33
0
 public Selenium(OptionsForm optionsForm)
 {
     this.optionsForm = optionsForm;
 }
        /// <summary>
        /// Shows the options form.
        /// </summary>
        public void ShowOptions()
        {
            this.AddTraceHeader("ShowOptions");

            OptionsForm form = new OptionsForm();

            form.ShowDialog();
        }
Esempio n. 35
0
        private void options_Click(object sender, EventArgs e)
        {
            if (!AuthorizeCurrentUser()) return;

            if (this.optionsForm == null)
            {
                this.optionsForm = new OptionsForm(this.UsersManager);
                this.optionsForm.Presenter =
                    new OptionPresenter(Damany.RemoteImaging.Common.ConfigurationManager.GetDefault(), this.optionsForm);
            }

            IList<Camera> camCopy = new List<Camera>();

            optionsForm.Cameras = camCopy;
            if (optionsForm.ShowDialog(this) == DialogResult.OK)
            {

                InitStatusBar();

                this.Cameras = ConfigurationManager.GetDefault().GetCameras();

                Properties.Settings setting = Properties.Settings.Default;
                var minFaceWidth = int.Parse(setting.MinFaceWidth);
                float ratio = float.Parse(setting.MaxFaceWidth) / minFaceWidth;
            }
        }
Esempio n. 36
0
        private void options_Click(object sender, EventArgs e)
        {
            using (OptionsForm frm = new OptionsForm())
            {
                IList<Camera> camCopy = new List<Camera>();

                foreach (Camera item in Configuration.Instance.Cameras)
                {
                    camCopy.Add(new Camera() { ID = item.ID, Name = item.Name, IpAddress = item.IpAddress });
                }

                frm.Cameras = camCopy;
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    Properties.Settings setting = Properties.Settings.Default;

                    Configuration.Instance.Cameras = frm.Cameras;
                    Configuration.Instance.Save();

                    setting.Save();

                    InitStatusBar();

                    this.Cameras = frm.Cameras.ToArray<Camera>();

                    var minFaceWidth = int.Parse(setting.MinFaceWidth);
                    float ratio = float.Parse(setting.MaxFaceWidth) / minFaceWidth;

                    SetupExtractor(setting.EnvMode,
                        float.Parse(setting.IconLeftExtRatio),
                        float.Parse(setting.IconRightExtRatio),
                        float.Parse(setting.IconTopExtRatio),
                        float.Parse(setting.IconBottomExtRatio),
                        minFaceWidth,
                        ratio,
                        new Rectangle(int.Parse(setting.SrchRegionLeft),
                                        int.Parse(setting.SrchRegionTop),
                                        int.Parse(setting.SrchRegionWidth),
                                        int.Parse(setting.SrchRegionHeight))
                                   );
                }
            }
        }
Esempio n. 37
0
        private void miSetup_Click(object sender, EventArgs e)
        {
            using (OptionsForm FForm = new OptionsForm()) {
                FForm.Host = Host;
                FForm.Options = FOptions;
                if (FForm.ShowDialog() == DialogResult.OK)
                    ApplyOptions();

            }
        }