2015-06-04 13:15:54 -04:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Windows.Media;
|
2015-06-24 14:57:16 -04:00
|
|
|
|
using Filtration.ObjectModel.BlockItemBaseTypes;
|
2015-06-04 13:15:54 -04:00
|
|
|
|
|
2015-06-24 14:57:16 -04:00
|
|
|
|
namespace Filtration.ObjectModel.BlockItemTypes
|
2015-06-04 13:15:54 -04:00
|
|
|
|
{
|
2015-06-24 14:57:16 -04:00
|
|
|
|
public class ClassBlockItem : StringListBlockItem
|
2015-06-04 13:15:54 -04:00
|
|
|
|
{
|
2015-12-13 15:17:15 -05:00
|
|
|
|
public override string PrefixText => "Class";
|
|
|
|
|
public override int MaximumAllowed => 1;
|
|
|
|
|
public override string DisplayHeading => "Class";
|
2015-06-04 13:15:54 -04:00
|
|
|
|
|
|
|
|
|
public override string SummaryText
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (Items.Count > 0 && Items.Count < 4)
|
|
|
|
|
{
|
|
|
|
|
return "Item Classes: " +
|
|
|
|
|
Items.Aggregate(string.Empty, (current, i) => current + i + ", ").TrimEnd(' ').TrimEnd(',');
|
|
|
|
|
}
|
|
|
|
|
if (Items.Count >= 4)
|
|
|
|
|
{
|
|
|
|
|
var remaining = Items.Count - 3;
|
|
|
|
|
return "Item Classes: " + Items.Take(3)
|
|
|
|
|
.Aggregate(string.Empty, (current, i) => current + i + ", ")
|
|
|
|
|
.TrimEnd(' ')
|
|
|
|
|
.TrimEnd(',') + " (+" + remaining + " more)";
|
|
|
|
|
}
|
|
|
|
|
return "Item Classes: (none)";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-13 15:17:15 -05:00
|
|
|
|
public override Color SummaryBackgroundColor => Colors.MediumSeaGreen;
|
|
|
|
|
public override Color SummaryTextColor => Colors.White;
|
2018-08-29 13:12:02 -04:00
|
|
|
|
public override int SortOrder => 19;
|
2015-06-04 13:15:54 -04:00
|
|
|
|
}
|
|
|
|
|
}
|