Add temporary block type for new type

This commit is contained in:
azakhi
2018-08-21 17:03:42 +03:00
parent 780081263c
commit c0e9c534de
20 changed files with 250 additions and 5 deletions

View File

@@ -0,0 +1,35 @@
using System.Windows.Media;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class StringBlockItem : BlockItemBase, IAudioVisualBlockItem
{
private string _value;
protected StringBlockItem()
{
}
protected StringBlockItem(string value)
{
Value = value;
}
public override string OutputText => PrefixText + " " + Value;
public override string SummaryText => string.Empty;
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public string Value
{
get { return _value; }
set
{
_value = value;
IsDirty = true;
OnPropertyChanged();
}
}
}
}

View File

@@ -0,0 +1,21 @@
using Filtration.ObjectModel.BlockItemBaseTypes;
namespace Filtration.ObjectModel.BlockItemTypes
{
public class IconBlockItem : StringBlockItem
{
public IconBlockItem()
{
Value = "Icon1";
}
public IconBlockItem(string value) : base(value)
{
}
public override string PrefixText => "Icon";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Drop Icon";
public override int SortOrder => 28;
}
}

View File

@@ -53,6 +53,7 @@
<Compile Include="BlockItemBaseTypes\BooleanBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\ColorBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\DualIntegerBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\StringBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\StringIntBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\IntegerBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\NumericFilterPredicateBlockItem.cs" />
@@ -65,6 +66,7 @@
<Compile Include="BlockItemTypes\ElderMapBlockItem.cs" />
<Compile Include="BlockItemTypes\GemLevelBlockItem.cs" />
<Compile Include="BlockItemTypes\HasExplicitModBlockItem.cs" />
<Compile Include="BlockItemTypes\IconBlockItem.cs" />
<Compile Include="BlockItemTypes\ShapedMapBlockItem.cs" />
<Compile Include="BlockItemTypes\ShaperItemBlockItem.cs" />
<Compile Include="BlockItemTypes\ElderItemBlockItem.cs" />

View File

@@ -23,6 +23,7 @@ namespace Filtration.ObjectModel
Color DisplayTextColor { get; }
Color DisplayBorderColor { get; }
double DisplayFontSize { get; }
string DisplayIcon { get; }
bool HasBlockItemOfType<T>();
bool HasBlockGroupInParentHierarchy(ItemFilterBlockGroup targetBlockGroup, ItemFilterBlockGroup startingBlockGroup);
}
@@ -260,5 +261,14 @@ namespace Filtration.ObjectModel
return fontSizeBlockItem?.Value ?? 34;
}
}
public string DisplayIcon
{
get
{
var displayIcon = BlockItems.OfType<IconBlockItem>().FirstOrDefault();
return (displayIcon != null) ? displayIcon.Value : "";
}
}
}
}