1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-28 06:03:40 +00:00

consolidating section header models

This commit is contained in:
Kyle Spearrin
2017-11-25 23:32:20 -05:00
parent 362ddd0339
commit 2f2d85576f
4 changed files with 48 additions and 63 deletions

View File

@@ -183,30 +183,25 @@ namespace Bit.App.Models.Page
public string Name { get; set; } = AppResources.FolderNone;
}
public class NameGroup : List<Cipher>
public class Section<T> : List<T>
{
public NameGroup(string nameGroup, List<Cipher> ciphers)
public Section(List<T> groupItems, string name, bool doUpper = true)
{
Name = nameGroup.ToUpperInvariant();
AddRange(ciphers);
AddRange(groupItems);
if(doUpper)
{
Name = name.ToUpperInvariant();
}
else
{
Name = name;
}
}
public string Name { get; set; }
}
public class Section : List<Grouping>
{
public Section(List<Grouping> groupings, string name)
{
AddRange(groupings);
Name = name.ToUpperInvariant();
ItemCount = groupings.Count;
}
public string Name { get; set; }
public int ItemCount { get; set; }
}
public class Grouping
{
public Grouping(string name, int count)
@@ -239,16 +234,5 @@ namespace Bit.App.Models.Page
public bool Folder { get; set; }
public bool Collection { get; set; }
}
public class AutofillGrouping : List<AutofillCipher>
{
public AutofillGrouping(List<AutofillCipher> logins, string name)
{
AddRange(logins);
Name = name;
}
public string Name { get; set; }
}
}
}