public ConfirmPasswordWindow(UserInfoModel user, SettingsWindow settingsWindow) { InitializeComponent(); signIn = new SignInMethods(); _settingsWindow = settingsWindow; _user = user; }
public bool TrySignInAccount(SignInMethods signInMethod, string username, string password) { if (!string.IsNullOrEmpty(username)) { foreach (Account Account in Accounts) { if (Account.Username == username) { if (signInMethod == SignInMethods.None || signInMethod == Account.SignInMethod) { if ((Account.SignInMethod == SignInMethods.NameOnly && string.IsNullOrEmpty(password)) || (Account.SignInMethod == SignInMethods.NameAndPassword && password == Account.Password)) { SignedInAccount = Account; IsPasswordInvalidError = false; return(true); } } break; } } } return(false); }
public Account(string email, SignInMethods signInMethod, string username, string password) { Email = email; SignInMethod = signInMethod; Username = username; Password = (signInMethod == SignInMethods.NameAndPassword ? password : null); KeepActiveIndex = -1; }
private void On_SignInWithMethod(SignInMethods signInMethod, PageNames pageName, out PageNames destinationPageName) { string TempPassword = Password; Password = null; NotifyPropertyChanged(nameof(Password)); if (((AccountManager)GetAccountManager).TrySignInAccount(signInMethod, Name, TempPassword)) { CompleteSignIn(pageName, out destinationPageName); } else { FailSignIn(out destinationPageName); } }
public SignInError TryAddAccount(string email, SignInMethods method, string username, string password, out Account account) { if (string.IsNullOrEmpty(email) || !(method == SignInMethods.NameOnly || method == SignInMethods.NameAndPassword) || string.IsNullOrEmpty(username) || (method == SignInMethods.NameAndPassword && string.IsNullOrEmpty(password))) { account = null; return(SignInError.InternalError); } foreach (Account Account in Accounts) { if (Account.Username == username) { account = null; return(SignInError.NameAlreadyInUse); } } account = new Account(email, method, username, password); Accounts.Add(account); return(SignInError.None); }
public SignInWindow() { InitializeComponent(); signInMethods = new SignInMethods(); }