Filtration/Filtration.ObjectModel/BlockItemTypes/BaseTypeBlockItem.cs

39 lines
1.3 KiB
C#
Raw Normal View History

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 BaseTypeBlockItem : StringListBlockItem
2015-06-04 13:15:54 -04:00
{
public override string PrefixText => "BaseType";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Base Type";
2015-06-04 13:15:54 -04:00
public override string SummaryText
{
get
{
if (Items.Count > 0 && Items.Count < 4)
{
return "Item Base Types: " +
Items.Aggregate(string.Empty, (current, i) => current + i + ", ").TrimEnd(' ').TrimEnd(',');
}
if (Items.Count >= 4)
{
var remaining = Items.Count - 3;
return "Item Base Types: " + Items.Take(3)
.Aggregate(string.Empty, (current, i) => current + i + ", ")
.TrimEnd(' ')
.TrimEnd(',') + " (+" + remaining + " more)";
}
return "Item Base Types: (none)";
}
}
public override Color SummaryBackgroundColor => Colors.MediumTurquoise;
public override Color SummaryTextColor => Colors.Black;
public override int SortOrder => 11;
2015-06-04 13:15:54 -04:00
}
}