/// <summary> /// Method that creates an account with the entered information and stores it into relevant files /// </summary> public void Confirm() { TempDisplayName = AccountHandler.DisplayNameAddTag(_tempDisplayName); AccountHandler.Account = new Account(_tempUsername, TempPassword, TempDisplayName); AccountHandler.CreateAccount(AccountHandler.Account, TempProfilePicturePath); AccountList.AddAccountToFile(); SetDisplayNameForUI = AccountHandler.Account.DisplayName; }
/// <summary> /// Method for setting the display name to that of the one entered in the view /// </summary> public void SetDisplayName() { _currentDisplayName = _tempDisplayName; AccountHandler.Account.DisplayName = AccountHandler.DisplayNameAddTag(_tempDisplayName); AccountHandler.ChangeDisplayNameInAccountList(AccountHandler.Account.DisplayName); AccountHandler.AccountList.AddAccountToFile(); AccountHandler.SetDisplayNameForUI = AccountHandler.Account.DisplayName; AccountHandler.MainPageVm?.CallForAccountStatus(); IsSetDisplayNameEnabled = false; //Below saves the changed display name to the <username>.json file under /AccountDetails/ AccountHandler.AccountDetail.DisplayName = AccountHandler.Account.DisplayName; AccountHandler.AccountDetail.CreateUserDetailsFile(AccountHandler.AccountDetail, AccountHandler.Account.UserName); }