Exemplo n.º 1
0
 private void OnAccountsChanged()
 {
     if (this.accounts.SelectedIndex >= 0x0)
     {
         string          selectedItem = (string)this.accounts.SelectedItem;
         IMContactStatus unknown      = IMContactStatus.Unknown;
         ITXBuffer       password     = null;
         if (this.accountManager.GetAccountInfo(selectedItem, out password, out unknown))
         {
             this.LoginStatus = unknown;
             if ((password != null) && (password.GetSize() > 0x0))
             {
                 this.passwordBox.Password = "******";
                 this.passwordHash         = password;
                 this.passwordType         = IMPwdType.IMPWD_PWD_SAVED;
                 this.rememberPasswordCheckBox.IsChecked = true;
                 return;
             }
             this.passwordHash = null;
             this.passwordBox.Clear();
             this.passwordType = IMPwdType.IMPWD_NONE;
             this.rememberPasswordCheckBox.IsChecked = false;
             return;
         }
     }
     this.passwordHash = null;
     this.passwordType = IMPwdType.IMPWD_NONE;
     this.passwordBox.Clear();
     this.rememberPasswordCheckBox.IsChecked = false;
 }
Exemplo n.º 2
0
 private void Enter_Click(object sender, RoutedEventArgs e)
 {
     this.LoginResult = false;
     if (e.Source == this.Enter)
     {
         if (this._IsLogging)
         {
             TXLog.TXLog3("Login", " Enter_Click 重复");
         }
         else
         {
             if (this.passwordHash == null)
             {
                 string str      = (this.accounts.SelectedIndex >= 0x0) ? (this.accounts.SelectedItem.ToString()) : this.accounts.Text;
                 string password = this.passwordBox.Password.Trim();
                 if ((str.Length == 0x0) || (password.Length == 0x0))
                 {
                     string messageBoxText = "帐号或者密码不能为空";
                     string caption        = "提示";
                     MessageBox.Show(messageBoxText, caption);
                     return;
                 }
                 this.passwordHash = CoreMessenger.CalculatePasswordHash(password);
                 this.passwordType = IMPwdType.IMPWD_HASHONE;
             }
             if (CoreMessenger.Instance.TM.IsValidAccount(this.accounts.Text))
             {
                 if (App.Messenger.Login(this.accounts.Text, this.passwordHash, this.passwordType, this.LoginStatus))
                 {
                     this._IsLogging = true;
                     this.ShowInputFrame(false);
                     e.Handled = true;
                 }
                 else
                 {
                     //Util_MessageBox.InvalidUinMsg(this, this.accounts.Text);
                 }
             }
             else
             {
                 string str5 = "请输入正确的QQ号码。";
                 string str6 = "提示";
                 MessageBox.Show(str5, str6);
                 this.accounts.Text = "";
                 this.passwordBox.Clear();
                 this.accounts.Focus();
             }
         }
     }
     else if (e.Source == this.btnCancel)
     {
         this._IsLogging = false;
         this.ShowInputFrame(true);
         App.Messenger.CancelLogin();
     }
 }
Exemplo n.º 3
0
 private void accounts_TextChanged(object sender, TextChangedEventArgs e)
 {
     if ((this.accounts.SelectedItem as string) != this.accounts.Text)
     {
         this.passwordHash = null;
         this.passwordType = IMPwdType.IMPWD_NONE;
         this.passwordBox.Clear();
         this.rememberPasswordCheckBox.IsChecked = false;
         this.LoginStatus = IMContactStatus.Available;
     }
     else
     {
         this.OnAccountsChanged();
     }
 }
Exemplo n.º 4
0
 private void accounts_TextChanged(object sender, TextChangedEventArgs e)
 {
     if ((this.accounts.SelectedItem as string) != this.accounts.Text)
     {
         this.passwordHash = null;
         this.passwordType = IMPwdType.IMPWD_NONE;
         this.passwordBox.Clear();
         this.rememberPasswordCheckBox.IsChecked = false;
         this.LoginStatus = IMContactStatus.Available;
     }
     else
     {
         this.OnAccountsChanged();
     }
 }
Exemplo n.º 5
0
 private void OnPasswordChanged(object sender, RoutedEventArgs e)
 {
     this.passwordHash = null;
     this.passwordType = IMPwdType.IMPWD_NONE;
 }
Exemplo n.º 6
0
 private void Enter_Click(object sender, RoutedEventArgs e)
 {
     this.LoginResult = false;
     if (e.Source == this.Enter)
     {
         if (this._IsLogging)
         {
             TXLog.TXLog3("Login", " Enter_Click 重复");
         }
         else
         {
             if (this.passwordHash == null)
             {
                 string str = (this.accounts.SelectedIndex >= 0x0) ? (this.accounts.SelectedItem.ToString()) : this.accounts.Text;
                 string password = this.passwordBox.Password.Trim();
                 if ((str.Length == 0x0) || (password.Length == 0x0))
                 {
                     string messageBoxText = "帐号或者密码不能为空";
                     string caption = "提示";
                     MessageBox.Show(messageBoxText, caption);
                     return;
                 }
                 this.passwordHash = CoreMessenger.CalculatePasswordHash(password);
                 this.passwordType = IMPwdType.IMPWD_HASHONE;
             }
             if (CoreMessenger.Instance.TM.IsValidAccount(this.accounts.Text))
             {
                 if (App.Messenger.Login(this.accounts.Text, this.passwordHash, this.passwordType, this.LoginStatus))
                 {
                     this._IsLogging = true;
                     this.ShowInputFrame(false);
                     e.Handled = true;
                 }
                 else
                 {
                     //Util_MessageBox.InvalidUinMsg(this, this.accounts.Text);
                 }
             }
             else
             {
                 string str5 = "请输入正确的QQ号码。";
                 string str6 = "提示";
                 MessageBox.Show(str5, str6);
                 this.accounts.Text = "";
                 this.passwordBox.Clear();
                 this.accounts.Focus();
             }
         }
     }
     else if (e.Source == this.btnCancel)
     {
         this._IsLogging = false;
         this.ShowInputFrame(true);
         App.Messenger.CancelLogin();
     }
 }
Exemplo n.º 7
0
 private void OnPasswordChanged(object sender, RoutedEventArgs e)
 {
     this.passwordHash = null;
     this.passwordType = IMPwdType.IMPWD_NONE;
 }
Exemplo n.º 8
0
 private void OnAccountsChanged()
 {
     if (this.accounts.SelectedIndex >= 0x0)
     {
         string selectedItem = (string)this.accounts.SelectedItem;
         IMContactStatus unknown = IMContactStatus.Unknown;
         ITXBuffer password = null;
         if (this.accountManager.GetAccountInfo(selectedItem, out password, out unknown))
         {
             this.LoginStatus = unknown;
             if ((password != null) && (password.GetSize() > 0x0))
             {
                 this.passwordBox.Password = "******";
                 this.passwordHash = password;
                 this.passwordType = IMPwdType.IMPWD_PWD_SAVED;
                 this.rememberPasswordCheckBox.IsChecked = true;
                 return;
             }
             this.passwordHash = null;
             this.passwordBox.Clear();
             this.passwordType = IMPwdType.IMPWD_NONE;
             this.rememberPasswordCheckBox.IsChecked = false;
             return;
         }
     }
     this.passwordHash = null;
     this.passwordType = IMPwdType.IMPWD_NONE;
     this.passwordBox.Clear();
     this.rememberPasswordCheckBox.IsChecked = false;
 }