Exemplo n.º 1
0
        private void Window_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.F5)
            {
                var mainWindow = new MainWindow();

                mainWindow.Show();

                this.Close();
            }
        }
Exemplo n.º 2
0
        void updateLoginButton(bool isLogined)
        {
            if (isLogined)
            {
                this.btnLogin.Content = "已登录";

                ConfigManager.Config.Username = _username;
                ConfigManager.Config.Password = _password.Encode();

                ConfigManager.SaveConfig();

                var mainWindow = new MainWindow();

                mainWindow.Show();

                this.Close();
            }
            else
            {
                this.cmbUsername.IsReadOnly = false;
                this.txtPassword.IsEnabled = true;
                this.btnLogin.IsEnabled = true;
                this.btnLogin.Content = "登录";
                MessageBox.Show("登录失败!");
            }
        }