Exemplo n.º 1
0
        private void mnuLoginout_Click(object sender, EventArgs e)
        {
            switch (mnuLoginout.Text)
            {
            case "&Login...":
                if (loginVisible)
                {
                    LoginForm.Focus();
                }
                else
                {
                    loginVisible = true;
                    LoginForm.Show();
                }
                break;

            case "&Logout":
                netcom.Logout();
                break;
            }
        }
Exemplo n.º 2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            switch (btnLogin.Text)
            {
            case "Login": instance.LogOffClicked = false; BeginLogin(); break;

            case "Retry":
                pnlLoginPrompt.Visible = true;
                pnlLoggingIn.Visible   = false;
                btnLogin.Text          = "Login";
                break;

            //case "Logout": this.instance.MainForm.Close(); break;
            case "Exit":
                instance.LogOffClicked = true;
                instance.LoggedIn      = false;
                pnlLoggingIn.Visible   = false;
                pnlLoginPrompt.Visible = true;
                btnLogin.Enabled       = true;

                //netcom.Logout();
                try
                {
                    if (netcom.IsLoggedIn)
                    {
                        netcom.Logout();
                    }
                }
                catch (Exception ex)
                {
                    string exp = ex.Message.ToString(CultureInfo.CurrentCulture);
                    MessageBox.Show(exp);
                }

                break;
            }
        }