using System; using System.Collections.Generic; using Bit.App.Resources; namespace Bit.App.Models.Page { public class VaultListPageModel { public class Login { public Login(Models.Login login) { Id = login.Id; FolderId = login.FolderId; Name = login.Name?.Decrypt(); Username = login.Username?.Decrypt() ?? " "; Password = new Lazy(() => login.Password?.Decrypt()); Uri = new Lazy(() => login.Uri?.Decrypt()); } public string Id { get; set; } public string FolderId { get; set; } public string Name { get; set; } public string Username { get; set; } public Lazy Password { get; set; } public Lazy Uri { get; set; } } public class AutofillLogin : Login { public AutofillLogin(Models.Login login, bool fuzzy = false) : base(login) { Fuzzy = fuzzy; } public bool Fuzzy { get; set; } } public class Folder : List { public Folder(Models.Folder folder) { Id = folder.Id; Name = folder.Name?.Decrypt(); } public Folder(List logins) { AddRange(logins); } public string Id { get; set; } public string Name { get; set; } = AppResources.FolderNone; } public class AutofillGrouping : List { public AutofillGrouping(List logins, string name) { AddRange(logins); Name = name; } public string Name { get; set; } } } }