Esempio n. 1
0
        public string GetField(ItemSorting sorting, out bool descending)
        {
            if (sorting.HasFlag(ItemSorting.Descending))
            {
                descending = true;
                sorting    = sorting & ~ItemSorting.Descending;
            }
            else
            {
                descending = false;
            }
            switch (sorting)
            {
            case ItemSorting.Name: return(Name);

            case ItemSorting.Category: return(category.ToString());

            case ItemSorting.Priority: return(priority.ToString());   /*High Medium Low*/

            case ItemSorting.DateAdded: return(Date_Added.ToShortDateString());

            case ItemSorting.DatePurchased: return(Date_Purchased.ToShortDateString());

            default: throw new Exception($"Unknown Sorting: {sorting}");
            }
        }
Esempio n. 2
0
 public ItemSorter(ItemSorting sorting)
 {
     Descending = sorting.HasFlag(ItemSorting.Descending);
     Sorting    = sorting & ~ItemSorting.Descending;
 }