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; }
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; }
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(); }
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(); }
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; }