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

            // https://alexpkent.wordpress.com/2011/05/11/25/
            ToolStripManager.LoadSettings(this);

            this.FormClosed += (s, a) =>
            {
                setting.SaveFormRect(this);
                ToolStripManager.SaveSettings(this);
                setting.OnSysProxyChanged -= OnSysProxyChangedHandler;
                formMainCtrl.Cleanup();
                servers.LazyGC();
            };

            this.Text = string.Format(
                "{0} v{1}",
                Properties.Resources.AppName,
                Properties.Resources.Version);

            formMainCtrl = InitFormMainCtrl();

            BindToolStripButtonToMenuItem();

            toolMenuItemCurrentSysProxy.Text = GetCurrentSysProxySetting();
            setting.OnSysProxyChanged       += OnSysProxyChangedHandler;
        }
Esempio n. 2
0
        private void FormMain_Shown(object sender, EventArgs e)
        {
            setting.RestoreFormRect(this);

            this.FormClosed += (s, a) =>
            {
                setting.SaveFormRect(this);
                setting.OnSysProxyChanged -= OnSysProxyChangedHandler;
                formMainCtrl.Cleanup();
                servers.LazyGC();
            };

            this.Text = string.Format(
                "{0} v{1}",
                Properties.Resources.AppName,
                Properties.Resources.Version);

            formMainCtrl = InitFormMainCtrl();

            toolMenuItemCurrentSysProxy.Text = GetCurrentSysProxySetting();
            setting.OnSysProxyChanged       += OnSysProxyChangedHandler;
        }
Esempio n. 3
0
        public void FormMain_Shown(object sender, EventArgs e)
        {
            UpdateFormTitle(this, EventArgs.Empty);
            setting.RestoreFormRect(this);

            // https://alexpkent.wordpress.com/2011/05/11/25/
            // 添加新控件的时候会有bug,不显示新控件
            // ToolStripManager.LoadSettings(this);

            this.FormClosing += (s, a) =>
            {
                if (updateTitleTimer != null)
                {
                    updateTitleTimer.Stop();
                    updateTitleTimer.Tick -= UpdateFormTitle;
                    updateTitleTimer.Dispose();
                }
            };

            this.FormClosed += (s, a) =>
            {
                setting.SaveFormRect(this);
                // ToolStripManager.SaveSettings(this);
                formMainCtrl.Cleanup();
                setting.LazyGC();
            };

            formMainCtrl = InitFormMainCtrl();
            BindToolStripButtonToMenuItem();

            updateTitleTimer = new Timer
            {
                Interval = 2000,
            };
            updateTitleTimer.Tick += UpdateFormTitle;
            updateTitleTimer.Start();
        }
Esempio n. 4
0
        private void FormMain_Shown(object sender, EventArgs e)
        {
            setting.RestoreFormRect(this);

            // https://alexpkent.wordpress.com/2011/05/11/25/
            // 添加新控件的时候会有bug,不显示新控件
            // ToolStripManager.LoadSettings(this);

            this.FormClosed += (s, a) =>
            {
                setting.SaveFormRect(this);
                // ToolStripManager.SaveSettings(this);
                formMainCtrl.Cleanup();
                setting.LazyGC();
            };

            this.Text = string.Format(
                "{0} v{1}",
                Properties.Resources.AppName,
                Properties.Resources.Version);

            formMainCtrl = InitFormMainCtrl();
            BindToolStripButtonToMenuItem();
        }
Esempio n. 5
0
        private void FormMain_Shown(object sender, EventArgs e)
        {
            setting.RestoreFormRect(this, nameof(FormMain));

            this.FormClosed += (s, a) =>
            {
                setting.SaveFormRect(this, nameof(FormMain));
                setting.OnSysProxyChanged -= OnSysProxyChangedHandler;
                formMainCtrl.Cleanup();
                setting.LazyGC();
            };

            // Lib.UI.SetFormLocation<FormMain>(this, Model.Data.Enum.FormLocations.TopLeft);

            this.Text = string.Format(
                "{0} v{1}",
                Properties.Resources.AppName,
                Properties.Resources.Version);

            formMainCtrl = InitFormMainCtrl();

            toolMenuItemCurrentSysProxy.Text = GetCurrentSysProxySetting();
            setting.OnSysProxyChanged       += OnSysProxyChangedHandler;
        }