Esempio n. 1
0
        private void FormConfiger_Load(object sender, EventArgs e)
        {
            setting.RestoreFormRect(this);

            InitToolsPanel();
            this.configer = InitConfiger();

            SetTitle(configer.GetAlias());
            ToggleToolsPanel(isShowPanel);

            chkIsV4.Checked = setting.isUseV4;

            editor = configer
                     .GetComponent <Controllers.ConfigerComponet.Editor>()
                     .GetEditor();

            editor.Click += OnMouseLeaveToolsPanel;
            BindServerEvents();

            this.FormClosing += (s, a) =>
            {
                if (!configer.IsConfigSaved())
                {
                    a.Cancel = !Misc.UI.Confirm(I18N.ConfirmCloseWinWithoutSave);
                }
            };

            this.FormClosed += (s, a) =>
            {
                formSearch?.Close();
                editor.Click -= OnMouseLeaveToolsPanel;
                toolsPanelController.Dispose();
                ReleaseServerEvents();
                configer.Cleanup();
                editor?.Dispose();
                setting.SaveFormRect(this);
                setting.LazyGC();
            };

            configer.UpdateServerMenusLater();
        }