Example #1
0
        private void LearnWord(String word)
        {
            word = word.ToLower();
            bool succeed = HttpClientWrapper.LearnWord(word);

            if (succeed)
            {
                Common.AddKnownWord(word);
            }
            else
            {
                Common.AddIgnoreWords(word);
            }
        }
Example #2
0
        private void loginButton_Click(object sender, RoutedEventArgs e)
        {
            String account  = this.textBoxAccount.Text;
            String password = this.passwordBox.Password;


            bool loginSucceed = false;

            if (Common.appSettings.RememberPassword)
            {
                loginSucceed = HttpClientWrapper.LoginByToken();
                if (!loginSucceed)
                {
                    labelHint.Content = "账号/密码错误,登录失败";
                    Common.appSettings.EnouAccountToken = String.Empty;
                    this.passwordBox.Password           = String.Empty;
                }
            }
            else
            {
                loginSucceed = HttpClientWrapper.LoginByPwd(account, password);
            }


            if (loginSucceed)
            {
                Common.appSettings.EnouAccount = account;
                var mainWindow       = new MainWindow();
                var modifyWordWindow = new LearnWordWindow();
                mainWindow.Show();
                this.Close();


                Common.LoadIgnoreWords();
            }
        }
Example #3
0
 private void BlurWindow_Loaded(object sender, RoutedEventArgs e)
 {
     HttpClientWrapper.GetKnownWords(0, 100);
 }