Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public User CheckInputs()
- {
- if (!_hp.ValidateUsername(Username))
- {
- IsVisible = true;
- Background = "#E2EB23";
- ErrorText = "Invalid Username/Password Format. Try Again!";
- Task.Delay(3000).ContinueWith((task) =>
- {
- Dispatcher.UIThread.Invoke(() =>
- {
- Background = _userStyles.BackgroundColor;
- Username = "";
- Password = "";
- IsVisible = false;
- });
- }, TaskScheduler.FromCurrentSynchronizationContext());
- }
- if (!_hp.ValidatePassword(Password))
- {
- IsVisible = true;
- Background = "#E2EB23";
- ErrorText = "Invalid Username/Password Format. Try Again!";
- Task.Delay(3000).ContinueWith((task) =>
- {
- Dispatcher.UIThread.Invoke(() =>
- {
- Background = _userStyles.BackgroundColor;
- Username = "";
- Password = "";
- IsVisible = false;
- });
- });
- }
- if (!_db.CheckForUser(Username))
- {
- IsVisible = true;
- Background = "#E2EB23";
- ErrorText = "Invalid Username/Password. Try Again!";
- Task.Delay(3000).ContinueWith((task) =>
- {
- Dispatcher.UIThread.Invoke(() =>
- {
- Background = _userStyles.BackgroundColor;
- Username = "";
- Password = "";
- IsVisible = false;
- });
- });
- }
- if (!_db.CheckForPassword(Username, Password))
- {
- IsVisible = true;
- Background = "#E2EB23";
- ErrorText = "Invalid Username/Password. Try Again!";
- Task.Delay(3000).ContinueWith((task) =>
- {
- Dispatcher.UIThread.Invoke(() =>
- {
- Background = _userStyles.BackgroundColor;
- Username = "";
- Password = "";
- IsVisible = false;
- });
- });
- }
- User returnUser = _db.GetUser(Username);
- return returnUser;
- }
Advertisement
Add Comment
Please, Sign In to add comment