From c6f5dcda39faa7aa428267447b3e6e753e34b187 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 24 Jun 2015 19:57:16 +0100 Subject: [PATCH] Moved Object Model to separate project --- .../TestItemFilterBlock.cs | 5 +- .../TestItemFilterScript.cs | 8 +- .../BlockItemBaseTypes/ActionBlockItem.cs | 8 +- .../BlockItemBaseTypes/BlockItembase.cs | 7 +- .../BlockItemBaseTypes/ColorBlockItem.cs | 4 +- .../DualIntegerBlockItem.cs | 4 +- .../BlockItemBaseTypes/IntegerBlockItem.cs | 4 +- .../NumericFilterPredicateBlockItem.cs | 8 +- .../BlockItemBaseTypes/StringListBlockItem.cs | 4 +- .../BackgroundColorBlockItem.cs | 6 +- .../BlockItemTypes/BaseTypeBlockItem.cs | 6 +- .../BlockItemTypes/BorderColorBlockItem.cs | 6 +- .../BlockItemTypes/ClassBlockItem.cs | 6 +- .../BlockItemTypes/DropLevelBlockItem.cs | 8 +- .../BlockItemTypes/FontSizeBlockItem.cs | 6 +- .../BlockItemTypes/HeightBlockItem.cs | 8 +- .../BlockItemTypes/ItemLevelBlockItem.cs | 8 +- .../BlockItemTypes/LinkedSocketsBlockItem.cs | 8 +- .../BlockItemTypes/QualityBlockItem.cs | 8 +- .../BlockItemTypes/RarityBlockItem.cs | 10 +- .../BlockItemTypes/SocketGroupBlockItem.cs | 6 +- .../BlockItemTypes/SocketsBlockItem.cs | 8 +- .../BlockItemTypes/SoundBlockItem.cs | 6 +- .../BlockItemTypes/TextColorBlockItem.cs | 6 +- .../BlockItemTypes/WidthBlockItem.cs | 8 +- .../Enums/BlockAction.cs | 4 +- .../Enums/BlockItemType.cs | 4 +- .../Enums/FilterPredicateOperator.cs | 4 +- .../Enums/FilterType.cs | 4 +- .../Enums/ItemRarity.cs | 4 +- .../Enums/SocketColor.cs | 4 +- .../Extensions/EnumHelper.cs | 4 +- .../Filtration.ObjectModel.csproj | 92 ++ .../IAudioVisualBlockItem.cs | 4 +- .../IItemFilterBlockItem.cs | 4 +- .../ItemFilterBlock.cs | 10 +- .../ItemFilterBlockGroup.cs | 4 +- .../ItemFilterScript.cs | 6 +- Filtration.ObjectModel/ItemFilterSection.cs | 6 + .../NumericFilterPredicate.cs | 10 +- .../Properties/Annotations.cs | 937 ++++++++++++++++++ .../Properties/AssemblyInfo.cs | 35 + .../ReplaceColorsParameterSet.cs | 4 +- Filtration.Tests/Filtration.Tests.csproj | 8 +- Filtration.Tests/Properties/AssemblyInfo.cs | 1 - .../TestItemFilterScriptRepository.cs | 7 +- .../TestItemFilterPersistenceService.cs | 4 +- .../TestItemFilterBlockTranslator.cs | 22 +- .../TestItemFilterScriptTranslator.cs | 12 +- Filtration.sln | 12 + Filtration/App.xaml.cs | 64 +- .../BlockItemTypeToStringConverter.cs | 2 +- .../BooleanToBlockActionConverter.cs | 2 +- .../BooleanToBlockActionInverseConverter.cs | 2 +- Filtration/Converters/ItemRarityConverter.cs | 2 +- Filtration/Filtration.csproj | 47 +- Filtration/Models/ItemFilterSection.cs | 6 - .../ItemFilterScriptRepository.cs | 2 +- .../Services/ItemFilterPersistenceService.cs | 2 +- .../Translators/BlockGroupHierarchyBuilder.cs | 2 +- .../Translators/ItemFilterBlockTranslator.cs | 10 +- .../Translators/ItemFilterScriptTranslator.cs | 2 +- .../NumericFilterPredicateControl.xaml | 2 +- .../NumericFilterPredicateControl.xaml.cs | 4 +- Filtration/Utilities/BlockGroupMapper.cs | 5 +- .../ViewModels/FiltrationViewModelBase.cs | 1 - .../ItemFilterBlockGroupViewModel.cs | 2 +- .../ViewModels/ItemFilterBlockViewModel.cs | 6 +- .../ViewModels/ItemFilterScriptViewModel.cs | 2 +- .../ViewModels/ReplaceColorsViewModel.cs | 4 +- .../ViewModels/ToolPanes/ToolViewModel.cs | 2 +- Filtration/Views/BlockTemplateSelector.cs | 2 +- .../ItemFilterBlockDisplaySettingsView.xaml | 8 +- Filtration/Views/ItemFilterBlockView.xaml | 6 +- Filtration/Views/ItemFilterBlockView.xaml.cs | 6 +- 75 files changed, 1271 insertions(+), 294 deletions(-) rename {Filtration.Tests/Models => Filtration.ObjectModel.Tests}/TestItemFilterBlock.cs (95%) rename {Filtration.Tests/Models => Filtration.ObjectModel.Tests}/TestItemFilterScript.cs (96%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemBaseTypes/ActionBlockItem.cs (91%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemBaseTypes/BlockItembase.cs (84%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemBaseTypes/ColorBlockItem.cs (88%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemBaseTypes/DualIntegerBlockItem.cs (89%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemBaseTypes/IntegerBlockItem.cs (86%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemBaseTypes/NumericFilterPredicateBlockItem.cs (87%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemBaseTypes/StringListBlockItem.cs (90%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/BackgroundColorBlockItem.cs (80%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/BaseTypeBlockItem.cs (90%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/BorderColorBlockItem.cs (80%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/ClassBlockItem.cs (90%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/DropLevelBlockItem.cs (86%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/FontSizeBlockItem.cs (84%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/HeightBlockItem.cs (86%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/ItemLevelBlockItem.cs (86%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/LinkedSocketsBlockItem.cs (86%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/QualityBlockItem.cs (86%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/RarityBlockItem.cs (88%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/SocketGroupBlockItem.cs (86%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/SocketsBlockItem.cs (86%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/SoundBlockItem.cs (81%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/TextColorBlockItem.cs (80%) rename {Filtration/Models => Filtration.ObjectModel}/BlockItemTypes/WidthBlockItem.cs (86%) rename {Filtration => Filtration.ObjectModel}/Enums/BlockAction.cs (66%) rename {Filtration => Filtration.ObjectModel}/Enums/BlockItemType.cs (81%) rename {Filtration => Filtration.ObjectModel}/Enums/FilterPredicateOperator.cs (81%) rename {Filtration => Filtration.ObjectModel}/Enums/FilterType.cs (67%) rename {Filtration => Filtration.ObjectModel}/Enums/ItemRarity.cs (78%) rename {Filtration => Filtration.ObjectModel}/Enums/SocketColor.cs (76%) rename {Filtration => Filtration.ObjectModel}/Extensions/EnumHelper.cs (93%) create mode 100644 Filtration.ObjectModel/Filtration.ObjectModel.csproj rename {Filtration/Models => Filtration.ObjectModel}/IAudioVisualBlockItem.cs (58%) rename {Filtration/Models => Filtration.ObjectModel}/IItemFilterBlockItem.cs (78%) rename {Filtration/Models => Filtration.ObjectModel}/ItemFilterBlock.cs (93%) rename {Filtration/Models => Filtration.ObjectModel}/ItemFilterBlockGroup.cs (96%) rename {Filtration/Models => Filtration.ObjectModel}/ItemFilterScript.cs (97%) create mode 100644 Filtration.ObjectModel/ItemFilterSection.cs rename {Filtration/Models => Filtration.ObjectModel}/NumericFilterPredicate.cs (87%) create mode 100644 Filtration.ObjectModel/Properties/Annotations.cs create mode 100644 Filtration.ObjectModel/Properties/AssemblyInfo.cs rename {Filtration/Models => Filtration.ObjectModel}/ReplaceColorsParameterSet.cs (87%) delete mode 100644 Filtration/Models/ItemFilterSection.cs diff --git a/Filtration.Tests/Models/TestItemFilterBlock.cs b/Filtration.ObjectModel.Tests/TestItemFilterBlock.cs similarity index 95% rename from Filtration.Tests/Models/TestItemFilterBlock.cs rename to Filtration.ObjectModel.Tests/TestItemFilterBlock.cs index 8b45168..8afd358 100644 --- a/Filtration.Tests/Models/TestItemFilterBlock.cs +++ b/Filtration.ObjectModel.Tests/TestItemFilterBlock.cs @@ -1,8 +1,7 @@ -using Filtration.Models; -using Filtration.Models.BlockItemTypes; +using Filtration.ObjectModel.BlockItemTypes; using NUnit.Framework; -namespace Filtration.Tests.Models +namespace Filtration.ObjectModel.Tests { [TestFixture] public class TestItemFilterBlock diff --git a/Filtration.Tests/Models/TestItemFilterScript.cs b/Filtration.ObjectModel.Tests/TestItemFilterScript.cs similarity index 96% rename from Filtration.Tests/Models/TestItemFilterScript.cs rename to Filtration.ObjectModel.Tests/TestItemFilterScript.cs index e36fc25..5303a85 100644 --- a/Filtration.Tests/Models/TestItemFilterScript.cs +++ b/Filtration.ObjectModel.Tests/TestItemFilterScript.cs @@ -1,11 +1,9 @@ -using System.Collections.ObjectModel; -using System.Linq; +using System.Linq; using System.Windows.Media; -using Filtration.Models; -using Filtration.Models.BlockItemTypes; +using Filtration.ObjectModel.BlockItemTypes; using NUnit.Framework; -namespace Filtration.Tests.Models +namespace Filtration.ObjectModel.Tests { [TestFixture] public class TestItemFilterScript diff --git a/Filtration/Models/BlockItemBaseTypes/ActionBlockItem.cs b/Filtration.ObjectModel/BlockItemBaseTypes/ActionBlockItem.cs similarity index 91% rename from Filtration/Models/BlockItemBaseTypes/ActionBlockItem.cs rename to Filtration.ObjectModel/BlockItemBaseTypes/ActionBlockItem.cs index ffce035..8d7d5e1 100644 --- a/Filtration/Models/BlockItemBaseTypes/ActionBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemBaseTypes/ActionBlockItem.cs @@ -1,10 +1,10 @@ using System.Windows.Media; -using Filtration.Enums; -using Filtration.Extensions; +using Filtration.ObjectModel.Enums; +using Filtration.ObjectModel.Extensions; -namespace Filtration.Models.BlockItemBaseTypes +namespace Filtration.ObjectModel.BlockItemBaseTypes { - internal class ActionBlockItem : BlockItemBase + public class ActionBlockItem : BlockItemBase { private BlockAction _action; diff --git a/Filtration/Models/BlockItemBaseTypes/BlockItembase.cs b/Filtration.ObjectModel/BlockItemBaseTypes/BlockItembase.cs similarity index 84% rename from Filtration/Models/BlockItemBaseTypes/BlockItembase.cs rename to Filtration.ObjectModel/BlockItemBaseTypes/BlockItembase.cs index 267714c..328e193 100644 --- a/Filtration/Models/BlockItemBaseTypes/BlockItembase.cs +++ b/Filtration.ObjectModel/BlockItemBaseTypes/BlockItembase.cs @@ -1,11 +1,11 @@ using System.ComponentModel; using System.Runtime.CompilerServices; using System.Windows.Media; -using Filtration.Annotations; +using Filtration.ObjectModel.Annotations; -namespace Filtration.Models.BlockItemBaseTypes +namespace Filtration.ObjectModel.BlockItemBaseTypes { - abstract class BlockItemBase : IItemFilterBlockItem + public abstract class BlockItemBase : IItemFilterBlockItem { public abstract string PrefixText { get; } public abstract string OutputText { get; } @@ -17,6 +17,7 @@ namespace Filtration.Models.BlockItemBaseTypes public abstract int SortOrder { get; } public event PropertyChangedEventHandler PropertyChanged; + [NotifyPropertyChangedInvocator] protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { diff --git a/Filtration/Models/BlockItemBaseTypes/ColorBlockItem.cs b/Filtration.ObjectModel/BlockItemBaseTypes/ColorBlockItem.cs similarity index 88% rename from Filtration/Models/BlockItemBaseTypes/ColorBlockItem.cs rename to Filtration.ObjectModel/BlockItemBaseTypes/ColorBlockItem.cs index 79725e3..48ed9a1 100644 --- a/Filtration/Models/BlockItemBaseTypes/ColorBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemBaseTypes/ColorBlockItem.cs @@ -1,8 +1,8 @@ using System.Windows.Media; -namespace Filtration.Models.BlockItemBaseTypes +namespace Filtration.ObjectModel.BlockItemBaseTypes { - internal abstract class ColorBlockItem : BlockItemBase, IAudioVisualBlockItem + public abstract class ColorBlockItem : BlockItemBase, IAudioVisualBlockItem { private Color _color; diff --git a/Filtration/Models/BlockItemBaseTypes/DualIntegerBlockItem.cs b/Filtration.ObjectModel/BlockItemBaseTypes/DualIntegerBlockItem.cs similarity index 89% rename from Filtration/Models/BlockItemBaseTypes/DualIntegerBlockItem.cs rename to Filtration.ObjectModel/BlockItemBaseTypes/DualIntegerBlockItem.cs index 24b4299..a91ce86 100644 --- a/Filtration/Models/BlockItemBaseTypes/DualIntegerBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemBaseTypes/DualIntegerBlockItem.cs @@ -1,8 +1,8 @@ using System.Windows.Media; -namespace Filtration.Models.BlockItemBaseTypes +namespace Filtration.ObjectModel.BlockItemBaseTypes { - internal abstract class DualIntegerBlockItem : BlockItemBase, IAudioVisualBlockItem + public abstract class DualIntegerBlockItem : BlockItemBase, IAudioVisualBlockItem { private int _value; private int _secondValue; diff --git a/Filtration/Models/BlockItemBaseTypes/IntegerBlockItem.cs b/Filtration.ObjectModel/BlockItemBaseTypes/IntegerBlockItem.cs similarity index 86% rename from Filtration/Models/BlockItemBaseTypes/IntegerBlockItem.cs rename to Filtration.ObjectModel/BlockItemBaseTypes/IntegerBlockItem.cs index 9f1fcf5..262ad92 100644 --- a/Filtration/Models/BlockItemBaseTypes/IntegerBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemBaseTypes/IntegerBlockItem.cs @@ -1,8 +1,8 @@ using System.Windows.Media; -namespace Filtration.Models.BlockItemBaseTypes +namespace Filtration.ObjectModel.BlockItemBaseTypes { - internal abstract class IntegerBlockItem : BlockItemBase, IAudioVisualBlockItem + public abstract class IntegerBlockItem : BlockItemBase, IAudioVisualBlockItem { private int _value; diff --git a/Filtration/Models/BlockItemBaseTypes/NumericFilterPredicateBlockItem.cs b/Filtration.ObjectModel/BlockItemBaseTypes/NumericFilterPredicateBlockItem.cs similarity index 87% rename from Filtration/Models/BlockItemBaseTypes/NumericFilterPredicateBlockItem.cs rename to Filtration.ObjectModel/BlockItemBaseTypes/NumericFilterPredicateBlockItem.cs index 840cd1c..bbc32c4 100644 --- a/Filtration/Models/BlockItemBaseTypes/NumericFilterPredicateBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemBaseTypes/NumericFilterPredicateBlockItem.cs @@ -1,10 +1,10 @@ using System; -using Filtration.Enums; -using Filtration.Extensions; +using Filtration.ObjectModel.Enums; +using Filtration.ObjectModel.Extensions; -namespace Filtration.Models.BlockItemBaseTypes +namespace Filtration.ObjectModel.BlockItemBaseTypes { - internal abstract class NumericFilterPredicateBlockItem : BlockItemBase + public abstract class NumericFilterPredicateBlockItem : BlockItemBase { private NumericFilterPredicate _filterPredicate; diff --git a/Filtration/Models/BlockItemBaseTypes/StringListBlockItem.cs b/Filtration.ObjectModel/BlockItemBaseTypes/StringListBlockItem.cs similarity index 90% rename from Filtration/Models/BlockItemBaseTypes/StringListBlockItem.cs rename to Filtration.ObjectModel/BlockItemBaseTypes/StringListBlockItem.cs index 8c285d1..0e95c5d 100644 --- a/Filtration/Models/BlockItemBaseTypes/StringListBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemBaseTypes/StringListBlockItem.cs @@ -3,9 +3,9 @@ using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; -namespace Filtration.Models.BlockItemBaseTypes +namespace Filtration.ObjectModel.BlockItemBaseTypes { - internal abstract class StringListBlockItem : BlockItemBase + public abstract class StringListBlockItem : BlockItemBase { protected StringListBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/BackgroundColorBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/BackgroundColorBlockItem.cs similarity index 80% rename from Filtration/Models/BlockItemTypes/BackgroundColorBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/BackgroundColorBlockItem.cs index cf1fddb..cfb7e6f 100644 --- a/Filtration/Models/BlockItemTypes/BackgroundColorBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/BackgroundColorBlockItem.cs @@ -1,9 +1,9 @@ using System.Windows.Media; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class BackgroundColorBlockItem : ColorBlockItem + public class BackgroundColorBlockItem : ColorBlockItem { public BackgroundColorBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/BaseTypeBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/BaseTypeBlockItem.cs similarity index 90% rename from Filtration/Models/BlockItemTypes/BaseTypeBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/BaseTypeBlockItem.cs index 6fb2133..2dd869f 100644 --- a/Filtration/Models/BlockItemTypes/BaseTypeBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/BaseTypeBlockItem.cs @@ -1,10 +1,10 @@ using System.Linq; using System.Windows.Media; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class BaseTypeBlockItem : StringListBlockItem + public class BaseTypeBlockItem : StringListBlockItem { public override string PrefixText { get { return "BaseType"; } } diff --git a/Filtration/Models/BlockItemTypes/BorderColorBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/BorderColorBlockItem.cs similarity index 80% rename from Filtration/Models/BlockItemTypes/BorderColorBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/BorderColorBlockItem.cs index 59a025c..c989ba8 100644 --- a/Filtration/Models/BlockItemTypes/BorderColorBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/BorderColorBlockItem.cs @@ -1,9 +1,9 @@ using System.Windows.Media; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class BorderColorBlockItem : ColorBlockItem + public class BorderColorBlockItem : ColorBlockItem { public BorderColorBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/ClassBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/ClassBlockItem.cs similarity index 90% rename from Filtration/Models/BlockItemTypes/ClassBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/ClassBlockItem.cs index 2dfc577..9360ccb 100644 --- a/Filtration/Models/BlockItemTypes/ClassBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/ClassBlockItem.cs @@ -1,10 +1,10 @@ using System.Linq; using System.Windows.Media; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class ClassBlockItem : StringListBlockItem + public class ClassBlockItem : StringListBlockItem { public override string PrefixText { get { return "Class"; } } diff --git a/Filtration/Models/BlockItemTypes/DropLevelBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/DropLevelBlockItem.cs similarity index 86% rename from Filtration/Models/BlockItemTypes/DropLevelBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/DropLevelBlockItem.cs index 1e686b1..a3abc6d 100644 --- a/Filtration/Models/BlockItemTypes/DropLevelBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/DropLevelBlockItem.cs @@ -1,10 +1,10 @@ using System.Windows.Media; -using Filtration.Enums; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; +using Filtration.ObjectModel.Enums; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class DropLevelBlockItem : NumericFilterPredicateBlockItem + public class DropLevelBlockItem : NumericFilterPredicateBlockItem { public DropLevelBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/FontSizeBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/FontSizeBlockItem.cs similarity index 84% rename from Filtration/Models/BlockItemTypes/FontSizeBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/FontSizeBlockItem.cs index 25b8fff..85bb8db 100644 --- a/Filtration/Models/BlockItemTypes/FontSizeBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/FontSizeBlockItem.cs @@ -1,8 +1,8 @@ -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class FontSizeBlockItem : IntegerBlockItem + public class FontSizeBlockItem : IntegerBlockItem { public FontSizeBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/HeightBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/HeightBlockItem.cs similarity index 86% rename from Filtration/Models/BlockItemTypes/HeightBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/HeightBlockItem.cs index 78352a3..5c75e37 100644 --- a/Filtration/Models/BlockItemTypes/HeightBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/HeightBlockItem.cs @@ -1,10 +1,10 @@ using System.Windows.Media; -using Filtration.Enums; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; +using Filtration.ObjectModel.Enums; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class HeightBlockItem : NumericFilterPredicateBlockItem + public class HeightBlockItem : NumericFilterPredicateBlockItem { public HeightBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/ItemLevelBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/ItemLevelBlockItem.cs similarity index 86% rename from Filtration/Models/BlockItemTypes/ItemLevelBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/ItemLevelBlockItem.cs index ca1b31f..61b94d7 100644 --- a/Filtration/Models/BlockItemTypes/ItemLevelBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/ItemLevelBlockItem.cs @@ -1,10 +1,10 @@ using System.Windows.Media; -using Filtration.Enums; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; +using Filtration.ObjectModel.Enums; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class ItemLevelBlockItem : NumericFilterPredicateBlockItem + public class ItemLevelBlockItem : NumericFilterPredicateBlockItem { public ItemLevelBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/LinkedSocketsBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/LinkedSocketsBlockItem.cs similarity index 86% rename from Filtration/Models/BlockItemTypes/LinkedSocketsBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/LinkedSocketsBlockItem.cs index 8046890..abb3157 100644 --- a/Filtration/Models/BlockItemTypes/LinkedSocketsBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/LinkedSocketsBlockItem.cs @@ -1,10 +1,10 @@ using System.Windows.Media; -using Filtration.Enums; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; +using Filtration.ObjectModel.Enums; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class LinkedSocketsBlockItem : NumericFilterPredicateBlockItem + public class LinkedSocketsBlockItem : NumericFilterPredicateBlockItem { public LinkedSocketsBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/QualityBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/QualityBlockItem.cs similarity index 86% rename from Filtration/Models/BlockItemTypes/QualityBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/QualityBlockItem.cs index 2c9f062..4b05703 100644 --- a/Filtration/Models/BlockItemTypes/QualityBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/QualityBlockItem.cs @@ -1,10 +1,10 @@ using System.Windows.Media; -using Filtration.Enums; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; +using Filtration.ObjectModel.Enums; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class QualityBlockItem : NumericFilterPredicateBlockItem + public class QualityBlockItem : NumericFilterPredicateBlockItem { public QualityBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/RarityBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/RarityBlockItem.cs similarity index 88% rename from Filtration/Models/BlockItemTypes/RarityBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/RarityBlockItem.cs index 22ada42..a7bc010 100644 --- a/Filtration/Models/BlockItemTypes/RarityBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/RarityBlockItem.cs @@ -1,11 +1,11 @@ using System.Windows.Media; -using Filtration.Enums; -using Filtration.Extensions; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; +using Filtration.ObjectModel.Enums; +using Filtration.ObjectModel.Extensions; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class RarityBlockItem : NumericFilterPredicateBlockItem + public class RarityBlockItem : NumericFilterPredicateBlockItem { public RarityBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/SocketGroupBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/SocketGroupBlockItem.cs similarity index 86% rename from Filtration/Models/BlockItemTypes/SocketGroupBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/SocketGroupBlockItem.cs index 72e01e6..4a66b01 100644 --- a/Filtration/Models/BlockItemTypes/SocketGroupBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/SocketGroupBlockItem.cs @@ -1,10 +1,10 @@ using System.Linq; using System.Windows.Media; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class SocketGroupBlockItem : StringListBlockItem + public class SocketGroupBlockItem : StringListBlockItem { public override string PrefixText { diff --git a/Filtration/Models/BlockItemTypes/SocketsBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/SocketsBlockItem.cs similarity index 86% rename from Filtration/Models/BlockItemTypes/SocketsBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/SocketsBlockItem.cs index a91a8d3..23e2c5a 100644 --- a/Filtration/Models/BlockItemTypes/SocketsBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/SocketsBlockItem.cs @@ -1,10 +1,10 @@ using System.Windows.Media; -using Filtration.Enums; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; +using Filtration.ObjectModel.Enums; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class SocketsBlockItem : NumericFilterPredicateBlockItem + public class SocketsBlockItem : NumericFilterPredicateBlockItem { public SocketsBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/SoundBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/SoundBlockItem.cs similarity index 81% rename from Filtration/Models/BlockItemTypes/SoundBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/SoundBlockItem.cs index 481a9d2..80ef44c 100644 --- a/Filtration/Models/BlockItemTypes/SoundBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/SoundBlockItem.cs @@ -1,8 +1,8 @@ -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class SoundBlockItem : DualIntegerBlockItem + public class SoundBlockItem : DualIntegerBlockItem { public SoundBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/TextColorBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/TextColorBlockItem.cs similarity index 80% rename from Filtration/Models/BlockItemTypes/TextColorBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/TextColorBlockItem.cs index 02c3883..0bc27d4 100644 --- a/Filtration/Models/BlockItemTypes/TextColorBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/TextColorBlockItem.cs @@ -1,9 +1,9 @@ using System.Windows.Media; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class TextColorBlockItem : ColorBlockItem + public class TextColorBlockItem : ColorBlockItem { public TextColorBlockItem() { diff --git a/Filtration/Models/BlockItemTypes/WidthBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/WidthBlockItem.cs similarity index 86% rename from Filtration/Models/BlockItemTypes/WidthBlockItem.cs rename to Filtration.ObjectModel/BlockItemTypes/WidthBlockItem.cs index 96215d3..aff1e77 100644 --- a/Filtration/Models/BlockItemTypes/WidthBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/WidthBlockItem.cs @@ -1,10 +1,10 @@ using System.Windows.Media; -using Filtration.Enums; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; +using Filtration.ObjectModel.Enums; -namespace Filtration.Models.BlockItemTypes +namespace Filtration.ObjectModel.BlockItemTypes { - internal class WidthBlockItem : NumericFilterPredicateBlockItem + public class WidthBlockItem : NumericFilterPredicateBlockItem { public WidthBlockItem() { diff --git a/Filtration/Enums/BlockAction.cs b/Filtration.ObjectModel/Enums/BlockAction.cs similarity index 66% rename from Filtration/Enums/BlockAction.cs rename to Filtration.ObjectModel/Enums/BlockAction.cs index e915e01..f9e1815 100644 --- a/Filtration/Enums/BlockAction.cs +++ b/Filtration.ObjectModel/Enums/BlockAction.cs @@ -1,8 +1,8 @@ using System.ComponentModel; -namespace Filtration.Enums +namespace Filtration.ObjectModel.Enums { - internal enum BlockAction + public enum BlockAction { [Description("Show")] Show, diff --git a/Filtration/Enums/BlockItemType.cs b/Filtration.ObjectModel/Enums/BlockItemType.cs similarity index 81% rename from Filtration/Enums/BlockItemType.cs rename to Filtration.ObjectModel/Enums/BlockItemType.cs index cc09263..4a5d24a 100644 --- a/Filtration/Enums/BlockItemType.cs +++ b/Filtration.ObjectModel/Enums/BlockItemType.cs @@ -1,6 +1,6 @@ -namespace Filtration.Enums +namespace Filtration.ObjectModel.Enums { - internal enum BlockItemType + public enum BlockItemType { ItemLevel, DropLevel, diff --git a/Filtration/Enums/FilterPredicateOperator.cs b/Filtration.ObjectModel/Enums/FilterPredicateOperator.cs similarity index 81% rename from Filtration/Enums/FilterPredicateOperator.cs rename to Filtration.ObjectModel/Enums/FilterPredicateOperator.cs index f13baa9..51e11b8 100644 --- a/Filtration/Enums/FilterPredicateOperator.cs +++ b/Filtration.ObjectModel/Enums/FilterPredicateOperator.cs @@ -1,8 +1,8 @@ using System.ComponentModel; -namespace Filtration.Enums +namespace Filtration.ObjectModel.Enums { - internal enum FilterPredicateOperator + public enum FilterPredicateOperator { [Description("=")] Equal, diff --git a/Filtration/Enums/FilterType.cs b/Filtration.ObjectModel/Enums/FilterType.cs similarity index 67% rename from Filtration/Enums/FilterType.cs rename to Filtration.ObjectModel/Enums/FilterType.cs index 4d30d2d..c109ac7 100644 --- a/Filtration/Enums/FilterType.cs +++ b/Filtration.ObjectModel/Enums/FilterType.cs @@ -1,8 +1,8 @@ using System.ComponentModel; -namespace Filtration.Enums +namespace Filtration.ObjectModel.Enums { - internal enum FilterType + public enum FilterType { [Description("Show")] Show, diff --git a/Filtration/Enums/ItemRarity.cs b/Filtration.ObjectModel/Enums/ItemRarity.cs similarity index 78% rename from Filtration/Enums/ItemRarity.cs rename to Filtration.ObjectModel/Enums/ItemRarity.cs index 04b0daf..2e33b12 100644 --- a/Filtration/Enums/ItemRarity.cs +++ b/Filtration.ObjectModel/Enums/ItemRarity.cs @@ -1,8 +1,8 @@ using System.ComponentModel; -namespace Filtration.Enums +namespace Filtration.ObjectModel.Enums { - internal enum ItemRarity + public enum ItemRarity { [Description("Normal")] Normal, diff --git a/Filtration/Enums/SocketColor.cs b/Filtration.ObjectModel/Enums/SocketColor.cs similarity index 76% rename from Filtration/Enums/SocketColor.cs rename to Filtration.ObjectModel/Enums/SocketColor.cs index d495103..cb6cfa4 100644 --- a/Filtration/Enums/SocketColor.cs +++ b/Filtration.ObjectModel/Enums/SocketColor.cs @@ -1,8 +1,8 @@ using System.ComponentModel; -namespace Filtration.Enums +namespace Filtration.ObjectModel.Enums { - internal enum SocketColor + public enum SocketColor { [Description("R")] Red, diff --git a/Filtration/Extensions/EnumHelper.cs b/Filtration.ObjectModel/Extensions/EnumHelper.cs similarity index 93% rename from Filtration/Extensions/EnumHelper.cs rename to Filtration.ObjectModel/Extensions/EnumHelper.cs index 12b8f96..a8d3c76 100644 --- a/Filtration/Extensions/EnumHelper.cs +++ b/Filtration.ObjectModel/Extensions/EnumHelper.cs @@ -1,9 +1,9 @@ using System; using System.ComponentModel; -namespace Filtration.Extensions +namespace Filtration.ObjectModel.Extensions { - internal static class EnumHelper + public static class EnumHelper { public static T GetAttributeOfType(this Enum enumVal) where T : Attribute { diff --git a/Filtration.ObjectModel/Filtration.ObjectModel.csproj b/Filtration.ObjectModel/Filtration.ObjectModel.csproj new file mode 100644 index 0000000..2548419 --- /dev/null +++ b/Filtration.ObjectModel/Filtration.ObjectModel.csproj @@ -0,0 +1,92 @@ + + + + + Debug + AnyCPU + {4AAC3BEB-1DC1-483E-9D11-0E9334E80227} + Library + Properties + Filtration.ObjectModel + Filtration.ObjectModel + v4.5.1 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Filtration/Models/IAudioVisualBlockItem.cs b/Filtration.ObjectModel/IAudioVisualBlockItem.cs similarity index 58% rename from Filtration/Models/IAudioVisualBlockItem.cs rename to Filtration.ObjectModel/IAudioVisualBlockItem.cs index a808331..4dfb86b 100644 --- a/Filtration/Models/IAudioVisualBlockItem.cs +++ b/Filtration.ObjectModel/IAudioVisualBlockItem.cs @@ -1,8 +1,8 @@ using System.ComponentModel; -namespace Filtration.Models +namespace Filtration.ObjectModel { - internal interface IAudioVisualBlockItem + public interface IAudioVisualBlockItem { event PropertyChangedEventHandler PropertyChanged; } diff --git a/Filtration/Models/IItemFilterBlockItem.cs b/Filtration.ObjectModel/IItemFilterBlockItem.cs similarity index 78% rename from Filtration/Models/IItemFilterBlockItem.cs rename to Filtration.ObjectModel/IItemFilterBlockItem.cs index 0b71964..d438c15 100644 --- a/Filtration/Models/IItemFilterBlockItem.cs +++ b/Filtration.ObjectModel/IItemFilterBlockItem.cs @@ -1,9 +1,9 @@ using System.ComponentModel; using System.Windows.Media; -namespace Filtration.Models +namespace Filtration.ObjectModel { - internal interface IItemFilterBlockItem : INotifyPropertyChanged + public interface IItemFilterBlockItem : INotifyPropertyChanged { string PrefixText { get; } string OutputText { get; } diff --git a/Filtration/Models/ItemFilterBlock.cs b/Filtration.ObjectModel/ItemFilterBlock.cs similarity index 93% rename from Filtration/Models/ItemFilterBlock.cs rename to Filtration.ObjectModel/ItemFilterBlock.cs index 241038a..58e2445 100644 --- a/Filtration/Models/ItemFilterBlock.cs +++ b/Filtration.ObjectModel/ItemFilterBlock.cs @@ -1,12 +1,12 @@ using System; using System.Collections.ObjectModel; using System.Linq; -using Filtration.Enums; -using Filtration.Models.BlockItemBaseTypes; +using Filtration.ObjectModel.BlockItemBaseTypes; +using Filtration.ObjectModel.Enums; -namespace Filtration.Models +namespace Filtration.ObjectModel { - internal class ItemFilterBlock + public class ItemFilterBlock { private ItemFilterBlockGroup _blockGroup; @@ -100,7 +100,7 @@ namespace Filtration.Models { Action = BlockAction.Hide; } - else if (BlockGroup.IsChecked == true && Action == BlockAction.Hide) + else if (BlockGroup.IsChecked && Action == BlockAction.Hide) { Action = BlockAction.Show; } diff --git a/Filtration/Models/ItemFilterBlockGroup.cs b/Filtration.ObjectModel/ItemFilterBlockGroup.cs similarity index 96% rename from Filtration/Models/ItemFilterBlockGroup.cs rename to Filtration.ObjectModel/ItemFilterBlockGroup.cs index cbf906b..86e1153 100644 --- a/Filtration/Models/ItemFilterBlockGroup.cs +++ b/Filtration.ObjectModel/ItemFilterBlockGroup.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; -namespace Filtration.Models +namespace Filtration.ObjectModel { - internal class ItemFilterBlockGroup + public class ItemFilterBlockGroup { private bool _isChecked; diff --git a/Filtration/Models/ItemFilterScript.cs b/Filtration.ObjectModel/ItemFilterScript.cs similarity index 97% rename from Filtration/Models/ItemFilterScript.cs rename to Filtration.ObjectModel/ItemFilterScript.cs index 50b16b1..4dd8fc9 100644 --- a/Filtration/Models/ItemFilterScript.cs +++ b/Filtration.ObjectModel/ItemFilterScript.cs @@ -2,11 +2,11 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using Filtration.Models.BlockItemTypes; +using Filtration.ObjectModel.BlockItemTypes; -namespace Filtration.Models +namespace Filtration.ObjectModel { - internal class ItemFilterScript + public class ItemFilterScript { public ItemFilterScript() { diff --git a/Filtration.ObjectModel/ItemFilterSection.cs b/Filtration.ObjectModel/ItemFilterSection.cs new file mode 100644 index 0000000..4a2ecbf --- /dev/null +++ b/Filtration.ObjectModel/ItemFilterSection.cs @@ -0,0 +1,6 @@ +namespace Filtration.ObjectModel +{ + public class ItemFilterSection : ItemFilterBlock + { + } +} diff --git a/Filtration/Models/NumericFilterPredicate.cs b/Filtration.ObjectModel/NumericFilterPredicate.cs similarity index 87% rename from Filtration/Models/NumericFilterPredicate.cs rename to Filtration.ObjectModel/NumericFilterPredicate.cs index e6d3188..d23e273 100644 --- a/Filtration/Models/NumericFilterPredicate.cs +++ b/Filtration.ObjectModel/NumericFilterPredicate.cs @@ -1,12 +1,12 @@ using System.ComponentModel; using System.Runtime.CompilerServices; -using Filtration.Annotations; -using Filtration.Enums; -using Filtration.Extensions; +using Filtration.ObjectModel.Annotations; +using Filtration.ObjectModel.Enums; +using Filtration.ObjectModel.Extensions; -namespace Filtration.Models +namespace Filtration.ObjectModel { - internal class NumericFilterPredicate : INotifyPropertyChanged + public class NumericFilterPredicate : INotifyPropertyChanged { private FilterPredicateOperator _predicateOperator; private int _predicateOperand; diff --git a/Filtration.ObjectModel/Properties/Annotations.cs b/Filtration.ObjectModel/Properties/Annotations.cs new file mode 100644 index 0000000..c30d43a --- /dev/null +++ b/Filtration.ObjectModel/Properties/Annotations.cs @@ -0,0 +1,937 @@ +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable CheckNamespace + +namespace Filtration.ObjectModel.Annotations +{ + /// + /// Indicates that the value of the marked element could be null sometimes, + /// so the check for null is necessary before its usage. + /// + /// + /// [CanBeNull] public object Test() { return null; } + /// public void UseTest() { + /// var p = Test(); + /// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException' + /// } + /// + [AttributeUsage( + AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | + AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event)] + public sealed class CanBeNullAttribute : Attribute { } + + /// + /// Indicates that the value of the marked element could never be null. + /// + /// + /// [NotNull] public object Foo() { + /// return null; // Warning: Possible 'null' assignment + /// } + /// + [AttributeUsage( + AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | + AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event)] + public sealed class NotNullAttribute : Attribute { } + + /// + /// Indicates that collection or enumerable value does not contain null elements. + /// + [AttributeUsage( + AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | + AttributeTargets.Delegate | AttributeTargets.Field)] + public sealed class ItemNotNullAttribute : Attribute { } + + /// + /// Indicates that collection or enumerable value can contain null elements. + /// + [AttributeUsage( + AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | + AttributeTargets.Delegate | AttributeTargets.Field)] + public sealed class ItemCanBeNullAttribute : Attribute { } + + /// + /// Indicates that the marked method builds string by format pattern and (optional) arguments. + /// Parameter, which contains format string, should be given in constructor. The format string + /// should be in -like form. + /// + /// + /// [StringFormatMethod("message")] + /// public void ShowError(string message, params object[] args) { /* do something */ } + /// public void Foo() { + /// ShowError("Failed: {0}"); // Warning: Non-existing argument in format string + /// } + /// + [AttributeUsage( + AttributeTargets.Constructor | AttributeTargets.Method | + AttributeTargets.Property | AttributeTargets.Delegate)] + public sealed class StringFormatMethodAttribute : Attribute + { + /// + /// Specifies which parameter of an annotated method should be treated as format-string + /// + public StringFormatMethodAttribute(string formatParameterName) + { + FormatParameterName = formatParameterName; + } + + public string FormatParameterName { get; private set; } + } + + /// + /// For a parameter that is expected to be one of the limited set of values. + /// Specify fields of which type should be used as values for this parameter. + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)] + public sealed class ValueProviderAttribute : Attribute + { + public ValueProviderAttribute(string name) + { + Name = name; + } + + [NotNull] public string Name { get; private set; } + } + + /// + /// Indicates that the function argument should be string literal and match one + /// of the parameters of the caller function. For example, ReSharper annotates + /// the parameter of . + /// + /// + /// public void Foo(string param) { + /// if (param == null) + /// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol + /// } + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class InvokerParameterNameAttribute : Attribute { } + + /// + /// Indicates that the method is contained in a type that implements + /// System.ComponentModel.INotifyPropertyChanged interface and this method + /// is used to notify that some property value changed. + /// + /// + /// The method should be non-static and conform to one of the supported signatures: + /// + /// NotifyChanged(string) + /// NotifyChanged(params string[]) + /// NotifyChanged{T}(Expression{Func{T}}) + /// NotifyChanged{T,U}(Expression{Func{T,U}}) + /// SetProperty{T}(ref T, T, string) + /// + /// + /// + /// public class Foo : INotifyPropertyChanged { + /// public event PropertyChangedEventHandler PropertyChanged; + /// [NotifyPropertyChangedInvocator] + /// protected virtual void NotifyChanged(string propertyName) { ... } + /// + /// private string _name; + /// public string Name { + /// get { return _name; } + /// set { _name = value; NotifyChanged("LastName"); /* Warning */ } + /// } + /// } + /// + /// Examples of generated notifications: + /// + /// NotifyChanged("Property") + /// NotifyChanged(() => Property) + /// NotifyChanged((VM x) => x.Property) + /// SetProperty(ref myField, value, "Property") + /// + /// + [AttributeUsage(AttributeTargets.Method)] + public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute + { + public NotifyPropertyChangedInvocatorAttribute() { } + public NotifyPropertyChangedInvocatorAttribute(string parameterName) + { + ParameterName = parameterName; + } + + public string ParameterName { get; private set; } + } + + /// + /// Describes dependency between method input and output. + /// + /// + ///

Function Definition Table syntax:

+ /// + /// FDT ::= FDTRow [;FDTRow]* + /// FDTRow ::= Input => Output | Output <= Input + /// Input ::= ParameterName: Value [, Input]* + /// Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value} + /// Value ::= true | false | null | notnull | canbenull + /// + /// If method has single input parameter, it's name could be omitted.
+ /// Using halt (or void/nothing, which is the same) + /// for method output means that the methos doesn't return normally.
+ /// canbenull annotation is only applicable for output parameters.
+ /// You can use multiple [ContractAnnotation] for each FDT row, + /// or use single attribute with rows separated by semicolon.
+ ///
+ /// + /// + /// [ContractAnnotation("=> halt")] + /// public void TerminationMethod() + /// + /// + /// [ContractAnnotation("halt <= condition: false")] + /// public void Assert(bool condition, string text) // regular assertion method + /// + /// + /// [ContractAnnotation("s:null => true")] + /// public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty() + /// + /// + /// // A method that returns null if the parameter is null, + /// // and not null if the parameter is not null + /// [ContractAnnotation("null => null; notnull => notnull")] + /// public object Transform(object data) + /// + /// + /// [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")] + /// public bool TryParse(string s, out Person result) + /// + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] + public sealed class ContractAnnotationAttribute : Attribute + { + public ContractAnnotationAttribute([NotNull] string contract) + : this(contract, false) { } + + public ContractAnnotationAttribute([NotNull] string contract, bool forceFullStates) + { + Contract = contract; + ForceFullStates = forceFullStates; + } + + public string Contract { get; private set; } + public bool ForceFullStates { get; private set; } + } + + /// + /// Indicates that marked element should be localized or not. + /// + /// + /// [LocalizationRequiredAttribute(true)] + /// public class Foo { + /// private string str = "my string"; // Warning: Localizable string + /// } + /// + [AttributeUsage(AttributeTargets.All)] + public sealed class LocalizationRequiredAttribute : Attribute + { + public LocalizationRequiredAttribute() : this(true) { } + public LocalizationRequiredAttribute(bool required) + { + Required = required; + } + + public bool Required { get; private set; } + } + + /// + /// Indicates that the value of the marked type (or its derivatives) + /// cannot be compared using '==' or '!=' operators and Equals() + /// should be used instead. However, using '==' or '!=' for comparison + /// with null is always permitted. + /// + /// + /// [CannotApplyEqualityOperator] + /// class NoEquality { } + /// class UsesNoEquality { + /// public void Test() { + /// var ca1 = new NoEquality(); + /// var ca2 = new NoEquality(); + /// if (ca1 != null) { // OK + /// bool condition = ca1 == ca2; // Warning + /// } + /// } + /// } + /// + [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct)] + public sealed class CannotApplyEqualityOperatorAttribute : Attribute { } + + /// + /// When applied to a target attribute, specifies a requirement for any type marked + /// with the target attribute to implement or inherit specific type or types. + /// + /// + /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement + /// public class ComponentAttribute : Attribute { } + /// [Component] // ComponentAttribute requires implementing IComponent interface + /// public class MyComponent : IComponent { } + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] + [BaseTypeRequired(typeof(Attribute))] + public sealed class BaseTypeRequiredAttribute : Attribute + { + public BaseTypeRequiredAttribute([NotNull] Type baseType) + { + BaseType = baseType; + } + + [NotNull] public Type BaseType { get; private set; } + } + + /// + /// Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library), + /// so this symbol will not be marked as unused (as well as by other usage inspections). + /// + [AttributeUsage(AttributeTargets.All)] + public sealed class UsedImplicitlyAttribute : Attribute + { + public UsedImplicitlyAttribute() + : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } + + public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags) + : this(useKindFlags, ImplicitUseTargetFlags.Default) { } + + public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags) + : this(ImplicitUseKindFlags.Default, targetFlags) { } + + public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) + { + UseKindFlags = useKindFlags; + TargetFlags = targetFlags; + } + + public ImplicitUseKindFlags UseKindFlags { get; private set; } + public ImplicitUseTargetFlags TargetFlags { get; private set; } + } + + /// + /// Should be used on attributes and causes ReSharper to not mark symbols marked with such attributes + /// as unused (as well as by other usage inspections) + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.GenericParameter)] + public sealed class MeansImplicitUseAttribute : Attribute + { + public MeansImplicitUseAttribute() + : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } + + public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags) + : this(useKindFlags, ImplicitUseTargetFlags.Default) { } + + public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags) + : this(ImplicitUseKindFlags.Default, targetFlags) { } + + public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) + { + UseKindFlags = useKindFlags; + TargetFlags = targetFlags; + } + + [UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; private set; } + [UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; private set; } + } + + [Flags] + public enum ImplicitUseKindFlags + { + Default = Access | Assign | InstantiatedWithFixedConstructorSignature, + /// Only entity marked with attribute considered used. + Access = 1, + /// Indicates implicit assignment to a member. + Assign = 2, + /// + /// Indicates implicit instantiation of a type with fixed constructor signature. + /// That means any unused constructor parameters won't be reported as such. + /// + InstantiatedWithFixedConstructorSignature = 4, + /// Indicates implicit instantiation of a type. + InstantiatedNoFixedConstructorSignature = 8, + } + + /// + /// Specify what is considered used implicitly when marked + /// with or . + /// + [Flags] + public enum ImplicitUseTargetFlags + { + Default = Itself, + Itself = 1, + /// Members of entity marked with attribute are considered used. + Members = 2, + /// Entity marked with attribute and all its members considered used. + WithMembers = Itself | Members + } + + /// + /// This attribute is intended to mark publicly available API + /// which should not be removed and so is treated as used. + /// + [MeansImplicitUse(ImplicitUseTargetFlags.WithMembers)] + public sealed class PublicAPIAttribute : Attribute + { + public PublicAPIAttribute() { } + public PublicAPIAttribute([NotNull] string comment) + { + Comment = comment; + } + + public string Comment { get; private set; } + } + + /// + /// Tells code analysis engine if the parameter is completely handled when the invoked method is on stack. + /// If the parameter is a delegate, indicates that delegate is executed while the method is executed. + /// If the parameter is an enumerable, indicates that it is enumerated while the method is executed. + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class InstantHandleAttribute : Attribute { } + + /// + /// Indicates that a method does not make any observable state changes. + /// The same as System.Diagnostics.Contracts.PureAttribute. + /// + /// + /// [Pure] private int Multiply(int x, int y) { return x * y; } + /// public void Foo() { + /// const int a = 2, b = 2; + /// Multiply(a, b); // Waring: Return value of pure method is not used + /// } + /// + [AttributeUsage(AttributeTargets.Method)] + public sealed class PureAttribute : Attribute { } + + /// + /// Indicates that a parameter is a path to a file or a folder within a web project. + /// Path can be relative or absolute, starting from web root (~). + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class PathReferenceAttribute : Attribute + { + public PathReferenceAttribute() { } + public PathReferenceAttribute([PathReference] string basePath) + { + BasePath = basePath; + } + + public string BasePath { get; private set; } + } + + /// + /// An extension method marked with this attribute is processed by ReSharper code completion + /// as a 'Source Template'. When extension method is completed over some expression, it's source code + /// is automatically expanded like a template at call site. + /// + /// + /// Template method body can contain valid source code and/or special comments starting with '$'. + /// Text inside these comments is added as source code when the template is applied. Template parameters + /// can be used either as additional method parameters or as identifiers wrapped in two '$' signs. + /// Use the attribute to specify macros for parameters. + /// + /// + /// In this example, the 'forEach' method is a source template available over all values + /// of enumerable types, producing ordinary C# 'foreach' statement and placing caret inside block: + /// + /// [SourceTemplate] + /// public static void forEach<T>(this IEnumerable<T> xs) { + /// foreach (var x in xs) { + /// //$ $END$ + /// } + /// } + /// + /// + [AttributeUsage(AttributeTargets.Method)] + public sealed class SourceTemplateAttribute : Attribute { } + + /// + /// Allows specifying a macro for a parameter of a source template. + /// + /// + /// You can apply the attribute on the whole method or on any of its additional parameters. The macro expression + /// is defined in the property. When applied on a method, the target + /// template parameter is defined in the property. To apply the macro silently + /// for the parameter, set the property value = -1. + /// + /// + /// Applying the attribute on a source template method: + /// + /// [SourceTemplate, Macro(Target = "item", Expression = "suggestVariableName()")] + /// public static void forEach<T>(this IEnumerable<T> collection) { + /// foreach (var item in collection) { + /// //$ $END$ + /// } + /// } + /// + /// Applying the attribute on a template method parameter: + /// + /// [SourceTemplate] + /// public static void something(this Entity x, [Macro(Expression = "guid()", Editable = -1)] string newguid) { + /// /*$ var $x$Id = "$newguid$" + x.ToString(); + /// x.DoSomething($x$Id); */ + /// } + /// + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, AllowMultiple = true)] + public sealed class MacroAttribute : Attribute + { + /// + /// Allows specifying a macro that will be executed for a source template + /// parameter when the template is expanded. + /// + public string Expression { get; set; } + + /// + /// Allows specifying which occurrence of the target parameter becomes editable when the template is deployed. + /// + /// + /// If the target parameter is used several times in the template, only one occurrence becomes editable; + /// other occurrences are changed synchronously. To specify the zero-based index of the editable occurrence, + /// use values >= 0. To make the parameter non-editable when the template is expanded, use -1. + /// > + public int Editable { get; set; } + + /// + /// Identifies the target parameter of a source template if the + /// is applied on a template method. + /// + public string Target { get; set; } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class AspMvcAreaMasterLocationFormatAttribute : Attribute + { + public AspMvcAreaMasterLocationFormatAttribute(string format) + { + Format = format; + } + + public string Format { get; private set; } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class AspMvcAreaPartialViewLocationFormatAttribute : Attribute + { + public AspMvcAreaPartialViewLocationFormatAttribute(string format) + { + Format = format; + } + + public string Format { get; private set; } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class AspMvcAreaViewLocationFormatAttribute : Attribute + { + public AspMvcAreaViewLocationFormatAttribute(string format) + { + Format = format; + } + + public string Format { get; private set; } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class AspMvcMasterLocationFormatAttribute : Attribute + { + public AspMvcMasterLocationFormatAttribute(string format) + { + Format = format; + } + + public string Format { get; private set; } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class AspMvcPartialViewLocationFormatAttribute : Attribute + { + public AspMvcPartialViewLocationFormatAttribute(string format) + { + Format = format; + } + + public string Format { get; private set; } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class AspMvcViewLocationFormatAttribute : Attribute + { + public AspMvcViewLocationFormatAttribute(string format) + { + Format = format; + } + + public string Format { get; private set; } + } + + /// + /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter + /// is an MVC action. If applied to a method, the MVC action name is calculated + /// implicitly from the context. Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String). + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class AspMvcActionAttribute : Attribute + { + public AspMvcActionAttribute() { } + public AspMvcActionAttribute(string anonymousProperty) + { + AnonymousProperty = anonymousProperty; + } + + public string AnonymousProperty { get; private set; } + } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC area. + /// Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String). + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcAreaAttribute : Attribute + { + public AspMvcAreaAttribute() { } + public AspMvcAreaAttribute(string anonymousProperty) + { + AnonymousProperty = anonymousProperty; + } + + public string AnonymousProperty { get; private set; } + } + + /// + /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is + /// an MVC controller. If applied to a method, the MVC controller name is calculated + /// implicitly from the context. Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String). + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class AspMvcControllerAttribute : Attribute + { + public AspMvcControllerAttribute() { } + public AspMvcControllerAttribute(string anonymousProperty) + { + AnonymousProperty = anonymousProperty; + } + + public string AnonymousProperty { get; private set; } + } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC Master. Use this attribute + /// for custom wrappers similar to System.Web.Mvc.Controller.View(String, String). + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcMasterAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC model type. Use this attribute + /// for custom wrappers similar to System.Web.Mvc.Controller.View(String, Object). + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcModelTypeAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC + /// partial view. If applied to a method, the MVC partial view name is calculated implicitly + /// from the context. Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String). + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class AspMvcPartialViewAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. Allows disabling inspections for MVC views within a class or a method. + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] + public sealed class AspMvcSupressViewErrorAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template. + /// Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String). + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcDisplayTemplateAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template. + /// Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String). + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcEditorTemplateAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC template. + /// Use this attribute for custom wrappers similar to + /// System.ComponentModel.DataAnnotations.UIHintAttribute(System.String). + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcTemplateAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter + /// is an MVC view. If applied to a method, the MVC view name is calculated implicitly + /// from the context. Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Controller.View(Object). + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class AspMvcViewAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. When applied to a parameter of an attribute, + /// indicates that this parameter is an MVC action name. + /// + /// + /// [ActionName("Foo")] + /// public ActionResult Login(string returnUrl) { + /// ViewBag.ReturnUrl = Url.Action("Foo"); // OK + /// return RedirectToAction("Bar"); // Error: Cannot resolve action + /// } + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)] + public sealed class AspMvcActionSelectorAttribute : Attribute { } + + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)] + public sealed class HtmlElementAttributesAttribute : Attribute + { + public HtmlElementAttributesAttribute() { } + public HtmlElementAttributesAttribute(string name) + { + Name = name; + } + + public string Name { get; private set; } + } + + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)] + public sealed class HtmlAttributeValueAttribute : Attribute + { + public HtmlAttributeValueAttribute([NotNull] string name) + { + Name = name; + } + + [NotNull] public string Name { get; private set; } + } + + /// + /// Razor attribute. Indicates that a parameter or a method is a Razor section. + /// Use this attribute for custom wrappers similar to + /// System.Web.WebPages.WebPageBase.RenderSection(String). + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class RazorSectionAttribute : Attribute { } + + /// + /// Indicates how method invocation affects content of the collection. + /// + [AttributeUsage(AttributeTargets.Method)] + public sealed class CollectionAccessAttribute : Attribute + { + public CollectionAccessAttribute(CollectionAccessType collectionAccessType) + { + CollectionAccessType = collectionAccessType; + } + + public CollectionAccessType CollectionAccessType { get; private set; } + } + + [Flags] + public enum CollectionAccessType + { + /// Method does not use or modify content of the collection. + None = 0, + /// Method only reads content of the collection but does not modify it. + Read = 1, + /// Method can change content of the collection but does not add new elements. + ModifyExistingContent = 2, + /// Method can add new elements to the collection. + UpdatedContent = ModifyExistingContent | 4 + } + + /// + /// Indicates that the marked method is assertion method, i.e. it halts control flow if + /// one of the conditions is satisfied. To set the condition, mark one of the parameters with + /// attribute. + /// + [AttributeUsage(AttributeTargets.Method)] + public sealed class AssertionMethodAttribute : Attribute { } + + /// + /// Indicates the condition parameter of the assertion method. The method itself should be + /// marked by attribute. The mandatory argument of + /// the attribute is the assertion type. + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AssertionConditionAttribute : Attribute + { + public AssertionConditionAttribute(AssertionConditionType conditionType) + { + ConditionType = conditionType; + } + + public AssertionConditionType ConditionType { get; private set; } + } + + /// + /// Specifies assertion type. If the assertion method argument satisfies the condition, + /// then the execution continues. Otherwise, execution is assumed to be halted. + /// + public enum AssertionConditionType + { + /// Marked parameter should be evaluated to true. + IS_TRUE = 0, + /// Marked parameter should be evaluated to false. + IS_FALSE = 1, + /// Marked parameter should be evaluated to null value. + IS_NULL = 2, + /// Marked parameter should be evaluated to not null value. + IS_NOT_NULL = 3, + } + + /// + /// Indicates that the marked method unconditionally terminates control flow execution. + /// For example, it could unconditionally throw exception. + /// + [Obsolete("Use [ContractAnnotation('=> halt')] instead")] + [AttributeUsage(AttributeTargets.Method)] + public sealed class TerminatesProgramAttribute : Attribute { } + + /// + /// Indicates that method is pure LINQ method, with postponed enumeration (like Enumerable.Select, + /// .Where). This annotation allows inference of [InstantHandle] annotation for parameters + /// of delegate type by analyzing LINQ method chains. + /// + [AttributeUsage(AttributeTargets.Method)] + public sealed class LinqTunnelAttribute : Attribute { } + + /// + /// Indicates that IEnumerable, passed as parameter, is not enumerated. + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class NoEnumerationAttribute : Attribute { } + + /// + /// Indicates that parameter is regular expression pattern. + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class RegexPatternAttribute : Attribute { } + + /// + /// XAML attribute. Indicates the type that has ItemsSource property and should be treated + /// as ItemsControl-derived type, to enable inner items DataContext type resolve. + /// + [AttributeUsage(AttributeTargets.Class)] + public sealed class XamlItemsControlAttribute : Attribute { } + + /// + /// XAML attibute. Indicates the property of some BindingBase-derived type, that + /// is used to bind some item of ItemsControl-derived type. This annotation will + /// enable the DataContext type resolve for XAML bindings for such properties. + /// + /// + /// Property should have the tree ancestor of the ItemsControl type or + /// marked with the attribute. + /// + [AttributeUsage(AttributeTargets.Property)] + public sealed class XamlItemBindingOfItemsControlAttribute : Attribute { } + + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] + public sealed class AspChildControlTypeAttribute : Attribute + { + public AspChildControlTypeAttribute(string tagName, Type controlType) + { + TagName = tagName; + ControlType = controlType; + } + + public string TagName { get; private set; } + public Type ControlType { get; private set; } + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)] + public sealed class AspDataFieldAttribute : Attribute { } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)] + public sealed class AspDataFieldsAttribute : Attribute { } + + [AttributeUsage(AttributeTargets.Property)] + public sealed class AspMethodPropertyAttribute : Attribute { } + + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] + public sealed class AspRequiredAttributeAttribute : Attribute + { + public AspRequiredAttributeAttribute([NotNull] string attribute) + { + Attribute = attribute; + } + + public string Attribute { get; private set; } + } + + [AttributeUsage(AttributeTargets.Property)] + public sealed class AspTypePropertyAttribute : Attribute + { + public bool CreateConstructorReferences { get; private set; } + + public AspTypePropertyAttribute(bool createConstructorReferences) + { + CreateConstructorReferences = createConstructorReferences; + } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class RazorImportNamespaceAttribute : Attribute + { + public RazorImportNamespaceAttribute(string name) + { + Name = name; + } + + public string Name { get; private set; } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class RazorInjectionAttribute : Attribute + { + public RazorInjectionAttribute(string type, string fieldName) + { + Type = type; + FieldName = fieldName; + } + + public string Type { get; private set; } + public string FieldName { get; private set; } + } + + [AttributeUsage(AttributeTargets.Method)] + public sealed class RazorHelperCommonAttribute : Attribute { } + + [AttributeUsage(AttributeTargets.Property)] + public sealed class RazorLayoutAttribute : Attribute { } + + [AttributeUsage(AttributeTargets.Method)] + public sealed class RazorWriteLiteralMethodAttribute : Attribute { } + + [AttributeUsage(AttributeTargets.Method)] + public sealed class RazorWriteMethodAttribute : Attribute { } + + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class RazorWriteMethodParameterAttribute : Attribute { } + + /// + /// Prevents the Member Reordering feature from tossing members of the marked class. + /// + /// + /// The attribute must be mentioned in your member reordering patterns + /// + [AttributeUsage(AttributeTargets.All)] + public sealed class NoReorder : Attribute { } +} \ No newline at end of file diff --git a/Filtration.ObjectModel/Properties/AssemblyInfo.cs b/Filtration.ObjectModel/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6ecac2f --- /dev/null +++ b/Filtration.ObjectModel/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Filtration.ObjectModel")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Filtration.ObjectModel")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1b4dc4e6-68eb-4586-8570-63e9196fb1de")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Filtration/Models/ReplaceColorsParameterSet.cs b/Filtration.ObjectModel/ReplaceColorsParameterSet.cs similarity index 87% rename from Filtration/Models/ReplaceColorsParameterSet.cs rename to Filtration.ObjectModel/ReplaceColorsParameterSet.cs index 60095d4..c84b2e7 100644 --- a/Filtration/Models/ReplaceColorsParameterSet.cs +++ b/Filtration.ObjectModel/ReplaceColorsParameterSet.cs @@ -1,8 +1,8 @@ using System.Windows.Media; -namespace Filtration.Models +namespace Filtration.ObjectModel { - internal class ReplaceColorsParameterSet + public class ReplaceColorsParameterSet { public Color OldTextColor { get; set; } public Color NewTextColor { get; set; } diff --git a/Filtration.Tests/Filtration.Tests.csproj b/Filtration.Tests/Filtration.Tests.csproj index 042eb0d..4bee279 100644 --- a/Filtration.Tests/Filtration.Tests.csproj +++ b/Filtration.Tests/Filtration.Tests.csproj @@ -46,9 +46,6 @@ - - - @@ -61,9 +58,14 @@ + + + {4aac3beb-1dc1-483e-9d11-0e9334e80227} + Filtration.ObjectModel + {55e0a34c-e039-43d7-a024-a4045401cdda} Filtration diff --git a/Filtration.Tests/Properties/AssemblyInfo.cs b/Filtration.Tests/Properties/AssemblyInfo.cs index 0613ed4..dfa7861 100644 --- a/Filtration.Tests/Properties/AssemblyInfo.cs +++ b/Filtration.Tests/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Filtration.Tests/Repositories/TestItemFilterScriptRepository.cs b/Filtration.Tests/Repositories/TestItemFilterScriptRepository.cs index b73fae7..8ac2d25 100644 --- a/Filtration.Tests/Repositories/TestItemFilterScriptRepository.cs +++ b/Filtration.Tests/Repositories/TestItemFilterScriptRepository.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.IO; using Filtration.Repositories; using Filtration.Services; using Filtration.ViewModels; diff --git a/Filtration.Tests/Services/TestItemFilterPersistenceService.cs b/Filtration.Tests/Services/TestItemFilterPersistenceService.cs index 47073db..f53ec86 100644 --- a/Filtration.Tests/Services/TestItemFilterPersistenceService.cs +++ b/Filtration.Tests/Services/TestItemFilterPersistenceService.cs @@ -1,5 +1,5 @@ using System.IO; -using Filtration.Models; +using Filtration.ObjectModel; using Filtration.Services; using Filtration.Translators; using Moq; @@ -75,7 +75,7 @@ namespace Filtration.Tests.Services var service = new ItemFilterPersistenceService(mockFileSystemService.Object, mockItemFilterScriptTranslator.Object); // Act - var result = service.DefaultPathOfExileDirectory(); + service.DefaultPathOfExileDirectory(); // Assert mockFileSystemService.Verify(); diff --git a/Filtration.Tests/Translators/TestItemFilterBlockTranslator.cs b/Filtration.Tests/Translators/TestItemFilterBlockTranslator.cs index 31b524a..f7833b7 100644 --- a/Filtration.Tests/Translators/TestItemFilterBlockTranslator.cs +++ b/Filtration.Tests/Translators/TestItemFilterBlockTranslator.cs @@ -2,10 +2,10 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Media; -using Filtration.Enums; -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.Translators; using Moq; using NUnit.Framework; @@ -49,7 +49,7 @@ namespace Filtration.Tests.Translators // Act _testUtility.MockBlockGroupHierarchyBuilder.Setup(b => b.IntegrateStringListIntoBlockGroupHierarchy(It.IsAny>())).Returns(inputBlockGroup).Verifiable(); - var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString); + _testUtility.Translator.TranslateStringToItemFilterBlock(inputString); // Assert _testUtility.MockBlockGroupHierarchyBuilder.Verify(); @@ -93,7 +93,7 @@ namespace Filtration.Tests.Translators // Act _testUtility.MockBlockGroupHierarchyBuilder.Setup(b => b.IntegrateStringListIntoBlockGroupHierarchy(It.IsAny>())).Verifiable(); - var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString); + _testUtility.Translator.TranslateStringToItemFilterBlock(inputString); // Assert _testUtility.MockBlockGroupHierarchyBuilder.Verify(b => b.IntegrateStringListIntoBlockGroupHierarchy(It.IsAny>()), Times.Never); @@ -107,7 +107,7 @@ namespace Filtration.Tests.Translators // Act _testUtility.MockBlockGroupHierarchyBuilder.Setup(b => b.IntegrateStringListIntoBlockGroupHierarchy(It.IsAny>())).Verifiable(); - var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString); + _testUtility.Translator.TranslateStringToItemFilterBlock(inputString); // Assert _testUtility.MockBlockGroupHierarchyBuilder.Verify(b => b.IntegrateStringListIntoBlockGroupHierarchy(It.IsAny>()), Times.Never); @@ -1211,7 +1211,7 @@ namespace Filtration.Tests.Translators public void TranslateItemFilterBlockToString_Section_ReturnsCorrectString() { // Arrange - var TestInputSectionText = "Ermagerd it's a section!"; + const string TestInputSectionText = "Ermagerd it's a section!"; var expectedResult = "# Section: " + TestInputSectionText; _testUtility.TestBlock = new ItemFilterSection { Description = TestInputSectionText }; @@ -1233,14 +1233,14 @@ namespace Filtration.Tests.Translators " DropLevel != 56" + Environment.NewLine + " Quality > 2" + Environment.NewLine + " Rarity = Unique" + Environment.NewLine + - " Class \"Body Armour\" \"Gloves\" \"Belt\" \"Two Hand Axes\"" + Environment.NewLine + - " BaseType \"Greater Life Flask\" \"Simple Robe\" \"Full Wyrmscale\"" + - Environment.NewLine + " Sockets <= 6" + Environment.NewLine + " LinkedSockets >= 4" + Environment.NewLine + " Width = 3" + Environment.NewLine + " Height <= 6" + Environment.NewLine + " Height >= 2" + Environment.NewLine + + " Class \"Body Armour\" \"Gloves\" \"Belt\" \"Two Hand Axes\"" + Environment.NewLine + + " BaseType \"Greater Life Flask\" \"Simple Robe\" \"Full Wyrmscale\"" + + Environment.NewLine + " SetTextColor 255 89 0 56" + Environment.NewLine + " SetBackgroundColor 0 0 0" + Environment.NewLine + " SetBorderColor 255 1 254" + Environment.NewLine + diff --git a/Filtration.Tests/Translators/TestItemFilterScriptTranslator.cs b/Filtration.Tests/Translators/TestItemFilterScriptTranslator.cs index 5304938..612c880 100644 --- a/Filtration.Tests/Translators/TestItemFilterScriptTranslator.cs +++ b/Filtration.Tests/Translators/TestItemFilterScriptTranslator.cs @@ -1,9 +1,9 @@ using System; using System.IO; using System.Linq; -using Filtration.Enums; -using Filtration.Models; -using Filtration.Models.BlockItemTypes; +using Filtration.ObjectModel; +using Filtration.ObjectModel.BlockItemTypes; +using Filtration.ObjectModel.Enums; using Filtration.Translators; using Moq; using NUnit.Framework; @@ -71,7 +71,7 @@ namespace Filtration.Tests.Translators var translator = new ItemFilterScriptTranslator(blockTranslator, mockBlockGroupHierarchyBuilder.Object); // Act - var script = translator.TranslateStringToItemFilterScript(testInput); + translator.TranslateStringToItemFilterScript(testInput); // Assert // Not crashing out when loading a huge script means this integration test has passed! } @@ -85,7 +85,7 @@ namespace Filtration.Tests.Translators var testBlock = new ItemFilterBlock(); testBlock.BlockItems.Add(new ItemLevelBlockItem(FilterPredicateOperator.Equal, 5)); - var BlockOutput = "Test Script Output"; + const string BlockOutput = "Test Script Output"; testScript.ItemFilterBlocks.Add(testBlock); @@ -93,7 +93,7 @@ namespace Filtration.Tests.Translators // Act - var result = _testUtility.ScriptTranslator.TranslateItemFilterScriptToString(testScript); + _testUtility.ScriptTranslator.TranslateItemFilterScriptToString(testScript); // Assert _testUtility.MockItemFilterBlockTranslator.Verify(); diff --git a/Filtration.sln b/Filtration.sln index cf51ce8..1622944 100644 --- a/Filtration.sln +++ b/Filtration.sln @@ -7,6 +7,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Filtration", "Filtration\Fi EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Filtration.Tests", "Filtration.Tests\Filtration.Tests.csproj", "{E0693972-72C5-4E05-A9C5-A5943E4015C6}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Filtration.ObjectModel", "Filtration.ObjectModel\Filtration.ObjectModel.csproj", "{4AAC3BEB-1DC1-483E-9D11-0E9334E80227}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Filtration.ObjectModel.Tests", "Filtration.ObjectModel.Tests\Filtration.ObjectModel.Tests.csproj", "{537BE676-2FF6-4995-B05B-9CFACE852EC9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +25,14 @@ Global {E0693972-72C5-4E05-A9C5-A5943E4015C6}.Debug|Any CPU.Build.0 = Debug|Any CPU {E0693972-72C5-4E05-A9C5-A5943E4015C6}.Release|Any CPU.ActiveCfg = Release|Any CPU {E0693972-72C5-4E05-A9C5-A5943E4015C6}.Release|Any CPU.Build.0 = Release|Any CPU + {4AAC3BEB-1DC1-483E-9D11-0E9334E80227}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4AAC3BEB-1DC1-483E-9D11-0E9334E80227}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4AAC3BEB-1DC1-483E-9D11-0E9334E80227}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4AAC3BEB-1DC1-483E-9D11-0E9334E80227}.Release|Any CPU.Build.0 = Release|Any CPU + {537BE676-2FF6-4995-B05B-9CFACE852EC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {537BE676-2FF6-4995-B05B-9CFACE852EC9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {537BE676-2FF6-4995-B05B-9CFACE852EC9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {537BE676-2FF6-4995-B05B-9CFACE852EC9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Filtration/App.xaml.cs b/Filtration/App.xaml.cs index 6c991f5..0f66f22 100644 --- a/Filtration/App.xaml.cs +++ b/Filtration/App.xaml.cs @@ -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() - // .ForMember(dest => dest.IsChecked, - // opts => opts.MapFrom(from => from.IsChecked)) - // .ForMember(dest => dest.SourceBlockGroup, - // opts => opts.MapFrom(from => from)); - - //Mapper.CreateMap() - // .ForMember(dest => dest.IsChecked, - // opts => opts.MapFrom(from => from.IsChecked)) - // .ForMember(dest => dest.ChildGroups, - // opts => opts.ResolveUsing()) - // .ForMember(dest => dest.SourceBlockGroup, - // opts => opts.MapFrom(from => from)); - - //.ForMember(dest => dest.ChildGroups, - // opts => opts.Condition(src => src.Advanced == false)) - - //opts => opts.ResolveUsing()) - - //opts => opts.MapFrom(from => from.ChildGroups)) - - //Mapper.AssertConfigurationIsValid(); - var mainWindow = _container.Resolve(); mainWindow.Show(); } - - //private class ChildGroupsResolver : ValueResolver - //{ - // protected override ItemFilterBlockGroupViewModel ResolveCore(ItemFilterBlockGroup source) - // { - // return !source.Advanced ? Mapper.Map(source) : null; - // } - //} - - //private class ChildGroupsResolver : - // ValueResolver, ObservableCollection> - //{ - // protected override ObservableCollection ResolveCore(List source) - // { - // var result = new ObservableCollection(); - - // if (source != null && source.Count > 0) - // { - - // var filteredSource = source.Where(g => g.Advanced == false); - // foreach (var blockGroup in filteredSource) - // { - // result.Add(Mapper.Map(blockGroup)); - // } - // } - - // return result; - // } - //} - protected override void OnExit(ExitEventArgs e) { _container.Dispose(); diff --git a/Filtration/Converters/BlockItemTypeToStringConverter.cs b/Filtration/Converters/BlockItemTypeToStringConverter.cs index b851583..64f5e5b 100644 --- a/Filtration/Converters/BlockItemTypeToStringConverter.cs +++ b/Filtration/Converters/BlockItemTypeToStringConverter.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Windows.Data; -using Filtration.Models; +using Filtration.ObjectModel; namespace Filtration.Converters { diff --git a/Filtration/Converters/BooleanToBlockActionConverter.cs b/Filtration/Converters/BooleanToBlockActionConverter.cs index c51456b..325ba2a 100644 --- a/Filtration/Converters/BooleanToBlockActionConverter.cs +++ b/Filtration/Converters/BooleanToBlockActionConverter.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Windows.Data; -using Filtration.Enums; +using Filtration.ObjectModel.Enums; namespace Filtration.Converters { diff --git a/Filtration/Converters/BooleanToBlockActionInverseConverter.cs b/Filtration/Converters/BooleanToBlockActionInverseConverter.cs index 8689892..bbd6843 100644 --- a/Filtration/Converters/BooleanToBlockActionInverseConverter.cs +++ b/Filtration/Converters/BooleanToBlockActionInverseConverter.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Windows.Data; -using Filtration.Enums; +using Filtration.ObjectModel.Enums; namespace Filtration.Converters { diff --git a/Filtration/Converters/ItemRarityConverter.cs b/Filtration/Converters/ItemRarityConverter.cs index 51bbab6..df229b9 100644 --- a/Filtration/Converters/ItemRarityConverter.cs +++ b/Filtration/Converters/ItemRarityConverter.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Windows.Data; -using Filtration.Enums; +using Filtration.ObjectModel.Enums; namespace Filtration.Converters { diff --git a/Filtration/Filtration.csproj b/Filtration/Filtration.csproj index 3da596f..0d1e226 100644 --- a/Filtration/Filtration.csproj +++ b/Filtration/Filtration.csproj @@ -114,46 +114,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -431,6 +393,15 @@ PreserveNewest + + + {4aac3beb-1dc1-483e-9d11-0e9334e80227} + Filtration.ObjectModel + + + + + diff --git a/Filtration/Models/ItemFilterSection.cs b/Filtration/Models/ItemFilterSection.cs deleted file mode 100644 index 83d54f6..0000000 --- a/Filtration/Models/ItemFilterSection.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Filtration.Models -{ - internal class ItemFilterSection : ItemFilterBlock - { - } -} diff --git a/Filtration/Repositories/ItemFilterScriptRepository.cs b/Filtration/Repositories/ItemFilterScriptRepository.cs index 2a2af93..e05940c 100644 --- a/Filtration/Repositories/ItemFilterScriptRepository.cs +++ b/Filtration/Repositories/ItemFilterScriptRepository.cs @@ -1,6 +1,6 @@ using System; using System.IO; -using Filtration.Models; +using Filtration.ObjectModel; using Filtration.Services; using Filtration.ViewModels; diff --git a/Filtration/Services/ItemFilterPersistenceService.cs b/Filtration/Services/ItemFilterPersistenceService.cs index 67bbe3c..ae5314b 100644 --- a/Filtration/Services/ItemFilterPersistenceService.cs +++ b/Filtration/Services/ItemFilterPersistenceService.cs @@ -1,5 +1,5 @@ using System.IO; -using Filtration.Models; +using Filtration.ObjectModel; using Filtration.Translators; namespace Filtration.Services diff --git a/Filtration/Translators/BlockGroupHierarchyBuilder.cs b/Filtration/Translators/BlockGroupHierarchyBuilder.cs index dd6c358..51487a7 100644 --- a/Filtration/Translators/BlockGroupHierarchyBuilder.cs +++ b/Filtration/Translators/BlockGroupHierarchyBuilder.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using Filtration.Models; +using Filtration.ObjectModel; namespace Filtration.Translators { diff --git a/Filtration/Translators/ItemFilterBlockTranslator.cs b/Filtration/Translators/ItemFilterBlockTranslator.cs index b3839f3..b806286 100644 --- a/Filtration/Translators/ItemFilterBlockTranslator.cs +++ b/Filtration/Translators/ItemFilterBlockTranslator.cs @@ -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 diff --git a/Filtration/Translators/ItemFilterScriptTranslator.cs b/Filtration/Translators/ItemFilterScriptTranslator.cs index 98cd467..c94c37a 100644 --- a/Filtration/Translators/ItemFilterScriptTranslator.cs +++ b/Filtration/Translators/ItemFilterScriptTranslator.cs @@ -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 diff --git a/Filtration/UserControls/NumericFilterPredicateControl.xaml b/Filtration/UserControls/NumericFilterPredicateControl.xaml index ccb79a2..32ce079 100644 --- a/Filtration/UserControls/NumericFilterPredicateControl.xaml +++ b/Filtration/UserControls/NumericFilterPredicateControl.xaml @@ -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}"> diff --git a/Filtration/UserControls/NumericFilterPredicateControl.xaml.cs b/Filtration/UserControls/NumericFilterPredicateControl.xaml.cs index 5a804fd..d394545 100644 --- a/Filtration/UserControls/NumericFilterPredicateControl.xaml.cs +++ b/Filtration/UserControls/NumericFilterPredicateControl.xaml.cs @@ -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 { diff --git a/Filtration/Utilities/BlockGroupMapper.cs b/Filtration/Utilities/BlockGroupMapper.cs index f19fdad..4fd15fa 100644 --- a/Filtration/Utilities/BlockGroupMapper.cs +++ b/Filtration/Utilities/BlockGroupMapper.cs @@ -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 diff --git a/Filtration/ViewModels/FiltrationViewModelBase.cs b/Filtration/ViewModels/FiltrationViewModelBase.cs index 18fa736..8baf875 100644 --- a/Filtration/ViewModels/FiltrationViewModelBase.cs +++ b/Filtration/ViewModels/FiltrationViewModelBase.cs @@ -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); diff --git a/Filtration/ViewModels/ItemFilterBlockGroupViewModel.cs b/Filtration/ViewModels/ItemFilterBlockGroupViewModel.cs index 314f98a..f38cdc9 100644 --- a/Filtration/ViewModels/ItemFilterBlockGroupViewModel.cs +++ b/Filtration/ViewModels/ItemFilterBlockGroupViewModel.cs @@ -1,6 +1,6 @@ using System.Collections.ObjectModel; using System.Linq; -using Filtration.Models; +using Filtration.ObjectModel; namespace Filtration.ViewModels { diff --git a/Filtration/ViewModels/ItemFilterBlockViewModel.cs b/Filtration/ViewModels/ItemFilterBlockViewModel.cs index 8746c37..8ac4b7c 100644 --- a/Filtration/ViewModels/ItemFilterBlockViewModel.cs +++ b/Filtration/ViewModels/ItemFilterBlockViewModel.cs @@ -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; diff --git a/Filtration/ViewModels/ItemFilterScriptViewModel.cs b/Filtration/ViewModels/ItemFilterScriptViewModel.cs index a626037..4f80d71 100644 --- a/Filtration/ViewModels/ItemFilterScriptViewModel.cs +++ b/Filtration/ViewModels/ItemFilterScriptViewModel.cs @@ -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; diff --git a/Filtration/ViewModels/ReplaceColorsViewModel.cs b/Filtration/ViewModels/ReplaceColorsViewModel.cs index 8c379c4..614323b 100644 --- a/Filtration/ViewModels/ReplaceColorsViewModel.cs +++ b/Filtration/ViewModels/ReplaceColorsViewModel.cs @@ -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; diff --git a/Filtration/ViewModels/ToolPanes/ToolViewModel.cs b/Filtration/ViewModels/ToolPanes/ToolViewModel.cs index d2fbdb9..215d914 100644 --- a/Filtration/ViewModels/ToolPanes/ToolViewModel.cs +++ b/Filtration/ViewModels/ToolPanes/ToolViewModel.cs @@ -26,7 +26,7 @@ namespace Filtration.ViewModels.ToolPanes if (_isVisible != value) { _isVisible = value; - RaisePropertyChanged("IsVisible"); + RaisePropertyChanged(); } } } diff --git a/Filtration/Views/BlockTemplateSelector.cs b/Filtration/Views/BlockTemplateSelector.cs index ec6fab2..4237bfb 100644 --- a/Filtration/Views/BlockTemplateSelector.cs +++ b/Filtration/Views/BlockTemplateSelector.cs @@ -1,6 +1,6 @@ using System.Windows; using System.Windows.Controls; -using Filtration.Models; +using Filtration.ObjectModel; using Filtration.ViewModels; namespace Filtration.Views diff --git a/Filtration/Views/ItemFilterBlockDisplaySettingsView.xaml b/Filtration/Views/ItemFilterBlockDisplaySettingsView.xaml index fd4be7c..49b5f7c 100644 --- a/Filtration/Views/ItemFilterBlockDisplaySettingsView.xaml +++ b/Filtration/Views/ItemFilterBlockDisplaySettingsView.xaml @@ -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 @@ - + @@ -66,7 +66,7 @@ - + diff --git a/Filtration/Views/ItemFilterBlockView.xaml b/Filtration/Views/ItemFilterBlockView.xaml index 3aee75a..05debd2 100644 --- a/Filtration/Views/ItemFilterBlockView.xaml +++ b/Filtration/Views/ItemFilterBlockView.xaml @@ -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"> diff --git a/Filtration/Views/ItemFilterBlockView.xaml.cs b/Filtration/Views/ItemFilterBlockView.xaml.cs index 5631e4b..9474b87 100644 --- a/Filtration/Views/ItemFilterBlockView.xaml.cs +++ b/Filtration/Views/ItemFilterBlockView.xaml.cs @@ -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;