Пример #1
0
 private void addNewServerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Lib.UI.Confirm(I18N("AddNewServer")))
     {
         configer.AddNewServer();
         SetTitle(configer.GetAlias());
     }
 }
Пример #2
0
        public FormConfiger(int serverIndex = -1)
        {
            setting    = Service.Setting.Instance;
            configer   = new Controller.Configer.Configer(serverIndex);
            formSearch = null;

            InitializeComponent();

            formTitle = this.Text;
            InitComboBox();
            InitScintilla();
            InitDataBinding();
            UpdateServerMenu();
            SetTitle(configer.GetAlias());
            ToggleToolsPanel(setting.isShowConfigureToolsPanel);

            cboxConfigSection.SelectedIndex = 0;

            this.FormClosed += (s, a) =>
            {
                setting.OnSettingChange -= SettingChange;
            };

            this.Show();

            setting.OnSettingChange += SettingChange;
        }
Пример #3
0
        private void FormConfiger_Shown(object sender, EventArgs e)
        {
            InitToolsPanel();

            scintillaMain = new Scintilla();
            InitScintilla(scintillaMain, panelScintilla);
            scintillaMain.MouseClick += OnMouseLeaveToolsPanel;

            scintillaImport = new Scintilla();
            InitScintilla(scintillaImport, panelExpandConfig, true);

            configer = new Controller.Configer.Configer(
                scintillaImport,
                _serverIndex);

            InitComboBox();
            InitDataBinding();
            UpdateServerMenu();
            SetTitle(configer.GetAlias());
            ToggleToolsPanel(setting.isShowConfigureToolsPanel);

            cboxConfigSection.SelectedIndex = 0;

            this.FormClosing += (s, a) =>
            {
                a.Cancel = !Lib.UI.Confirm(I18N("ConfirmCloseWindow"));
            };

            this.FormClosed += (s, a) =>
            {
                setting.OnSettingChange -= SettingChange;
            };

            setting.OnSettingChange += SettingChange;
        }