Moved Object Model to separate project
This commit is contained in:
@@ -1,15 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using AutoMapper;
|
||||
using Castle.MicroKernel.ModelBuilder.Inspectors;
|
||||
using Castle.Windsor;
|
||||
using Castle.Windsor.Installer;
|
||||
using Filtration.Models;
|
||||
using Filtration.Utilities;
|
||||
using Filtration.ViewModels;
|
||||
using Filtration.Views;
|
||||
|
||||
namespace Filtration
|
||||
@@ -31,65 +24,10 @@ namespace Filtration
|
||||
|
||||
_container.Install(FromAssembly.This());
|
||||
|
||||
|
||||
// TODO: Find out how to parameterise this to map differently depending if ShowAdvanced is true or false.
|
||||
//Mapper.CreateMap<ItemFilterBlockGroup, ItemFilterBlockGroupViewModel>()
|
||||
// .ForMember(dest => dest.IsChecked,
|
||||
// opts => opts.MapFrom(from => from.IsChecked))
|
||||
// .ForMember(dest => dest.SourceBlockGroup,
|
||||
// opts => opts.MapFrom(from => from));
|
||||
|
||||
//Mapper.CreateMap<ItemFilterBlockGroup, ItemFilterBlockGroupViewModel>()
|
||||
// .ForMember(dest => dest.IsChecked,
|
||||
// opts => opts.MapFrom(from => from.IsChecked))
|
||||
// .ForMember(dest => dest.ChildGroups,
|
||||
// opts => opts.ResolveUsing<ChildGroupsResolver>())
|
||||
// .ForMember(dest => dest.SourceBlockGroup,
|
||||
// opts => opts.MapFrom(from => from));
|
||||
|
||||
//.ForMember(dest => dest.ChildGroups,
|
||||
// opts => opts.Condition(src => src.Advanced == false))
|
||||
|
||||
//opts => opts.ResolveUsing<ItemFilterBlockGroupChildGroupsResolver>())
|
||||
|
||||
//opts => opts.MapFrom(from => from.ChildGroups))
|
||||
|
||||
//Mapper.AssertConfigurationIsValid();
|
||||
|
||||
var mainWindow = _container.Resolve<IMainWindow>();
|
||||
mainWindow.Show();
|
||||
}
|
||||
|
||||
|
||||
//private class ChildGroupsResolver : ValueResolver<ItemFilterBlockGroup, ItemFilterBlockGroupViewModel>
|
||||
//{
|
||||
// protected override ItemFilterBlockGroupViewModel ResolveCore(ItemFilterBlockGroup source)
|
||||
// {
|
||||
// return !source.Advanced ? Mapper.Map<ItemFilterBlockGroup, ItemFilterBlockGroupViewModel>(source) : null;
|
||||
// }
|
||||
//}
|
||||
|
||||
//private class ChildGroupsResolver :
|
||||
// ValueResolver<List<ItemFilterBlockGroup>, ObservableCollection<ItemFilterBlockGroupViewModel>>
|
||||
//{
|
||||
// protected override ObservableCollection<ItemFilterBlockGroupViewModel> ResolveCore(List<ItemFilterBlockGroup> source)
|
||||
// {
|
||||
// var result = new ObservableCollection<ItemFilterBlockGroupViewModel>();
|
||||
|
||||
// if (source != null && source.Count > 0)
|
||||
// {
|
||||
|
||||
// var filteredSource = source.Where(g => g.Advanced == false);
|
||||
// foreach (var blockGroup in filteredSource)
|
||||
// {
|
||||
// result.Add(Mapper.Map<ItemFilterBlockGroup, ItemFilterBlockGroupViewModel>(blockGroup));
|
||||
// }
|
||||
// }
|
||||
|
||||
// return result;
|
||||
// }
|
||||
//}
|
||||
|
||||
protected override void OnExit(ExitEventArgs e)
|
||||
{
|
||||
_container.Dispose();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using Filtration.Models;
|
||||
using Filtration.ObjectModel;
|
||||
|
||||
namespace Filtration.Converters
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using Filtration.Enums;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.Converters
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using Filtration.Enums;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.Converters
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using Filtration.Enums;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.Converters
|
||||
{
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Filtration.Enums
|
||||
{
|
||||
internal enum BlockAction
|
||||
{
|
||||
[Description("Show")]
|
||||
Show,
|
||||
[Description("Hide")]
|
||||
Hide
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
namespace Filtration.Enums
|
||||
{
|
||||
internal enum BlockItemType
|
||||
{
|
||||
ItemLevel,
|
||||
DropLevel,
|
||||
Quality,
|
||||
Rarity,
|
||||
Class,
|
||||
BaseType,
|
||||
Sockets,
|
||||
LinkedSockets,
|
||||
SocketGroup,
|
||||
Width,
|
||||
Height,
|
||||
TextColor,
|
||||
BackgroundColor,
|
||||
BorderColor,
|
||||
Sound,
|
||||
FontSize
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Filtration.Enums
|
||||
{
|
||||
internal enum FilterPredicateOperator
|
||||
{
|
||||
[Description("=")]
|
||||
Equal,
|
||||
[Description("!=")]
|
||||
NotEqual,
|
||||
[Description("<")]
|
||||
LessThan,
|
||||
[Description("<=")]
|
||||
LessThanOrEqual,
|
||||
[Description(">")]
|
||||
GreaterThan,
|
||||
[Description(">=")]
|
||||
GreaterThanOrEqual
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Filtration.Enums
|
||||
{
|
||||
internal enum FilterType
|
||||
{
|
||||
[Description("Show")]
|
||||
Show,
|
||||
[Description("Hide")]
|
||||
Hide
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Filtration.Enums
|
||||
{
|
||||
internal enum ItemRarity
|
||||
{
|
||||
[Description("Normal")]
|
||||
Normal,
|
||||
[Description("Magic")]
|
||||
Magic,
|
||||
[Description("Rare")]
|
||||
Rare,
|
||||
[Description("Unique")]
|
||||
Unique
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Filtration.Enums
|
||||
{
|
||||
internal enum SocketColor
|
||||
{
|
||||
[Description("R")]
|
||||
Red,
|
||||
[Description("G")]
|
||||
Green,
|
||||
[Description("B")]
|
||||
Blue,
|
||||
[Description("W")]
|
||||
White
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Filtration.Extensions
|
||||
{
|
||||
internal static class EnumHelper
|
||||
{
|
||||
public static T GetAttributeOfType<T>(this Enum enumVal) where T : Attribute
|
||||
{
|
||||
var type = enumVal.GetType();
|
||||
var memInfo = type.GetMember(enumVal.ToString());
|
||||
var attributes = memInfo[0].GetCustomAttributes(typeof(T), false);
|
||||
return (attributes.Length > 0) ? (T)attributes[0] : null;
|
||||
}
|
||||
|
||||
public static string GetAttributeDescription(this Enum enumValue)
|
||||
{
|
||||
var attribute = enumValue.GetAttributeOfType<DescriptionAttribute>();
|
||||
|
||||
return attribute == null ? String.Empty : attribute.Description;
|
||||
}
|
||||
|
||||
public static T GetEnumValueFromDescription<T>(string description)
|
||||
{
|
||||
var fis = typeof(T).GetFields();
|
||||
|
||||
foreach (var fi in fis)
|
||||
{
|
||||
DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);
|
||||
|
||||
if (attributes.Length > 0 && attributes[0].Description == description)
|
||||
return (T)Enum.Parse(typeof(T), fi.Name);
|
||||
}
|
||||
|
||||
throw new Exception("Not found");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,46 +114,8 @@
|
||||
<Compile Include="Converters\ItemRarityConverter.cs" />
|
||||
<Compile Include="Converters\BooleanVisibilityConverter.cs" />
|
||||
<Compile Include="Converters\StringToVisibilityConverter.cs" />
|
||||
<Compile Include="Enums\BlockAction.cs" />
|
||||
<Compile Include="Enums\BlockItemType.cs" />
|
||||
<Compile Include="Enums\FilterPredicateOperator.cs" />
|
||||
<Compile Include="Enums\FilterType.cs" />
|
||||
<Compile Include="Enums\ItemRarity.cs" />
|
||||
<Compile Include="Enums\SocketColor.cs" />
|
||||
<Compile Include="Extensions\EnumerationExtension.cs" />
|
||||
<Compile Include="Extensions\EnumHelper.cs" />
|
||||
<Compile Include="Extensions\HyperlinkExtensions.cs" />
|
||||
<Compile Include="Models\BlockItemBaseTypes\ActionBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemBaseTypes\BlockItemBase.cs" />
|
||||
<Compile Include="Models\BlockItemBaseTypes\ColorBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemBaseTypes\DualIntegerBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemBaseTypes\IntegerBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemBaseTypes\NumericFilterPredicateBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemBaseTypes\StringListBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\FontSizeBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\SoundBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\BorderColorBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\BaseTypeBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\BackgroundColorBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\TextColorBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\ClassBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\HeightBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\WidthBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\SocketGroupBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\LinkedSocketsBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\SocketsBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\DropLevelBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\RarityBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\QualityBlockItem.cs" />
|
||||
<Compile Include="Models\BlockItemTypes\ItemLevelBlockItem.cs" />
|
||||
<Compile Include="Models\IAudioVisualBlockItem.cs" />
|
||||
<Compile Include="Models\ItemFilterBlockGroup.cs" />
|
||||
<Compile Include="Models\ItemFilterBlock.cs" />
|
||||
<Compile Include="Models\IItemFilterBlockItem.cs" />
|
||||
<Compile Include="Models\ItemFilterScript.cs" />
|
||||
<Compile Include="Models\ItemFilterSection.cs" />
|
||||
<Compile Include="Models\NumericFilterPredicate.cs" />
|
||||
<Compile Include="Models\ReplaceColorsParameterSet.cs" />
|
||||
<Compile Include="Properties\Annotations.cs" />
|
||||
<Compile Include="Repositories\ItemFilterScriptRepository.cs" />
|
||||
<Compile Include="Services\FileSystemService.cs" />
|
||||
@@ -431,6 +393,15 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
|
||||
<Project>{4aac3beb-1dc1-483e-9d11-0e9334e80227}</Project>
|
||||
<Name>Filtration.ObjectModel</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(XamlSpyInstallPath)MSBuild\FirstFloor.XamlSpy.WPF.targets" Condition="'$(XamlSpyInstallPath)' != '' and '$(Configuration)' == 'DEBUG'" />
|
||||
<Import Project="..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets" Condition="Exists('..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets')" />
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Extensions;
|
||||
|
||||
namespace Filtration.Models.BlockItemBaseTypes
|
||||
{
|
||||
internal class ActionBlockItem : BlockItemBase
|
||||
{
|
||||
private BlockAction _action;
|
||||
|
||||
public ActionBlockItem(BlockAction action)
|
||||
{
|
||||
Action = action;
|
||||
}
|
||||
|
||||
public BlockAction Action
|
||||
{
|
||||
get { return _action; }
|
||||
set
|
||||
{
|
||||
_action = value;
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged("SummaryText");
|
||||
OnPropertyChanged("SummaryBackgroundColor");
|
||||
OnPropertyChanged("SummaryTextColor");
|
||||
}
|
||||
}
|
||||
|
||||
public override string OutputText
|
||||
{
|
||||
get { return Action.GetAttributeDescription(); }
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return string.Empty; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Action";
|
||||
}
|
||||
}
|
||||
|
||||
public override string SummaryText
|
||||
{
|
||||
get
|
||||
{
|
||||
return Action == BlockAction.Show ? "Show" : "Hide";
|
||||
}
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return Action == BlockAction.Show ? Colors.LimeGreen : Colors.OrangeRed;
|
||||
}
|
||||
}
|
||||
|
||||
public override Color SummaryTextColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return Action == BlockAction.Show ? Colors.Black : Colors.White;
|
||||
}
|
||||
}
|
||||
|
||||
public override int SortOrder { get { return 0; } }
|
||||
|
||||
public void ToggleAction()
|
||||
{
|
||||
Action = Action == BlockAction.Show ? BlockAction.Hide : BlockAction.Show;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows.Media;
|
||||
using Filtration.Annotations;
|
||||
|
||||
namespace Filtration.Models.BlockItemBaseTypes
|
||||
{
|
||||
abstract class BlockItemBase : IItemFilterBlockItem
|
||||
{
|
||||
public abstract string PrefixText { get; }
|
||||
public abstract string OutputText { get; }
|
||||
public abstract int MaximumAllowed { get; }
|
||||
public abstract string DisplayHeading { get; }
|
||||
public abstract string SummaryText { get; }
|
||||
public abstract Color SummaryBackgroundColor { get; }
|
||||
public abstract Color SummaryTextColor { get; }
|
||||
public abstract int SortOrder { get; }
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
var handler = PropertyChanged;
|
||||
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Filtration.Models.BlockItemBaseTypes
|
||||
{
|
||||
internal abstract class ColorBlockItem : BlockItemBase, IAudioVisualBlockItem
|
||||
{
|
||||
private Color _color;
|
||||
|
||||
protected ColorBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
protected ColorBlockItem(Color color)
|
||||
{
|
||||
Color = color;
|
||||
}
|
||||
|
||||
public override string OutputText
|
||||
{
|
||||
get
|
||||
{
|
||||
return PrefixText + " " + +Color.R + " " + Color.G + " "
|
||||
+ Color.B + (Color.A < 255 ? " " + Color.A : string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public override string SummaryText
|
||||
{
|
||||
get { return string.Empty; }
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor { get { return Colors.Transparent; } }
|
||||
public override Color SummaryTextColor { get { return Colors.Transparent; } }
|
||||
|
||||
public Color Color
|
||||
{
|
||||
get { return _color; }
|
||||
set
|
||||
{
|
||||
_color = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Filtration.Models.BlockItemBaseTypes
|
||||
{
|
||||
internal abstract class DualIntegerBlockItem : BlockItemBase, IAudioVisualBlockItem
|
||||
{
|
||||
private int _value;
|
||||
private int _secondValue;
|
||||
|
||||
protected DualIntegerBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
protected DualIntegerBlockItem(int value, int secondValue)
|
||||
{
|
||||
Value = value;
|
||||
SecondValue = secondValue;
|
||||
}
|
||||
|
||||
public override string OutputText
|
||||
{
|
||||
get { return PrefixText + " " + Value + " " + SecondValue; }
|
||||
}
|
||||
|
||||
public override string SummaryText { get { return string.Empty; } }
|
||||
public override Color SummaryBackgroundColor { get { return Colors.Transparent; } }
|
||||
public override Color SummaryTextColor { get { return Colors.Transparent; } }
|
||||
|
||||
public int Value
|
||||
{
|
||||
get { return _value; }
|
||||
set
|
||||
{
|
||||
_value = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int SecondValue
|
||||
{
|
||||
get { return _secondValue; }
|
||||
set
|
||||
{
|
||||
_secondValue = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Filtration.Models.BlockItemBaseTypes
|
||||
{
|
||||
internal abstract class IntegerBlockItem : BlockItemBase, IAudioVisualBlockItem
|
||||
{
|
||||
private int _value;
|
||||
|
||||
protected IntegerBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
protected IntegerBlockItem(int value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public override string OutputText
|
||||
{
|
||||
get { return PrefixText + " " + Value; }
|
||||
}
|
||||
|
||||
public override string SummaryText { get { return string.Empty; } }
|
||||
public override Color SummaryBackgroundColor { get { return Colors.Transparent; } }
|
||||
public override Color SummaryTextColor { get { return Colors.Transparent; } }
|
||||
|
||||
public abstract int Minimum { get; }
|
||||
public abstract int Maximum { get; }
|
||||
|
||||
public int Value
|
||||
{
|
||||
get { return _value; }
|
||||
set
|
||||
{
|
||||
_value = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
using System;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Extensions;
|
||||
|
||||
namespace Filtration.Models.BlockItemBaseTypes
|
||||
{
|
||||
internal abstract class NumericFilterPredicateBlockItem : BlockItemBase
|
||||
{
|
||||
private NumericFilterPredicate _filterPredicate;
|
||||
|
||||
protected NumericFilterPredicateBlockItem()
|
||||
{
|
||||
FilterPredicate = new NumericFilterPredicate();
|
||||
FilterPredicate.PropertyChanged += OnFilterPredicateChanged;
|
||||
}
|
||||
|
||||
protected NumericFilterPredicateBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand)
|
||||
{
|
||||
FilterPredicate = new NumericFilterPredicate(predicateOperator, predicateOperand);
|
||||
FilterPredicate.PropertyChanged += OnFilterPredicateChanged;
|
||||
}
|
||||
|
||||
public override string OutputText
|
||||
{
|
||||
get
|
||||
{
|
||||
return PrefixText + " " + FilterPredicate.PredicateOperator.GetAttributeDescription() +
|
||||
" " + FilterPredicate.PredicateOperand;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract int Minimum { get; }
|
||||
public abstract int Maximum { get; }
|
||||
|
||||
public NumericFilterPredicate FilterPredicate
|
||||
{
|
||||
get { return _filterPredicate; }
|
||||
protected set
|
||||
{
|
||||
_filterPredicate = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnFilterPredicateChanged(object sender, EventArgs e)
|
||||
{
|
||||
OnPropertyChanged("FilterPredicate");
|
||||
OnPropertyChanged("SummaryText");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
|
||||
namespace Filtration.Models.BlockItemBaseTypes
|
||||
{
|
||||
internal abstract class StringListBlockItem : BlockItemBase
|
||||
{
|
||||
protected StringListBlockItem()
|
||||
{
|
||||
Items = new ObservableCollection<string>();
|
||||
Items.CollectionChanged += OnItemsCollectionChanged;
|
||||
}
|
||||
|
||||
public override string OutputText
|
||||
{
|
||||
get
|
||||
{
|
||||
var enumerable = Items as IList<string> ?? Items.ToList();
|
||||
if (enumerable.Count > 0)
|
||||
{
|
||||
return PrefixText + " " +
|
||||
string.Format("\"{0}\"",
|
||||
string.Join("\" \"", enumerable.ToArray()));
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<string> Items { get; protected set; }
|
||||
|
||||
private void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged("Items");
|
||||
OnPropertyChanged("SummaryText");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class BackgroundColorBlockItem : ColorBlockItem
|
||||
{
|
||||
public BackgroundColorBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public BackgroundColorBlockItem(Color color) : base(color)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "SetBackgroundColor"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Background Color";
|
||||
}
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 13; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class BaseTypeBlockItem : StringListBlockItem
|
||||
{
|
||||
public override string PrefixText { get { return "BaseType"; } }
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Base Type";
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
get { return Colors.MediumTurquoise; }
|
||||
}
|
||||
|
||||
public override Color SummaryTextColor
|
||||
{
|
||||
get { return Colors.Black; }
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 11; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class BorderColorBlockItem : ColorBlockItem
|
||||
{
|
||||
public BorderColorBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public BorderColorBlockItem(Color color) : base(color)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "SetBorderColor"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Border Color";
|
||||
}
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 14; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class ClassBlockItem : StringListBlockItem
|
||||
{
|
||||
public override string PrefixText { get { return "Class"; } }
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading { get { return "Class"; } }
|
||||
|
||||
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)";
|
||||
}
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor
|
||||
{
|
||||
get { return Colors.MediumSeaGreen; }
|
||||
}
|
||||
|
||||
public override Color SummaryTextColor
|
||||
{
|
||||
get { return Colors.White; }
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 10; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class DropLevelBlockItem : NumericFilterPredicateBlockItem
|
||||
{
|
||||
public DropLevelBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public DropLevelBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand)
|
||||
: base(predicateOperator, predicateOperand)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "DropLevel"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 2; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Drop Level";
|
||||
}
|
||||
}
|
||||
|
||||
public override string SummaryText
|
||||
{
|
||||
get { return "Drop Level " + FilterPredicate; }
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor
|
||||
{
|
||||
get { return Colors.DodgerBlue; }
|
||||
}
|
||||
|
||||
public override Color SummaryTextColor
|
||||
{
|
||||
get { return Colors.White; }
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 2; }
|
||||
}
|
||||
|
||||
public override int Minimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override int Maximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class FontSizeBlockItem : IntegerBlockItem
|
||||
{
|
||||
public FontSizeBlockItem()
|
||||
{
|
||||
Value = 35;
|
||||
}
|
||||
|
||||
public FontSizeBlockItem(int value) : base(value)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "SetFontSize"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Font Size";
|
||||
}
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 15; }
|
||||
}
|
||||
|
||||
public override int Minimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
}
|
||||
|
||||
public override int Maximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 45;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class HeightBlockItem : NumericFilterPredicateBlockItem
|
||||
{
|
||||
public HeightBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public HeightBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand)
|
||||
: base(predicateOperator, predicateOperand)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "Height"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 2; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get { return "Height"; }
|
||||
}
|
||||
|
||||
public override string SummaryText
|
||||
{
|
||||
get { return "Height " + FilterPredicate; }
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor
|
||||
{
|
||||
get { return Colors.LightBlue; }
|
||||
}
|
||||
|
||||
public override Color SummaryTextColor
|
||||
{
|
||||
get { return Colors.Black; }
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 8; }
|
||||
}
|
||||
|
||||
public override int Minimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override int Maximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class ItemLevelBlockItem : NumericFilterPredicateBlockItem
|
||||
{
|
||||
public ItemLevelBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public ItemLevelBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand) : base (predicateOperator, predicateOperand)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "ItemLevel"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 2; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Item Level";
|
||||
}
|
||||
}
|
||||
|
||||
public override string SummaryText
|
||||
{
|
||||
get { return "Item Level " + FilterPredicate; }
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor
|
||||
{
|
||||
get { return Colors.DarkSlateGray; }
|
||||
}
|
||||
|
||||
public override Color SummaryTextColor
|
||||
{
|
||||
get { return Colors.White; }
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public override int Minimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override int Maximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class LinkedSocketsBlockItem : NumericFilterPredicateBlockItem
|
||||
{
|
||||
public LinkedSocketsBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public LinkedSocketsBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand)
|
||||
: base(predicateOperator, predicateOperand)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "LinkedSockets"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 2; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Linked Sockets";
|
||||
}
|
||||
}
|
||||
|
||||
public override string SummaryText
|
||||
{
|
||||
get { return "Linked Sockets " + FilterPredicate; }
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor
|
||||
{
|
||||
get { return Colors.Gold; }
|
||||
}
|
||||
|
||||
public override Color SummaryTextColor
|
||||
{
|
||||
get { return Colors.Black; }
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 6; }
|
||||
}
|
||||
|
||||
public override int Minimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override int Maximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class QualityBlockItem : NumericFilterPredicateBlockItem
|
||||
{
|
||||
public QualityBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public QualityBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand)
|
||||
: base(predicateOperator, predicateOperand)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "Quality"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 2; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Quality";
|
||||
}
|
||||
}
|
||||
|
||||
public override string SummaryText
|
||||
{
|
||||
get { return "Quality " + FilterPredicate; }
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor
|
||||
{
|
||||
get { return Colors.DarkOrange; }
|
||||
}
|
||||
|
||||
public override Color SummaryTextColor
|
||||
{
|
||||
get { return Colors.White; }
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 3; }
|
||||
}
|
||||
|
||||
public override int Minimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override int Maximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Extensions;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class RarityBlockItem : NumericFilterPredicateBlockItem
|
||||
{
|
||||
public RarityBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public RarityBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand)
|
||||
: base(predicateOperator, predicateOperand)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "Rarity"; }
|
||||
}
|
||||
|
||||
public override string OutputText
|
||||
{
|
||||
get
|
||||
{
|
||||
return PrefixText + " " + FilterPredicate.PredicateOperator
|
||||
.GetAttributeDescription() +
|
||||
" " +
|
||||
((ItemRarity) FilterPredicate.PredicateOperand)
|
||||
.GetAttributeDescription();
|
||||
}
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 2; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Item Rarity";
|
||||
}
|
||||
}
|
||||
|
||||
public override string SummaryText
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Rarity " + FilterPredicate.PredicateOperator.GetAttributeDescription() + " " +
|
||||
((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
|
||||
}
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor
|
||||
{
|
||||
get { return Colors.LightCoral; }
|
||||
}
|
||||
|
||||
public override Color SummaryTextColor
|
||||
{
|
||||
get { return Colors.White; }
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 4; }
|
||||
}
|
||||
|
||||
public override int Minimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override int Maximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)ItemRarity.Unique;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class SocketGroupBlockItem : StringListBlockItem
|
||||
{
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "SocketGroup"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Socket Group";
|
||||
}
|
||||
}
|
||||
|
||||
public override string SummaryText
|
||||
{
|
||||
get
|
||||
{
|
||||
var summaryItemText = " " + Items.Aggregate(string.Empty, (current, i) => current + " " + i);
|
||||
return "Socket Group " + summaryItemText.TrimStart(' ');
|
||||
}
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor
|
||||
{
|
||||
get { return Colors.GhostWhite; }
|
||||
}
|
||||
|
||||
public override Color SummaryTextColor
|
||||
{
|
||||
get { return Colors.Black; }
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 9; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class SocketsBlockItem : NumericFilterPredicateBlockItem
|
||||
{
|
||||
public SocketsBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public SocketsBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand)
|
||||
: base(predicateOperator, predicateOperand)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "Sockets"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 2; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Sockets";
|
||||
}
|
||||
}
|
||||
|
||||
public override string SummaryText
|
||||
{
|
||||
get { return "Sockets " + FilterPredicate; }
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor
|
||||
{
|
||||
get { return Colors.LightGray; }
|
||||
}
|
||||
|
||||
public override Color SummaryTextColor
|
||||
{
|
||||
get { return Colors.Black; }
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 5; }
|
||||
}
|
||||
|
||||
public override int Minimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override int Maximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class SoundBlockItem : DualIntegerBlockItem
|
||||
{
|
||||
public SoundBlockItem()
|
||||
{
|
||||
Value = 1;
|
||||
SecondValue = 79;
|
||||
}
|
||||
|
||||
public SoundBlockItem(int value, int secondValue) : base(value, secondValue)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "PlayAlertSound"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Play Alert Sound";
|
||||
}
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 16; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class TextColorBlockItem : ColorBlockItem
|
||||
{
|
||||
public TextColorBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public TextColorBlockItem(Color color) : base(color)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "SetTextColor"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Text Color";
|
||||
}
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 12; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models.BlockItemTypes
|
||||
{
|
||||
internal class WidthBlockItem : NumericFilterPredicateBlockItem
|
||||
{
|
||||
public WidthBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public WidthBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand)
|
||||
: base(predicateOperator, predicateOperand)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText
|
||||
{
|
||||
get { return "Width"; }
|
||||
}
|
||||
|
||||
public override int MaximumAllowed
|
||||
{
|
||||
get { return 2; }
|
||||
}
|
||||
|
||||
public override string DisplayHeading
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Width";
|
||||
}
|
||||
}
|
||||
|
||||
public override string SummaryText
|
||||
{
|
||||
get { return "Width " + FilterPredicate; }
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor
|
||||
{
|
||||
get { return Colors.MediumPurple; }
|
||||
}
|
||||
|
||||
public override Color SummaryTextColor
|
||||
{
|
||||
get { return Colors.White; }
|
||||
}
|
||||
|
||||
public override int SortOrder
|
||||
{
|
||||
get { return 7; }
|
||||
}
|
||||
|
||||
public override int Minimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override int Maximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Filtration.Models
|
||||
{
|
||||
internal interface IAudioVisualBlockItem
|
||||
{
|
||||
event PropertyChangedEventHandler PropertyChanged;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Filtration.Models
|
||||
{
|
||||
internal interface IItemFilterBlockItem : INotifyPropertyChanged
|
||||
{
|
||||
string PrefixText { get; }
|
||||
string OutputText { get; }
|
||||
string DisplayHeading { get; }
|
||||
string SummaryText { get; }
|
||||
Color SummaryBackgroundColor { get; }
|
||||
Color SummaryTextColor { get; }
|
||||
int MaximumAllowed { get; }
|
||||
int SortOrder { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.Models
|
||||
{
|
||||
internal class ItemFilterBlock
|
||||
{
|
||||
private ItemFilterBlockGroup _blockGroup;
|
||||
|
||||
public ItemFilterBlock()
|
||||
{
|
||||
BlockItems = new ObservableCollection<IItemFilterBlockItem> {new ActionBlockItem(BlockAction.Show)};
|
||||
}
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public ItemFilterBlockGroup BlockGroup
|
||||
{
|
||||
get { return _blockGroup; }
|
||||
set
|
||||
{
|
||||
var oldBlockGroup = _blockGroup;
|
||||
_blockGroup = value;
|
||||
|
||||
if (_blockGroup != null)
|
||||
{
|
||||
_blockGroup.BlockGroupStatusChanged += OnBlockGroupStatusChanged;
|
||||
if (oldBlockGroup != null)
|
||||
{
|
||||
oldBlockGroup.BlockGroupStatusChanged -= OnBlockGroupStatusChanged;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (oldBlockGroup != null)
|
||||
{
|
||||
oldBlockGroup.BlockGroupStatusChanged -= OnBlockGroupStatusChanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BlockAction Action
|
||||
{
|
||||
get
|
||||
{
|
||||
var actionBlock = BlockItems.OfType<ActionBlockItem>().First();
|
||||
return actionBlock.Action;
|
||||
}
|
||||
set
|
||||
{
|
||||
var actionBlock = BlockItems.OfType<ActionBlockItem>().First();
|
||||
actionBlock.Action = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<IItemFilterBlockItem> BlockItems { get; private set; }
|
||||
|
||||
public int BlockCount(Type type)
|
||||
{
|
||||
return BlockItems != null ? BlockItems.Count(b => b.GetType() == type) : 0;
|
||||
}
|
||||
|
||||
public bool AddBlockItemAllowed(Type type)
|
||||
{
|
||||
var blockItem = (IItemFilterBlockItem)Activator.CreateInstance(type);
|
||||
return BlockCount(type) < blockItem.MaximumAllowed;
|
||||
}
|
||||
|
||||
public bool HasBlockItemOfType<T>()
|
||||
{
|
||||
return BlockItems.Count(b => b is T) > 0;
|
||||
}
|
||||
|
||||
public bool HasBlockGroupInParentHierarchy(ItemFilterBlockGroup targetBlockGroup, ItemFilterBlockGroup startingBlockGroup)
|
||||
{
|
||||
if (startingBlockGroup == targetBlockGroup)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (BlockGroup == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (startingBlockGroup.ParentGroup != null)
|
||||
{
|
||||
return HasBlockGroupInParentHierarchy(targetBlockGroup, startingBlockGroup.ParentGroup);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void OnBlockGroupStatusChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (BlockGroup.IsChecked == false && Action == BlockAction.Show)
|
||||
{
|
||||
Action = BlockAction.Hide;
|
||||
}
|
||||
else if (BlockGroup.IsChecked == true && Action == BlockAction.Hide)
|
||||
{
|
||||
Action = BlockAction.Show;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Filtration.Models
|
||||
{
|
||||
internal class ItemFilterBlockGroup
|
||||
{
|
||||
private bool _isChecked;
|
||||
|
||||
public ItemFilterBlockGroup(string groupName, ItemFilterBlockGroup parent, bool advanced = false)
|
||||
{
|
||||
GroupName = groupName;
|
||||
ParentGroup = parent;
|
||||
Advanced = advanced;
|
||||
ChildGroups = new List<ItemFilterBlockGroup>();
|
||||
}
|
||||
|
||||
public event EventHandler BlockGroupStatusChanged;
|
||||
|
||||
public string GroupName { get; private set; }
|
||||
public ItemFilterBlockGroup ParentGroup { get; private set; }
|
||||
public List<ItemFilterBlockGroup> ChildGroups { get; private set; }
|
||||
public bool Advanced { get; private set; }
|
||||
|
||||
public bool IsChecked
|
||||
{
|
||||
get { return _isChecked; }
|
||||
set
|
||||
{
|
||||
if (value != _isChecked)
|
||||
{
|
||||
_isChecked = value;
|
||||
// Raise an event to let blocks that have this block group assigned that
|
||||
// they might need to change their Action due to the block group status changing.
|
||||
if (BlockGroupStatusChanged != null)
|
||||
{
|
||||
BlockGroupStatusChanged.Invoke(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var currentBlockGroup = this;
|
||||
|
||||
var outputString = GroupName;
|
||||
|
||||
// TODO: This is retarded, fix this.
|
||||
if (currentBlockGroup.ParentGroup != null)
|
||||
{
|
||||
while (currentBlockGroup.ParentGroup.ParentGroup != null)
|
||||
{
|
||||
outputString = currentBlockGroup.ParentGroup.GroupName + " - " + outputString;
|
||||
currentBlockGroup = currentBlockGroup.ParentGroup;
|
||||
}
|
||||
}
|
||||
|
||||
return outputString;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using Filtration.Models.BlockItemTypes;
|
||||
|
||||
namespace Filtration.Models
|
||||
{
|
||||
internal class ItemFilterScript
|
||||
{
|
||||
public ItemFilterScript()
|
||||
{
|
||||
ItemFilterBlocks = new ObservableCollection<ItemFilterBlock>();
|
||||
ItemFilterBlockGroups = new ObservableCollection<ItemFilterBlockGroup>
|
||||
{
|
||||
new ItemFilterBlockGroup("Root", null)
|
||||
};
|
||||
}
|
||||
|
||||
public ObservableCollection<ItemFilterBlock> ItemFilterBlocks { get; private set; }
|
||||
public ObservableCollection<ItemFilterBlockGroup> ItemFilterBlockGroups { get; private set; }
|
||||
|
||||
public string FilePath { get; set; }
|
||||
public string Description { get; set; }
|
||||
public DateTime DateModified { get; set; }
|
||||
|
||||
public List<string> Validate()
|
||||
{
|
||||
var validationErrors = new List<string>();
|
||||
|
||||
if (ItemFilterBlocks.Count == 0)
|
||||
{
|
||||
validationErrors.Add("A script must have at least one block");
|
||||
}
|
||||
|
||||
return validationErrors;
|
||||
}
|
||||
|
||||
public void ReplaceColors(ReplaceColorsParameterSet replaceColorsParameterSet)
|
||||
{
|
||||
|
||||
foreach (
|
||||
var block in
|
||||
ItemFilterBlocks.Where(b => BlockIsColorReplacementCandidate(replaceColorsParameterSet, b)))
|
||||
{
|
||||
if (replaceColorsParameterSet.ReplaceTextColor)
|
||||
{
|
||||
var textColorBlockItem = block.BlockItems.OfType<TextColorBlockItem>().First();
|
||||
textColorBlockItem.Color = replaceColorsParameterSet.NewTextColor;
|
||||
}
|
||||
if (replaceColorsParameterSet.ReplaceBackgroundColor)
|
||||
{
|
||||
var backgroundColorBlockItem = block.BlockItems.OfType<BackgroundColorBlockItem>().First();
|
||||
backgroundColorBlockItem.Color = replaceColorsParameterSet.NewBackgroundColor;
|
||||
}
|
||||
if (replaceColorsParameterSet.ReplaceBorderColor)
|
||||
{
|
||||
var borderColorBlockItem = block.BlockItems.OfType<BorderColorBlockItem>().First();
|
||||
borderColorBlockItem.Color = replaceColorsParameterSet.NewBorderColor;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private bool BlockIsColorReplacementCandidate(ReplaceColorsParameterSet replaceColorsParameterSet, ItemFilterBlock block)
|
||||
{
|
||||
var textColorItem = block.HasBlockItemOfType<TextColorBlockItem>()
|
||||
? block.BlockItems.OfType<TextColorBlockItem>().First()
|
||||
: null;
|
||||
var backgroundColorItem = block.HasBlockItemOfType<BackgroundColorBlockItem>()
|
||||
? block.BlockItems.OfType<BackgroundColorBlockItem>().First()
|
||||
: null;
|
||||
var borderColorItem = block.HasBlockItemOfType<BorderColorBlockItem>()
|
||||
? block.BlockItems.OfType<BorderColorBlockItem>().First()
|
||||
: null;
|
||||
|
||||
// If we don't have all of the things we want to replace, then we aren't a candidate for replacing those things.
|
||||
if ((textColorItem == null && replaceColorsParameterSet.ReplaceTextColor) ||
|
||||
(backgroundColorItem == null && replaceColorsParameterSet.ReplaceBackgroundColor) ||
|
||||
(borderColorItem == null && replaceColorsParameterSet.ReplaceBorderColor))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((replaceColorsParameterSet.ReplaceTextColor &&
|
||||
textColorItem.Color != replaceColorsParameterSet.OldTextColor) ||
|
||||
(replaceColorsParameterSet.ReplaceBackgroundColor &&
|
||||
backgroundColorItem.Color != replaceColorsParameterSet.OldBackgroundColor) ||
|
||||
(replaceColorsParameterSet.ReplaceBorderColor &&
|
||||
borderColorItem.Color != replaceColorsParameterSet.OldBorderColor))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Filtration.Models
|
||||
{
|
||||
internal class ItemFilterSection : ItemFilterBlock
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Filtration.Annotations;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Extensions;
|
||||
|
||||
namespace Filtration.Models
|
||||
{
|
||||
internal class NumericFilterPredicate : INotifyPropertyChanged
|
||||
{
|
||||
private FilterPredicateOperator _predicateOperator;
|
||||
private int _predicateOperand;
|
||||
|
||||
public NumericFilterPredicate(FilterPredicateOperator predicateOperator, int predicateOperand)
|
||||
{
|
||||
PredicateOperator = predicateOperator;
|
||||
PredicateOperand = predicateOperand;
|
||||
}
|
||||
|
||||
public NumericFilterPredicate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public FilterPredicateOperator PredicateOperator
|
||||
{
|
||||
get { return _predicateOperator; }
|
||||
set
|
||||
{
|
||||
_predicateOperator = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int PredicateOperand
|
||||
{
|
||||
get { return _predicateOperand; }
|
||||
set
|
||||
{
|
||||
_predicateOperand = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return PredicateOperator.GetAttributeDescription() + " " + PredicateOperand;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
public virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
var handler = PropertyChanged;
|
||||
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Filtration.Models
|
||||
{
|
||||
internal class ReplaceColorsParameterSet
|
||||
{
|
||||
public Color OldTextColor { get; set; }
|
||||
public Color NewTextColor { get; set; }
|
||||
public Color OldBackgroundColor { get; set; }
|
||||
public Color NewBackgroundColor { get; set; }
|
||||
public Color OldBorderColor { get; set; }
|
||||
public Color NewBorderColor { get; set; }
|
||||
public bool ReplaceTextColor { get; set; }
|
||||
public bool ReplaceBackgroundColor { get; set; }
|
||||
public bool ReplaceBorderColor { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Filtration.Models;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.Services;
|
||||
using Filtration.ViewModels;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.IO;
|
||||
using Filtration.Models;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.Translators;
|
||||
|
||||
namespace Filtration.Services
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Filtration.Models;
|
||||
using Filtration.ObjectModel;
|
||||
|
||||
namespace Filtration.Translators
|
||||
{
|
||||
|
||||
@@ -4,11 +4,11 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Media;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Extensions;
|
||||
using Filtration.Models;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
using Filtration.Models.BlockItemTypes;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
using Filtration.ObjectModel.BlockItemTypes;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
using Filtration.ObjectModel.Extensions;
|
||||
using Filtration.Utilities;
|
||||
|
||||
namespace Filtration.Translators
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using Castle.Core.Internal;
|
||||
using Filtration.Models;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.Utilities;
|
||||
|
||||
namespace Filtration.Translators
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:enums="clr-namespace:Filtration.Enums"
|
||||
xmlns:extensions="clr-namespace:Filtration.Extensions"
|
||||
xmlns:userControls="clr-namespace:Filtration.UserControls"
|
||||
xmlns:enums="clr-namespace:Filtration.ObjectModel.Enums;assembly=Filtration.ObjectModel"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=userControls:NumericFilterPredicateControl}">
|
||||
<Grid>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
using Filtration.Annotations;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Models;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.UserControls
|
||||
{
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using AutoMapper;
|
||||
using Filtration.Models;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ViewModels;
|
||||
|
||||
namespace Filtration.Utilities
|
||||
|
||||
@@ -9,7 +9,6 @@ namespace Filtration.ViewModels
|
||||
/// This gives us the ReSharper option to transform an autoproperty into a property with change notification
|
||||
/// Also leverages .net 4.5 callermembername attribute
|
||||
[NotifyPropertyChangedInvocator]
|
||||
|
||||
protected override void RaisePropertyChanged([CallerMemberName]string property = "")
|
||||
{
|
||||
base.RaisePropertyChanged(property);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using Filtration.Models;
|
||||
using Filtration.ObjectModel;
|
||||
|
||||
namespace Filtration.ViewModels
|
||||
{
|
||||
|
||||
@@ -4,9 +4,9 @@ using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
using Filtration.Models;
|
||||
using Filtration.Models.BlockItemBaseTypes;
|
||||
using Filtration.Models.BlockItemTypes;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
using Filtration.ObjectModel.BlockItemTypes;
|
||||
using Filtration.Services;
|
||||
using Filtration.Views;
|
||||
using GalaSoft.MvvmLight.CommandWpf;
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Forms;
|
||||
using Castle.Core.Internal;
|
||||
using Filtration.Models;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.Services;
|
||||
using Filtration.Translators;
|
||||
using Filtration.ViewModels.ToolPanes;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
using Filtration.Models;
|
||||
using Filtration.Models.BlockItemTypes;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ObjectModel.BlockItemTypes;
|
||||
using Filtration.Views;
|
||||
using GalaSoft.MvvmLight.CommandWpf;
|
||||
using Xceed.Wpf.Toolkit;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Filtration.ViewModels.ToolPanes
|
||||
if (_isVisible != value)
|
||||
{
|
||||
_isVisible = value;
|
||||
RaisePropertyChanged("IsVisible");
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Filtration.Models;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ViewModels;
|
||||
|
||||
namespace Filtration.Views
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:userControls="clr-namespace:Filtration.UserControls"
|
||||
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
|
||||
xmlns:blockItemBaseTypes="clr-namespace:Filtration.Models.BlockItemBaseTypes"
|
||||
xmlns:blockItemTypes="clr-namespace:Filtration.Models.BlockItemTypes"
|
||||
xmlns:blockItembaseTypes="clr-namespace:Filtration.ObjectModel.BlockItemBaseTypes;assembly=Filtration.ObjectModel"
|
||||
xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
|
||||
xmlns:blockItemTypes="clr-namespace:Filtration.ObjectModel.BlockItemTypes;assembly=Filtration.ObjectModel"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=viewModels:ItemFilterBlockViewModel}"
|
||||
d:DesignHeight="120" d:DesignWidth="175">
|
||||
@@ -54,7 +54,7 @@
|
||||
<Setter Property="Margin" Value="0,0,5,0" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<DataTemplate DataType="{x:Type blockItemBaseTypes:ColorBlockItem}">
|
||||
<DataTemplate DataType="{x:Type blockItembaseTypes:ColorBlockItem}">
|
||||
<Grid Margin="0,0,0,2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition SharedSizeGroup="AudioVisualBlockItemTitleColumn" Width="*" />
|
||||
@@ -66,7 +66,7 @@
|
||||
<userControls:CrossButton Grid.Column="2" Height="12" Command="{Binding ElementName=SettingsGrid, Path=DataContext.RemoveAudioVisualBlockItemCommand}" CommandParameter="{Binding}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type blockItemBaseTypes:IntegerBlockItem}">
|
||||
<DataTemplate DataType="{x:Type blockItembaseTypes:IntegerBlockItem}">
|
||||
<Grid Margin="0,0,0,2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition SharedSizeGroup="AudioVisualBlockItemTitleColumn" Width="*" />
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
xmlns:userControls="clr-namespace:Filtration.UserControls"
|
||||
xmlns:views="clr-namespace:Filtration.Views"
|
||||
xmlns:converters="clr-namespace:Filtration.Converters"
|
||||
xmlns:blockItemBaseTypes="clr-namespace:Filtration.Models.BlockItemBaseTypes"
|
||||
xmlns:blockItemTypes="clr-namespace:Filtration.Models.BlockItemTypes"
|
||||
xmlns:enums="clr-namespace:Filtration.Enums"
|
||||
xmlns:extensions="clr-namespace:Filtration.Extensions"
|
||||
xmlns:blockItemBaseTypes="clr-namespace:Filtration.ObjectModel.BlockItemBaseTypes;assembly=Filtration.ObjectModel"
|
||||
xmlns:blockItemTypes="clr-namespace:Filtration.ObjectModel.BlockItemTypes;assembly=Filtration.ObjectModel"
|
||||
xmlns:enums="clr-namespace:Filtration.ObjectModel.Enums;assembly=Filtration.ObjectModel"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=viewModels:ItemFilterBlockViewModel}"
|
||||
d:DesignHeight="200" d:DesignWidth="800">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Filtration.Views
|
||||
{
|
||||
@@ -12,7 +12,7 @@ namespace Filtration.Views
|
||||
|
||||
private void BlockExpander_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
var originalSource = e.OriginalSource as System.Windows.Media.Visual;
|
||||
var originalSource = e.OriginalSource as Visual;
|
||||
if (originalSource != null && originalSource.IsDescendantOf(BlockItemsGrid))
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user