/// <summary> /// 主窗体加载事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmMain_Load(object sender, EventArgs e) { InitialUserSkin(); //初始化主题 CloseAllWin(); //关闭所有子窗体 Menu_Null(); //初始化受权 if (this.LoginForm != null) { this.LoginForm = null; } try { Thread ThLogin = new Thread(doLogin); ThLogin.Start(); } catch (System.Exception ex) { clsPublic.ShowException(ex, this.Text); } finally { if (this.LoginForm != null) { this.LoginForm.Dispose(); this.LoginForm = null; } } this.MainRibbon.SelectedPage = this.pageSystem; this.SetEditPageVisible(false); }
private void doLogin() { this.Invoke((EventHandler) delegate { LoginForm = new SubForm.pageSystem.LoginForm(_appRight); if (this.LoginForm.ShowDialog() != System.Windows.Forms.DialogResult.OK) { this.pageEditor.Visible = false; this.pageSystem.Visible = true; this.MainRibbon.SelectedPage = this.pageSystem; this.LoginedIn = false; this.btnUserLogout.Caption = "用户登录"; return; } else { this.CloseAllWin(); this.btnUserLogout.Caption = "用户注销"; this.LoginedIn = true; } this.Init(); }); }