Example #1
0
        private void pbLogin_Click(object sender, EventArgs e)
        {
            if (pnContainer.Controls.Count == 0)
            {
                form.Show();
                applicationIdle.Stop();
                applicationIdle.Dispose();
                manage = null;//单例资源释放
                this.Dispose();
            }
            else
            {
                switch (dm.FormClosing(sender, e))
                {
                case DialogResult.OK:
                    if (DialogResult.Yes == Utils.ShowMessageBox(Messages.LogOut, Messages.TitleWarning, MessageBoxButtons.YesNo))
                    {
                        SignOut();
                    }
                    break;

                case DialogResult.Cancel:
                    break;

                default:
                    SignOut();
                    break;
                }
            }
        }
Example #2
0
        static void Main()
        {
            if (_componentVersion != SoftwareVersion.VersionForAuthentication || _componentVersion != Common.Versions)
            {
                return;
            }
            Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
            //Application.Run(new TrialValidation());
            Process instance = RunningInstance();

            if (instance == null)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                if (_componentVersion != SoftwareVersions.S)
                {
                    Application.Run(new Login());
                }
                else
                {
                    Application.Run(DeviceManage.GetInstance(new Login()));
                }
                //Application.Run(new UserWizard());
            }
            else
            {
                HandleRunningInstance(instance);
            }
        }
Example #3
0
 /*单例*/
 public static DeviceManage GetInstance(Form form)
 {
     if (manage == null)
     {
         manage = new DeviceManage(form);
     }
     return(manage);
 }
Example #4
0
        private void ShowMainForm()
        {
            this.Hide();
            DeviceManage dm = DeviceManage.GetInstance(this);

            if (dm != null && !dm.IsDisposed)
            {
                dm.WindowState = FormWindowState.Maximized;
                dm.Show();
            }
        }
Example #5
0
 private void Logout()
 {
     if (form != null)
     {
         lock (form)
         {
             form.Invoke(new Action(delegate()
             {
                 form.Show();
                 applicationIdle.Stop();
                 applicationIdle.Dispose();
                 manage = null;
                 this.Dispose();
             }));
         }
     }
 }
Example #6
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (loginUI.Login())
            {
                //this.tbAccount.Focus();
                //this.tbAccount.Clear();
                this.tbPwd.Clear();
                this.lbAccount.Text = "";
                this.lbPwd.Text     = "";
                this.Visible        = false;

                DeviceManage dm = DeviceManage.GetInstance(this);
                if (dm != null && !dm.IsDisposed)
                {
                    dm.Show();
                }
            }
        }
Example #7
0
 /// <summary>
 /// 自动登出检查
 /// </summary>
 private void UserSessionChecker()
 {
     UserSession.BeginTimer(60000, delegate(object sender, EventArgs args) {
         if (!UserSession.SessionAlive)
         {
             UserSession.MinutesAlive += (int)UserSession.UserTimer.Interval / 60000;
             if (UserSession.MinutesAlive >= Common.Policy.InactivityTime)
             {
                 form.Invoke(new Action(delegate() {
                     form.Show();
                     manage = null;
                     this.Dispose();
                 }));
             }
         }
         else
         {
             UserSession.MinutesAlive = 0;
         }
         UserSession.ResetTimer();
     });
     //UserSession.Begin();
 }
Example #8
0
 private void btnLogIn_Click(object sender, EventArgs e)
 {
     form.Show();
     manage = null;//单例资源释放
     this.Dispose();
 }