Esempio n. 1
0
        //*************************************************
        // Event receivers
        //*************************************************

        // Button LoadCFG set
        private void btnHkeySetLoadCfg_Click(object sender, EventArgs e)
        {
            if (mCurrentEdit == EditMode.None)
            {
                BeginEdit(btnHkeyLoadCfg, lblHkeyLoadCfg, mHkeyLoadCfg, EditMode.LoadCfg);
            }
            else if (mCurrentEdit == EditMode.LoadCfg)
            {
                if (mHkeyLoadCfg.HotKey != Keys.None)
                {
                    frmRconLoadConfig formLoadConfig = new frmRconLoadConfig();
                    formLoadConfig.ExceptionEvent += new frmRconLoadConfig.StringHandler(LoadCfgError);

                    if (formLoadConfig.ShowDialog() == DialogResult.OK)
                    {
                        Settings.Default.HKey_LoadCFG_Config = new ConfigFile(formLoadConfig.ReturnValue);
                        Settings.Default.HKey_LoadCFG        = new HotKeyObject(mHkeyLoadCfg);
                    }
                    else
                    {
                        lblHkeyLoadCfg.Text = Settings.Default.HKey_LoadCFG.ToString();
                    }
                }
                else
                {
                    Settings.Default.HKey_LoadCFG_Config = new ConfigFile();
                    Settings.Default.HKey_LoadCFG        = new HotKeyObject();
                }
                EndEdit(btnHkeyLoadCfg);
            }
        }
Esempio n. 2
0
        // Button Load Config
        private void btnConfig_Click(object sender, EventArgs e)
        {
            frmRconLoadConfig formLoadConfig = new frmRconLoadConfig();

            formLoadConfig.ExceptionEvent += new frmRconLoadConfig.StringHandler(UpdateStatusHint);
            if (formLoadConfig.ShowDialog() == DialogResult.OK)
            {
                SourceRconTools.LoadConfigFile(formLoadConfig.ReturnValue);
            }
        }