private void OnLAuthStatusChanged(object sender, EventArgs e)
        {
            AuthStatusChangedEventArgs ea;

            if (e.Equals(EventArgs.Empty))
            {
                ea = new AuthStatusChangedEventArgs(AuthStatusType.AS_NONE);
            }
            else
            {
                ea = (AuthStatusChangedEventArgs)e;
            }

            switch (ea.AuthStatus)
            {
                case AuthStatusType.AS_NONE:
                    btnLConnect.Enabled = true;
                    btnLAuth.Enabled = false;
                    tbLVerifier.ReadOnly = true;
                    tbLAuthStatus.Text = "None";
                    break;
                case AuthStatusType.AS_REQRCV:
                    btnLConnect.Enabled = true;
                    btnLAuth.Enabled = true;
                    tbLVerifier.ReadOnly = false;
                    tbLAuthStatus.Text = "Req-rcv";
                    break;
                case AuthStatusType.AS_OK:
                    btnLConnect.Enabled = false;
                    btnLAuth.Enabled = false;
                    tbLVerifier.ReadOnly = true;
                    tbLAuthStatus.Text = "Authorized";
                    break;
            }
        }
Пример #2
0
 private void ChangeAuthStatus(AuthStatusType t)
 {
     if (_authStatus != t)
     {
         _authStatus = t;
         if (AuthStatusChanged != null)
         {
             AuthStatusChangedEventArgs a = new AuthStatusChangedEventArgs(t);
             AuthStatusChanged(this, a);
         }
     }
 }