private void Load() { try { string saveLocation = AppDomain.CurrentDomain.BaseDirectory + "RDCAccounts.json"; IEnumerable <UserAccount> encrypted = _fileAccess.Read <IEnumerable <UserAccount> >(saveLocation); _userAccounts = encrypted.Select(x => new UserAccount() { Id = x.Id, Name = x.Name, Username = x.Username, Password = _encryptionManager.AesDecrypt(x.Password), Domain = x.Domain }).ToList(); } catch { _userAccounts = new List <UserAccount>(); } }
private void Load() { try { string saveLocation = AppDomain.CurrentDomain.BaseDirectory + "RDCs.json"; _rdcs = _fileAccess.Read <IEnumerable <RDCModel> >(saveLocation) .Select(x => new RDC(_snackbarMessageQueue) { DisplayName = x.DisplayName, MachineName = x.MachineName, Username = x.Username, Password = _encryptionManager.AesDecrypt(x.Password), Domain = x.Domain, UserAccountId = x.UserAccountId, GroupId = x.GroupId }) .ToList(); } catch { _rdcs = new List <RDC>(); } }