Compare commits
168 Commits
0.12
...
1.0.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
992bd21570 | ||
|
|
7d8b32b2e7 | ||
|
|
ac904c31ff | ||
|
|
f51fe315ad | ||
|
|
3ce2e12f56 | ||
|
|
43e5b30080 | ||
|
|
bc99339390 | ||
|
|
781faae85d | ||
|
|
c926808878 | ||
|
|
24d9f97717 | ||
|
|
7e4e6fe42e | ||
|
|
c6d75cfff6 | ||
|
|
2f30eade7c | ||
|
|
e719f0bce0 | ||
|
|
dffbbf3591 | ||
|
|
07a7e8d05c | ||
|
|
1ba224906c | ||
|
|
32523787d2 | ||
|
|
ac6943d73b | ||
|
|
36c0aaea17 | ||
|
|
4b38a6a4e0 | ||
|
|
9c44dd7e7d | ||
|
|
18c878e350 | ||
|
|
5d30888597 | ||
|
|
bfd722d362 | ||
|
|
d23741555a | ||
|
|
820aa5499e | ||
|
|
1ee38b4c0e | ||
|
|
4bed777427 | ||
|
|
1f6cbeec86 | ||
|
|
550a2d8f25 | ||
|
|
ae38197052 | ||
|
|
4fd4ffc520 | ||
|
|
e15efe4e15 | ||
|
|
196db4c730 | ||
|
|
910b2b8c7f | ||
|
|
b31ce1d843 | ||
|
|
99a011c78c | ||
|
|
69ce542c1a | ||
|
|
2ff9ebf242 | ||
|
|
0eff63d706 | ||
|
|
1b8f37ca3a | ||
|
|
b4f02f872e | ||
|
|
cfef82e53a | ||
|
|
bdd121f48c | ||
|
|
0209de3817 | ||
|
|
1e26a2ae3e | ||
|
|
54b72e44b0 | ||
|
|
24df1d7687 | ||
|
|
7162e16b49 | ||
|
|
324ce4d0b3 | ||
|
|
de489e8b2c | ||
|
|
341b1d1eb2 | ||
|
|
6be29dbd28 | ||
|
|
3851ad51e1 | ||
|
|
65d3e07156 | ||
|
|
a86ab3ec8d | ||
|
|
41722e8a57 | ||
|
|
3cb0a041d7 | ||
|
|
c8778bb1eb | ||
|
|
8e849d6a8f | ||
|
|
0d3f01a856 | ||
|
|
178ff579c6 | ||
|
|
30aa52e788 | ||
|
|
c1aee2f8f7 | ||
|
|
937426e9a3 | ||
|
|
7e0932830d | ||
|
|
15c63fa222 | ||
|
|
cc986eea21 | ||
|
|
c260014a16 | ||
|
|
8f0f73f185 | ||
|
|
15143f738f | ||
|
|
dc6ed934b2 | ||
|
|
78b4ddc862 | ||
|
|
a09f0a5090 | ||
|
|
2958d93b33 | ||
|
|
1e9b1158bd | ||
|
|
d92d34af05 | ||
|
|
bc5a005ee7 | ||
|
|
8ba3433dcf | ||
|
|
d0bc0b6864 | ||
|
|
1eaf0b6fe5 | ||
|
|
4c76dc9bab | ||
|
|
2a7df9a1ca | ||
|
|
add7514ce7 | ||
|
|
0974579684 | ||
|
|
c0e9c534de | ||
|
|
780081263c | ||
|
|
387f08db85 | ||
|
|
7fb9378304 | ||
|
|
e5209fb459 | ||
|
|
961805272d | ||
|
|
281c7d85e1 | ||
|
|
57775a9e22 | ||
|
|
5817295f7c | ||
|
|
216168533f | ||
|
|
f6969a0204 | ||
|
|
38053666a0 | ||
|
|
bd730dd518 | ||
|
|
2c4096ff2c | ||
|
|
738415f10a | ||
|
|
f03e37602d | ||
|
|
2230b81257 | ||
|
|
3aa2bf488c | ||
|
|
71b7a45f84 | ||
|
|
0fd2db7076 | ||
|
|
400688573c | ||
|
|
52fc1f6bbc | ||
|
|
3f437c0109 | ||
|
|
f838b35b4c | ||
|
|
ac706486cb | ||
|
|
3607ad362e | ||
|
|
1ecec4e9dc | ||
|
|
404a04c210 | ||
|
|
f1b2be7d74 | ||
|
|
6393a53bf5 | ||
|
|
a0a72b5fe8 | ||
|
|
d96234f099 | ||
|
|
07fdc2eb49 | ||
|
|
86ff670fb0 | ||
|
|
c9caed7e6b | ||
|
|
9cf4d86cb0 | ||
|
|
523a9553d9 | ||
|
|
b88730fb3a | ||
|
|
06b88e85f2 | ||
|
|
b98988f0b5 | ||
|
|
d14e4e9320 | ||
|
|
d91f7e1ac3 | ||
|
|
d84b17ced3 | ||
|
|
fef20ff36a | ||
|
|
23fa82655b | ||
|
|
e5bd994164 | ||
|
|
342487f800 | ||
|
|
8bf3527b69 | ||
|
|
010e0dda31 | ||
|
|
2cf6a5953b | ||
|
|
1ebbe5b5a8 | ||
|
|
fee2a4dd99 | ||
|
|
b65fad0679 | ||
|
|
43c6149832 | ||
|
|
4def27c49d | ||
|
|
7b8ff1e3cb | ||
|
|
797c911bb5 | ||
|
|
8e54cc3b4b | ||
|
|
ab7aefa8a6 | ||
|
|
bb77138854 | ||
|
|
2d98f7de36 | ||
|
|
6277917ae6 | ||
|
|
3fe021949a | ||
|
|
733c7d1757 | ||
|
|
702c118783 | ||
|
|
11d85fdd1b | ||
|
|
8dc5864d2e | ||
|
|
884651bce9 | ||
|
|
e7a40c8c6d | ||
|
|
dde9f65ea6 | ||
|
|
ae6e8c5211 | ||
|
|
67685d9eac | ||
|
|
af08cdfed6 | ||
|
|
0b791f5747 | ||
|
|
43bc1410ae | ||
|
|
b3520246b9 | ||
|
|
6d1c51361b | ||
|
|
360b1c8144 | ||
|
|
80b8318574 | ||
|
|
85f47ce654 | ||
|
|
c88c401ca8 | ||
|
|
45ab1a57e3 |
185
.gitignore
vendored
185
.gitignore
vendored
@@ -1,29 +1,43 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
/.vs/
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
build/
|
||||
x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
|
||||
# Roslyn cache directories
|
||||
*.ide/
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
#NUNIT
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
@@ -32,6 +46,19 @@ TestResult.xml
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
**/Properties/launchSettings.json
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
@@ -64,14 +91,21 @@ _Chutzpah*
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
@@ -84,7 +118,7 @@ _ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding addin-in
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
@@ -93,9 +127,18 @@ _TeamCity*
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
@@ -123,42 +166,63 @@ publish/
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
## TODO: Comment the next line if you want to checkin your
|
||||
## web deploy settings but do note that will include unencrypted
|
||||
## passwords
|
||||
#*.pubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# NuGet Packages Directory
|
||||
packages/*
|
||||
## TODO: If the tool you use requires repositories.config
|
||||
## uncomment the next line
|
||||
#!packages/repositories.config
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# Enable "build/" folder in the NuGet Packages folder since
|
||||
# NuGet packages use it for MSBuild targets.
|
||||
# This line needs to be after the ignore of the build folder
|
||||
# (and the packages folder if the line above has been uncommented)
|
||||
!packages/build/
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Windows Azure Build Output
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Windows Store app package directory
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
sql/
|
||||
*.Cache
|
||||
ClientBin/
|
||||
[Ss]tyle[Cc]op.*
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
orleans.codegen.cs
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
@@ -174,6 +238,7 @@ UpgradeLog*.htm
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
@@ -183,7 +248,69 @@ UpgradeLog*.htm
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# LightSwitch generated files
|
||||
GeneratedArtifacts/
|
||||
_Pvt_Extensions/
|
||||
ModelManifest.xml
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
# CodeRush
|
||||
.cr/
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
@@ -35,13 +35,11 @@
|
||||
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.5.21\lib\net45\Moq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Moq, Version=4.5.30.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.5.30\lib\net45\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
|
||||
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
||||
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
||||
<package id="Moq" version="4.5.30" targetFramework="net461" />
|
||||
<package id="NUnit" version="3.6.1" targetFramework="net461" />
|
||||
</packages>
|
||||
@@ -4,7 +4,7 @@ using System.Windows.Data;
|
||||
|
||||
namespace Filtration.Common.Converters
|
||||
{
|
||||
internal class BoolInverterConverter : IValueConverter
|
||||
public class BooleanInverterConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter,
|
||||
CultureInfo culture)
|
||||
|
||||
@@ -3,9 +3,9 @@ using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace Filtration.Extensions
|
||||
namespace Filtration.Common.Extensions
|
||||
{
|
||||
internal class EnumerationExtension : MarkupExtension
|
||||
public class EnumerationExtension : MarkupExtension
|
||||
{
|
||||
private Type _enumType;
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Windows;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
namespace Filtration.Extensions
|
||||
namespace Filtration.Common.Extensions
|
||||
{
|
||||
public static class HyperlinkExtensions
|
||||
{
|
||||
@@ -35,8 +35,8 @@
|
||||
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Castle.Windsor">
|
||||
<HintPath>..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll</HintPath>
|
||||
<Reference Include="Castle.Windsor, Version=3.4.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Windsor.3.4.0\lib\net45\Castle.Windsor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
|
||||
@@ -75,6 +75,8 @@
|
||||
<Compile Include="Converters\ColorToSolidColorBrushConverter.cs" />
|
||||
<Compile Include="Converters\InverseBooleanVisibilityConverter.cs" />
|
||||
<Compile Include="Converters\StringToVisibilityConverter.cs" />
|
||||
<Compile Include="Extensions\EnumerationExtension.cs" />
|
||||
<Compile Include="Extensions\HyperlinkExtensions.cs" />
|
||||
<Compile Include="Messages\ThemeClosedMessage.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\FileSystemService.cs" />
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<Setter Property="Margin" Value="0,0,5,5" />
|
||||
</Style>
|
||||
<converters:StringToVisibilityConverter x:Key="StringToVisibilityConverter" />
|
||||
<converters:BoolInverterConverter x:Key="BoolInverterConverter" />
|
||||
<converters:BooleanInverterConverter x:Key="BoolInverterConverter" />
|
||||
<converters:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" />
|
||||
<converters:BooleanVisibilityConverter x:Key="BooleanVisibilityConverter" />
|
||||
<converters:InverseBooleanVisibilityConverter x:Key="InverseBooleanVisibilityConverter" />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
@@ -21,6 +22,7 @@ namespace Filtration.Common.Utilities
|
||||
/// the stream into text.
|
||||
/// </summary>
|
||||
/// <param name="streamSource">Data source</param>
|
||||
[DebuggerStepThrough]
|
||||
public LineReader(Func<Stream> streamSource)
|
||||
: this(streamSource, Encoding.UTF8)
|
||||
{
|
||||
@@ -33,6 +35,7 @@ namespace Filtration.Common.Utilities
|
||||
/// <param name="streamSource">Data source</param>
|
||||
/// <param name="encoding">Encoding to use to decode the stream
|
||||
/// into text</param>
|
||||
[DebuggerStepThrough]
|
||||
public LineReader(Func<Stream> streamSource, Encoding encoding)
|
||||
: this(() => new StreamReader(streamSource(), encoding))
|
||||
{
|
||||
@@ -44,6 +47,7 @@ namespace Filtration.Common.Utilities
|
||||
/// UTF8 is used to decode the file into text.
|
||||
/// </summary>
|
||||
/// <param name="filename">File to read from</param>
|
||||
[DebuggerStepThrough]
|
||||
public LineReader(string filename)
|
||||
: this(filename, Encoding.UTF8)
|
||||
{
|
||||
@@ -56,6 +60,7 @@ namespace Filtration.Common.Utilities
|
||||
/// <param name="filename">File to read from</param>
|
||||
/// <param name="encoding">Encoding to use to decode the file
|
||||
/// into text</param>
|
||||
[DebuggerStepThrough]
|
||||
public LineReader(string filename, Encoding encoding)
|
||||
: this(() => new StreamReader(filename, encoding))
|
||||
{
|
||||
@@ -66,6 +71,7 @@ namespace Filtration.Common.Utilities
|
||||
/// is only called when the enumerator is fetched
|
||||
/// </summary>
|
||||
/// <param name="dataSource">Data source</param>
|
||||
[DebuggerStepThrough]
|
||||
public LineReader(Func<TextReader> dataSource)
|
||||
{
|
||||
_dataSource = dataSource;
|
||||
@@ -74,6 +80,7 @@ namespace Filtration.Common.Utilities
|
||||
/// <summary>
|
||||
/// Enumerates the data source line by line.
|
||||
/// </summary>
|
||||
[DebuggerStepThrough]
|
||||
public IEnumerator<string> GetEnumerator()
|
||||
{
|
||||
using (TextReader reader = _dataSource())
|
||||
@@ -89,6 +96,7 @@ namespace Filtration.Common.Utilities
|
||||
/// <summary>
|
||||
/// Enumerates the data source line by line.
|
||||
/// </summary>
|
||||
[DebuggerStepThrough]
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Castle.Core" version="3.3.3" targetFramework="net451" />
|
||||
<package id="Castle.Windsor" version="3.3.0" targetFramework="net451" />
|
||||
<package id="Castle.Windsor" version="3.4.0" targetFramework="net461" />
|
||||
<package id="CommonServiceLocator" version="1.3" targetFramework="net451" />
|
||||
<package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net461" />
|
||||
</packages>
|
||||
@@ -31,9 +31,24 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -46,6 +61,9 @@
|
||||
<Compile Include="IEditableDocument.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using GalaSoft.MvvmLight.CommandWpf;
|
||||
|
||||
namespace Filtration.Interface
|
||||
{
|
||||
@@ -7,5 +9,6 @@ namespace Filtration.Interface
|
||||
bool IsScript { get; }
|
||||
bool IsTheme { get; }
|
||||
Task Close();
|
||||
RelayCommand CloseCommand { get; }
|
||||
}
|
||||
}
|
||||
|
||||
5
Filtration.Interface/packages.config
Normal file
5
Filtration.Interface/packages.config
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="CommonServiceLocator" version="1.3" targetFramework="net461" />
|
||||
<package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net461" />
|
||||
</packages>
|
||||
@@ -46,9 +46,8 @@
|
||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
|
||||
@@ -6,6 +6,7 @@ using NUnit.Framework;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.Data.Tests.Repositories
|
||||
{
|
||||
[Ignore("integration test")]
|
||||
[TestFixture]
|
||||
public class TestItemSetRepository
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EntityFramework" version="6.1.3" targetFramework="net461" />
|
||||
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
||||
<package id="NUnit" version="3.6.1" targetFramework="net461" />
|
||||
<package id="System.Data.SQLite" version="1.0.102.0" targetFramework="net461" />
|
||||
<package id="System.Data.SQLite.Core" version="1.0.102.0" targetFramework="net461" />
|
||||
<package id="System.Data.SQLite.EF6" version="1.0.102.0" targetFramework="net461" />
|
||||
|
||||
@@ -46,21 +46,17 @@
|
||||
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="FluentAssertions, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="FluentAssertions, Version=4.19.2.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FluentAssertions.Core, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="FluentAssertions.Core, Version=4.19.2.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.5.21\lib\net45\Moq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Moq, Version=4.5.30.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.5.30\lib\net45\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
@@ -121,7 +117,6 @@
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\MuldiniFilterScript.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -6,6 +6,7 @@ using Filtration.ItemFilterPreview.Tests.Properties;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ObjectModel.BlockItemTypes;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
using Filtration.ObjectModel.Factories;
|
||||
using Filtration.Parser.Services;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
@@ -29,7 +30,7 @@ namespace Filtration.ItemFilterPreview.Tests.Services
|
||||
//Arrange
|
||||
var testInputItem = Mock.Of<IItem>();
|
||||
var testInputBlock = Mock.Of<IItemFilterBlock>();
|
||||
var testInputScript = Mock.Of<IItemFilterScript>(s => s.ItemFilterBlocks == new ObservableCollection<IItemFilterBlock> {testInputBlock});
|
||||
var testInputScript = Mock.Of<IItemFilterScript>(s => s.ItemFilterBlocks == new ObservableCollection<IItemFilterBlockBase> {testInputBlock});
|
||||
|
||||
_testUtility.MockBlockItemMatcher
|
||||
.Setup(b => b.ItemBlockMatch(testInputBlock, testInputItem))
|
||||
@@ -50,7 +51,7 @@ namespace Filtration.ItemFilterPreview.Tests.Services
|
||||
//Arrange
|
||||
var testInputItem = Mock.Of<IItem>();
|
||||
var testInputBlock = Mock.Of<IItemFilterBlock>();
|
||||
var testInputScript = Mock.Of<IItemFilterScript>(s => s.ItemFilterBlocks == new ObservableCollection<IItemFilterBlock> { testInputBlock });
|
||||
var testInputScript = Mock.Of<IItemFilterScript>(s => s.ItemFilterBlocks == new ObservableCollection<IItemFilterBlockBase> { testInputBlock });
|
||||
|
||||
_testUtility.MockBlockItemMatcher
|
||||
.Setup(b => b.ItemBlockMatch(testInputBlock, testInputItem))
|
||||
@@ -66,12 +67,18 @@ namespace Filtration.ItemFilterPreview.Tests.Services
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Ignore("Outdated item filter")]
|
||||
public void ProcessItemsAgainstItemFilterScript_IntegrationTest()
|
||||
{
|
||||
//Arrange
|
||||
var testInputScriptFile = Resources.MuldiniFilterScript;
|
||||
var blockGroupHierarchyBuilder = new BlockGroupHierarchyBuilder();
|
||||
var scriptTranslator = new ItemFilterScriptTranslator(new ItemFilterBlockTranslator(blockGroupHierarchyBuilder), blockGroupHierarchyBuilder);
|
||||
var mockItemFilterScriptFactory = new Mock<IItemFilterScriptFactory>();
|
||||
mockItemFilterScriptFactory
|
||||
.Setup(i => i.Create())
|
||||
.Returns(new ItemFilterScript());
|
||||
|
||||
var scriptTranslator = new ItemFilterScriptTranslator(blockGroupHierarchyBuilder, new ItemFilterBlockTranslator(blockGroupHierarchyBuilder), mockItemFilterScriptFactory.Object);
|
||||
var script = scriptTranslator.TranslateStringToItemFilterScript(testInputScriptFile);
|
||||
|
||||
var testInputItem = new Item
|
||||
@@ -96,12 +103,17 @@ namespace Filtration.ItemFilterPreview.Tests.Services
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Ignore("Outdated item filter")]
|
||||
public void ProcessItemsAgainstItemFilterScript_IntegrationTest_10Items()
|
||||
{
|
||||
//Arrange
|
||||
var testInputScriptFile = Resources.MuldiniFilterScript;
|
||||
var blockGroupHierarchyBuilder = new BlockGroupHierarchyBuilder();
|
||||
var scriptTranslator = new ItemFilterScriptTranslator(new ItemFilterBlockTranslator(blockGroupHierarchyBuilder), blockGroupHierarchyBuilder);
|
||||
var mockItemFilterScriptFactory = new Mock<IItemFilterScriptFactory>();
|
||||
mockItemFilterScriptFactory
|
||||
.Setup(i => i.Create())
|
||||
.Returns(new ItemFilterScript());
|
||||
var scriptTranslator = new ItemFilterScriptTranslator(blockGroupHierarchyBuilder, new ItemFilterBlockTranslator(blockGroupHierarchyBuilder), mockItemFilterScriptFactory.Object);
|
||||
var script = scriptTranslator.TranslateStringToItemFilterScript(testInputScriptFile);
|
||||
|
||||
var testInputItems = new List<IItem>
|
||||
|
||||
@@ -6,12 +6,12 @@ using System.Xml.Serialization;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
using NUnit.Framework;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.Tests.Services
|
||||
{
|
||||
class serializationtest
|
||||
{
|
||||
[Ignore("")]
|
||||
[Test]
|
||||
public void test_serialization()
|
||||
{
|
||||
@@ -39,7 +39,6 @@ namespace Filtration.ItemFilterPreview.Tests.Services
|
||||
output = textWriter.ToString();
|
||||
}
|
||||
|
||||
var x = 2;
|
||||
//Assert
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="ControlzEx" publicKeyToken="f08b075e934b7045" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.1.2.3" newVersion="2.1.2.3" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.2.0.4" newVersion="2.2.0.4" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
|
||||
<package id="FluentAssertions" version="4.13.0" targetFramework="net461" />
|
||||
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
||||
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
||||
<package id="FluentAssertions" version="4.19.2" targetFramework="net461" />
|
||||
<package id="Moq" version="4.5.30" targetFramework="net461" />
|
||||
<package id="NUnit" version="3.6.1" targetFramework="net461" />
|
||||
<package id="YamlDotNet" version="3.9.0" targetFramework="net461" />
|
||||
</packages>
|
||||
@@ -40,9 +40,8 @@
|
||||
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Castle.Windsor, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Castle.Windsor, Version=3.4.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Windsor.3.4.0\lib\net45\Castle.Windsor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
|
||||
@@ -60,9 +59,8 @@
|
||||
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.5.21\lib\net45\Moq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Moq, Version=4.5.30.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.5.30\lib\net45\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
|
||||
@@ -31,8 +31,8 @@ namespace Filtration.ItemFilterPreview.Services
|
||||
sw.Restart();
|
||||
|
||||
var matchedBlock = itemFilterScript.ItemFilterBlocks
|
||||
.Where(b => !(b is ItemFilterSection))
|
||||
.FirstOrDefault(block => _blockItemMatcher.ItemBlockMatch(block, item));
|
||||
.OfType<IItemFilterBlock>()
|
||||
.FirstOrDefault(block => _blockItemMatcher.ItemBlockMatch(block, item));
|
||||
|
||||
filteredItems.Add(new FilteredItem(item, matchedBlock));
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
|
||||
<package id="Castle.Windsor" version="3.3.0" targetFramework="net461" />
|
||||
<package id="Castle.Windsor" version="3.4.0" targetFramework="net461" />
|
||||
<package id="CommonServiceLocator" version="1.3" targetFramework="net461" />
|
||||
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
||||
<package id="Moq" version="4.5.30" targetFramework="net461" />
|
||||
<package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net461" />
|
||||
</packages>
|
||||
@@ -35,13 +35,11 @@
|
||||
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.5.21\lib\net45\Moq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Moq, Version=4.5.30.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.5.30\lib\net45\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="System" />
|
||||
@@ -68,6 +66,9 @@
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -6,23 +6,6 @@ namespace Filtration.ObjectModel.Tests
|
||||
[TestFixture]
|
||||
public class TestItemFilterBlock
|
||||
{
|
||||
[Test]
|
||||
public void ItemFilterBlock_BlockCount_ReturnsCorrectNumber()
|
||||
{
|
||||
// Arrange
|
||||
var block = new ItemFilterBlock();
|
||||
block.BlockItems.Add(new ItemLevelBlockItem());
|
||||
block.BlockItems.Add(new ItemLevelBlockItem());
|
||||
block.BlockItems.Add(new ItemLevelBlockItem());
|
||||
block.BlockItems.Add(new ItemLevelBlockItem());
|
||||
|
||||
// Act
|
||||
var count = block.BlockCount(typeof (ItemLevelBlockItem));
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(4, count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ItemFilterBlock_AddBlockItemAllowed_LessThanMaximum_ReturnsTrue()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
|
||||
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
||||
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
||||
<package id="Moq" version="4.5.30" targetFramework="net461" />
|
||||
<package id="NUnit" version="3.6.1" targetFramework="net461" />
|
||||
</packages>
|
||||
@@ -7,7 +7,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
public sealed class ActionBlockItem : BlockItemBase
|
||||
{
|
||||
private BlockAction _action;
|
||||
private bool _isDirty;
|
||||
|
||||
public ActionBlockItem(BlockAction action)
|
||||
{
|
||||
@@ -16,7 +15,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
|
||||
public BlockAction Action
|
||||
{
|
||||
get { return _action; }
|
||||
get => _action;
|
||||
set
|
||||
{
|
||||
_action = value;
|
||||
@@ -24,7 +23,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(SummaryText));
|
||||
OnPropertyChanged(nameof(SummaryBackgroundColor));
|
||||
OnPropertyChanged(nameof(SummaryText));
|
||||
OnPropertyChanged(nameof(SummaryTextColor));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,16 +43,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
|
||||
public override int SortOrder => 0;
|
||||
|
||||
public override bool IsDirty
|
||||
{
|
||||
get { return _isDirty; }
|
||||
protected set
|
||||
{
|
||||
_isDirty = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void ToggleAction()
|
||||
{
|
||||
Action = Action == BlockAction.Show ? BlockAction.Hide : BlockAction.Show;
|
||||
|
||||
@@ -7,6 +7,8 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
{
|
||||
public abstract class BlockItemBase : IItemFilterBlockItem
|
||||
{
|
||||
private bool _isDirty;
|
||||
|
||||
public abstract string PrefixText { get; }
|
||||
public abstract string OutputText { get; }
|
||||
public abstract int MaximumAllowed { get; }
|
||||
@@ -15,7 +17,17 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
public abstract Color SummaryBackgroundColor { get; }
|
||||
public abstract Color SummaryTextColor { get; }
|
||||
public abstract int SortOrder { get; }
|
||||
public abstract bool IsDirty { get; protected set; }
|
||||
public string Comment { get; set; }
|
||||
|
||||
public bool IsDirty
|
||||
{
|
||||
get { return _isDirty; }
|
||||
protected set
|
||||
{
|
||||
_isDirty = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
{
|
||||
public abstract class BooleanBlockItem : BlockItemBase
|
||||
{
|
||||
private bool _booleanValue;
|
||||
|
||||
protected BooleanBlockItem()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected BooleanBlockItem(bool booleanValue)
|
||||
{
|
||||
BooleanValue = booleanValue;
|
||||
}
|
||||
|
||||
public bool BooleanValue
|
||||
{
|
||||
get { return _booleanValue; }
|
||||
set
|
||||
{
|
||||
_booleanValue = value;
|
||||
IsDirty = true;
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(SummaryText));
|
||||
}
|
||||
}
|
||||
|
||||
public override string OutputText => PrefixText + " " + BooleanValue;
|
||||
public override string SummaryText => PrefixText + " = " + BooleanValue;
|
||||
public override int MaximumAllowed => 1;
|
||||
|
||||
public void ToggleValue()
|
||||
{
|
||||
BooleanValue = !BooleanValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using Filtration.ObjectModel.ThemeEditor;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
{
|
||||
public abstract class ColorBlockItem : BlockItemBase, IAudioVisualBlockItem
|
||||
public abstract class ColorBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
|
||||
{
|
||||
private Color _color;
|
||||
private ThemeComponent _themeComponent;
|
||||
@@ -19,13 +19,11 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
}
|
||||
|
||||
public override string OutputText => PrefixText + " " + +Color.R + " " + Color.G + " "
|
||||
+ Color.B + (Color.A < 255 ? " " + Color.A : string.Empty) +
|
||||
+ Color.B + (Color.A != 240 ? " " + Color.A : string.Empty) +
|
||||
(ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
|
||||
|
||||
public override string SummaryText => string.Empty;
|
||||
|
||||
public override bool IsDirty { get; protected set; }
|
||||
|
||||
public ThemeComponent ThemeComponent
|
||||
{
|
||||
get { return _themeComponent; }
|
||||
@@ -65,7 +63,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
|
||||
private void OnThemeComponentUpdated(object sender, EventArgs e)
|
||||
{
|
||||
Color = ((ThemeComponent) sender).Color;
|
||||
Color = ((ColorThemeComponent) sender).Color;
|
||||
}
|
||||
|
||||
private void OnThemeComponentDeleted(object sender, EventArgs e)
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.ThemeEditor;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
{
|
||||
public abstract class ColorBooleanBlockItem : BlockItemBase, IAudioVisualBlockItem
|
||||
{
|
||||
private Color _color;
|
||||
private bool _booleanValue;
|
||||
|
||||
protected ColorBooleanBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
protected ColorBooleanBlockItem(Color color, bool booleanValue)
|
||||
{
|
||||
Color = color;
|
||||
BooleanValue = booleanValue;
|
||||
}
|
||||
|
||||
public override string OutputText => PrefixText + " " + +Color.R + " " + Color.G + " "
|
||||
+ Color.B + (Color.A < 255 ? " " + Color.A : string.Empty) +
|
||||
(BooleanValue ? " True" : " False");
|
||||
|
||||
public override string SummaryText => string.Empty;
|
||||
|
||||
public override Color SummaryBackgroundColor => Colors.Transparent;
|
||||
public override Color SummaryTextColor => Colors.Transparent;
|
||||
|
||||
public Color Color
|
||||
{
|
||||
get { return _color; }
|
||||
set
|
||||
{
|
||||
_color = value;
|
||||
IsDirty = true;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool BooleanValue
|
||||
{
|
||||
get { return _booleanValue; }
|
||||
set
|
||||
{
|
||||
_booleanValue = value;
|
||||
IsDirty = true;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,8 +23,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
public override Color SummaryBackgroundColor => Colors.Transparent;
|
||||
public override Color SummaryTextColor => Colors.Transparent;
|
||||
|
||||
public override bool IsDirty { get; protected set; }
|
||||
|
||||
public int Value
|
||||
{
|
||||
get { return _value; }
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
using Filtration.ObjectModel.Extensions;
|
||||
using Filtration.ObjectModel.ThemeEditor;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
{
|
||||
public abstract class EffectColorBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
|
||||
{
|
||||
private EffectColor _color;
|
||||
private bool _temporary;
|
||||
private ThemeComponent _themeComponent;
|
||||
|
||||
protected EffectColorBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
protected EffectColorBlockItem(EffectColor color, bool temporary)
|
||||
{
|
||||
Color = color;
|
||||
Temporary = temporary;
|
||||
}
|
||||
|
||||
public override string OutputText => PrefixText + " " + Color.GetAttributeDescription() +
|
||||
(Temporary ? " " + "Temp" : string.Empty) +
|
||||
(ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
|
||||
|
||||
public override string SummaryText => string.Empty;
|
||||
|
||||
public ThemeComponent ThemeComponent
|
||||
{
|
||||
get { return _themeComponent; }
|
||||
set
|
||||
{
|
||||
if (_themeComponent == value) { return; }
|
||||
|
||||
if (_themeComponent != null)
|
||||
{
|
||||
_themeComponent.ThemeComponentUpdated -= OnThemeComponentUpdated;
|
||||
_themeComponent.ThemeComponentDeleted -= OnThemeComponentDeleted;
|
||||
}
|
||||
if (value != null)
|
||||
{
|
||||
value.ThemeComponentUpdated += OnThemeComponentUpdated;
|
||||
value.ThemeComponentDeleted += OnThemeComponentDeleted;
|
||||
}
|
||||
|
||||
_themeComponent = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor => Colors.Transparent;
|
||||
public override Color SummaryTextColor => Colors.Transparent;
|
||||
|
||||
public EffectColor Color
|
||||
{
|
||||
get { return _color; }
|
||||
set
|
||||
{
|
||||
_color = value;
|
||||
IsDirty = true;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool Temporary
|
||||
{
|
||||
get { return _temporary; }
|
||||
set
|
||||
{
|
||||
_temporary = value;
|
||||
IsDirty = true;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnThemeComponentUpdated(object sender, EventArgs e)
|
||||
{
|
||||
Color = ((EffectColorThemeComponent)sender).EffectColor;
|
||||
Temporary = ((EffectColorThemeComponent)sender).Temporary;
|
||||
}
|
||||
|
||||
private void OnThemeComponentDeleted(object sender, EventArgs e)
|
||||
{
|
||||
ThemeComponent = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
103
Filtration.ObjectModel/BlockItemBaseTypes/IconBlockItem.cs
Normal file
103
Filtration.ObjectModel/BlockItemBaseTypes/IconBlockItem.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
using Filtration.ObjectModel.Extensions;
|
||||
using Filtration.ObjectModel.ThemeEditor;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
{
|
||||
public abstract class IconBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
|
||||
{
|
||||
private IconSize _size;
|
||||
private IconColor _color;
|
||||
private IconShape _shape;
|
||||
private ThemeComponent _themeComponent;
|
||||
|
||||
protected IconBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
protected IconBlockItem(IconSize size, IconColor color, IconShape shape)
|
||||
{
|
||||
Size = size;
|
||||
Color = color;
|
||||
Shape = shape;
|
||||
}
|
||||
|
||||
public override string OutputText => PrefixText + " " + (int)Size + " " + Color.GetAttributeDescription() + " " + Shape.GetAttributeDescription() +
|
||||
(ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
|
||||
|
||||
public override string SummaryText => string.Empty;
|
||||
|
||||
public ThemeComponent ThemeComponent
|
||||
{
|
||||
get { return _themeComponent; }
|
||||
set
|
||||
{
|
||||
if (_themeComponent == value) { return; }
|
||||
|
||||
if (_themeComponent != null)
|
||||
{
|
||||
_themeComponent.ThemeComponentUpdated -= OnThemeComponentUpdated;
|
||||
_themeComponent.ThemeComponentDeleted -= OnThemeComponentDeleted;
|
||||
}
|
||||
if (value != null)
|
||||
{
|
||||
value.ThemeComponentUpdated += OnThemeComponentUpdated;
|
||||
value.ThemeComponentDeleted += OnThemeComponentDeleted;
|
||||
}
|
||||
|
||||
_themeComponent = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor => Colors.Transparent;
|
||||
public override Color SummaryTextColor => Colors.Transparent;
|
||||
|
||||
public IconSize Size
|
||||
{
|
||||
get { return _size; }
|
||||
set
|
||||
{
|
||||
_size = value;
|
||||
IsDirty = true;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public IconColor Color
|
||||
{
|
||||
get { return _color; }
|
||||
set
|
||||
{
|
||||
_color = value;
|
||||
IsDirty = true;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public IconShape Shape
|
||||
{
|
||||
get { return _shape; }
|
||||
set
|
||||
{
|
||||
_shape = value;
|
||||
IsDirty = true;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnThemeComponentUpdated(object sender, EventArgs e)
|
||||
{
|
||||
Size = ((IconThemeComponent)sender).IconSize;
|
||||
Color = ((IconThemeComponent)sender).IconColor;
|
||||
Shape = ((IconThemeComponent)sender).IconShape;
|
||||
}
|
||||
|
||||
private void OnThemeComponentDeleted(object sender, EventArgs e)
|
||||
{
|
||||
ThemeComponent = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
using System.Windows.Media;
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.ThemeEditor;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
{
|
||||
public abstract class IntegerBlockItem : BlockItemBase, IAudioVisualBlockItem
|
||||
public abstract class IntegerBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
|
||||
{
|
||||
private int _value;
|
||||
private ThemeComponent _themeComponent;
|
||||
|
||||
protected IntegerBlockItem()
|
||||
{
|
||||
@@ -15,7 +18,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public override string OutputText => PrefixText + " " + Value;
|
||||
public override string OutputText => PrefixText + " " + Value + (ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
|
||||
|
||||
public override string SummaryText => string.Empty;
|
||||
public override Color SummaryBackgroundColor => Colors.Transparent;
|
||||
@@ -24,7 +27,28 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
public abstract int Minimum { get; }
|
||||
public abstract int Maximum { get; }
|
||||
|
||||
public override bool IsDirty { get; protected set; }
|
||||
public ThemeComponent ThemeComponent
|
||||
{
|
||||
get { return _themeComponent; }
|
||||
set
|
||||
{
|
||||
if (_themeComponent == value) { return; }
|
||||
|
||||
if (_themeComponent != null)
|
||||
{
|
||||
_themeComponent.ThemeComponentUpdated -= OnThemeComponentUpdated;
|
||||
_themeComponent.ThemeComponentDeleted -= OnThemeComponentDeleted;
|
||||
}
|
||||
if (value != null)
|
||||
{
|
||||
value.ThemeComponentUpdated += OnThemeComponentUpdated;
|
||||
value.ThemeComponentDeleted += OnThemeComponentDeleted;
|
||||
}
|
||||
|
||||
_themeComponent = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int Value
|
||||
{
|
||||
@@ -36,5 +60,15 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnThemeComponentUpdated(object sender, EventArgs e)
|
||||
{
|
||||
Value = ((IntegerBlockItem)sender).Value;
|
||||
}
|
||||
|
||||
private void OnThemeComponentDeleted(object sender, EventArgs e)
|
||||
{
|
||||
ThemeComponent = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
public abstract int Minimum { get; }
|
||||
public abstract int Maximum { get; }
|
||||
|
||||
public override bool IsDirty { get; protected set; }
|
||||
|
||||
public NumericFilterPredicate FilterPredicate
|
||||
{
|
||||
get { return _filterPredicate; }
|
||||
|
||||
87
Filtration.ObjectModel/BlockItemBaseTypes/StrIntBlockItem.cs
Normal file
87
Filtration.ObjectModel/BlockItemBaseTypes/StrIntBlockItem.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.ThemeEditor;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
{
|
||||
public abstract class StrIntBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
|
||||
{
|
||||
private string _value;
|
||||
private int _secondValue;
|
||||
private ThemeComponent _themeComponent;
|
||||
|
||||
protected StrIntBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
protected StrIntBlockItem(string value, int secondValue)
|
||||
{
|
||||
Value = value;
|
||||
SecondValue = secondValue;
|
||||
Value = value;
|
||||
SecondValue = secondValue;
|
||||
}
|
||||
|
||||
public override string OutputText => PrefixText + " " + Value + " " + SecondValue + (ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
|
||||
|
||||
public override string SummaryText => string.Empty;
|
||||
public override Color SummaryBackgroundColor => Colors.Transparent;
|
||||
public override Color SummaryTextColor => Colors.Transparent;
|
||||
|
||||
public ThemeComponent ThemeComponent
|
||||
{
|
||||
get { return _themeComponent; }
|
||||
set
|
||||
{
|
||||
if (_themeComponent == value) { return; }
|
||||
|
||||
if (_themeComponent != null)
|
||||
{
|
||||
_themeComponent.ThemeComponentUpdated -= OnThemeComponentUpdated;
|
||||
_themeComponent.ThemeComponentDeleted -= OnThemeComponentDeleted;
|
||||
}
|
||||
if (value != null)
|
||||
{
|
||||
value.ThemeComponentUpdated += OnThemeComponentUpdated;
|
||||
value.ThemeComponentDeleted += OnThemeComponentDeleted;
|
||||
}
|
||||
|
||||
_themeComponent = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string Value
|
||||
{
|
||||
get { return _value; }
|
||||
set
|
||||
{
|
||||
_value = value;
|
||||
IsDirty = true;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int SecondValue
|
||||
{
|
||||
get { return _secondValue; }
|
||||
set
|
||||
{
|
||||
_secondValue = value;
|
||||
IsDirty = true;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnThemeComponentUpdated(object sender, EventArgs e)
|
||||
{
|
||||
Value = ((StrIntBlockItem)sender).Value;
|
||||
SecondValue = ((StrIntBlockItem)sender).SecondValue;
|
||||
}
|
||||
|
||||
private void OnThemeComponentDeleted(object sender, EventArgs e)
|
||||
{
|
||||
ThemeComponent = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
72
Filtration.ObjectModel/BlockItemBaseTypes/StringBlockItem.cs
Normal file
72
Filtration.ObjectModel/BlockItemBaseTypes/StringBlockItem.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.ThemeEditor;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
{
|
||||
public abstract class StringBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
|
||||
{
|
||||
private string _value;
|
||||
private ThemeComponent _themeComponent;
|
||||
|
||||
protected StringBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
protected StringBlockItem(string value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public override string OutputText => PrefixText + " \"" + Value + "\""
|
||||
+ (ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
|
||||
|
||||
public override string SummaryText => string.Empty;
|
||||
public override Color SummaryBackgroundColor => Colors.Transparent;
|
||||
public override Color SummaryTextColor => Colors.Transparent;
|
||||
|
||||
public ThemeComponent ThemeComponent
|
||||
{
|
||||
get { return _themeComponent; }
|
||||
set
|
||||
{
|
||||
if (_themeComponent == value) { return; }
|
||||
|
||||
if (_themeComponent != null)
|
||||
{
|
||||
_themeComponent.ThemeComponentUpdated -= OnThemeComponentUpdated;
|
||||
_themeComponent.ThemeComponentDeleted -= OnThemeComponentDeleted;
|
||||
}
|
||||
if (value != null)
|
||||
{
|
||||
value.ThemeComponentUpdated += OnThemeComponentUpdated;
|
||||
value.ThemeComponentDeleted += OnThemeComponentDeleted;
|
||||
}
|
||||
|
||||
_themeComponent = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string Value
|
||||
{
|
||||
get { return _value; }
|
||||
set
|
||||
{
|
||||
_value = value;
|
||||
IsDirty = true;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnThemeComponentUpdated(object sender, EventArgs e)
|
||||
{
|
||||
Value = ((StringThemeComponent)sender).Value;
|
||||
}
|
||||
|
||||
private void OnThemeComponentDeleted(object sender, EventArgs e)
|
||||
{
|
||||
ThemeComponent = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||
|
||||
public ObservableCollection<string> Items { get; protected set; }
|
||||
|
||||
public override bool IsDirty { get; protected set; }
|
||||
|
||||
private void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
IsDirty = true;
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public BackgroundColorBlockItem()
|
||||
{
|
||||
Color = new Color { A = 240, R = 0, G = 0, B = 0 };
|
||||
}
|
||||
|
||||
public BackgroundColorBlockItem(Color color) : base(color)
|
||||
@@ -16,6 +17,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
public override string PrefixText => "SetBackgroundColor";
|
||||
public override int MaximumAllowed => 1;
|
||||
public override string DisplayHeading => "Background Color";
|
||||
public override int SortOrder => 13;
|
||||
public override int SortOrder => 23;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
|
||||
public override Color SummaryBackgroundColor => Colors.MediumTurquoise;
|
||||
public override Color SummaryTextColor => Colors.Black;
|
||||
public override int SortOrder => 11;
|
||||
public override int SortOrder => 20;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public BorderColorBlockItem()
|
||||
{
|
||||
Color = new Color {A = 240, R = 0, G = 0, B = 0};
|
||||
}
|
||||
|
||||
public BorderColorBlockItem(Color color) : base(color)
|
||||
@@ -16,6 +17,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
public override string PrefixText => "SetBorderColor";
|
||||
public override int MaximumAllowed => 1;
|
||||
public override string DisplayHeading => "Border Color";
|
||||
public override int SortOrder => 14;
|
||||
public override int SortOrder => 24;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
|
||||
public override Color SummaryBackgroundColor => Colors.MediumSeaGreen;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 10;
|
||||
public override int SortOrder => 19;
|
||||
}
|
||||
}
|
||||
|
||||
23
Filtration.ObjectModel/BlockItemTypes/CorruptedBlockItem.cs
Normal file
23
Filtration.ObjectModel/BlockItemTypes/CorruptedBlockItem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public sealed class CorruptedBlockItem : BooleanBlockItem
|
||||
{
|
||||
public CorruptedBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public CorruptedBlockItem(bool booleanValue) : base(booleanValue)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "Corrupted";
|
||||
public override string DisplayHeading => "Corrupted";
|
||||
public override Color SummaryBackgroundColor => Colors.DarkRed;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 5;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public class CustomSoundBlockItem : StringBlockItem
|
||||
{
|
||||
public CustomSoundBlockItem()
|
||||
{
|
||||
Value = "placeholder.mp3";
|
||||
}
|
||||
|
||||
public CustomSoundBlockItem(string value) : base(value)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "CustomAlertSound";
|
||||
public override int MaximumAllowed => 1;
|
||||
public override string DisplayHeading => "Custom Alert Sound";
|
||||
public override int SortOrder => 31;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public sealed class DisableDropSoundBlockItem : BooleanBlockItem, IAudioVisualBlockItem
|
||||
{
|
||||
public DisableDropSoundBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public DisableDropSoundBlockItem(bool booleanValue) : base(booleanValue)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "DisableDropSound";
|
||||
public override string DisplayHeading => "Disable Drop Sound";
|
||||
public override Color SummaryBackgroundColor => Colors.Transparent;
|
||||
public override Color SummaryTextColor => Colors.Transparent;
|
||||
public override int SortOrder => 28;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
public override string SummaryText => "Drop Level " + FilterPredicate;
|
||||
public override Color SummaryBackgroundColor => Colors.DodgerBlue;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 2;
|
||||
public override int SortOrder => 15;
|
||||
public override int Minimum => 0;
|
||||
public override int Maximum => 100;
|
||||
}
|
||||
|
||||
23
Filtration.ObjectModel/BlockItemTypes/ElderItemBlockItem.cs
Normal file
23
Filtration.ObjectModel/BlockItemTypes/ElderItemBlockItem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public sealed class ElderItemBlockItem : BooleanBlockItem
|
||||
{
|
||||
public ElderItemBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public ElderItemBlockItem(bool booleanValue) : base(booleanValue)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "ElderItem";
|
||||
public override string DisplayHeading => "Elder Item";
|
||||
public override Color SummaryBackgroundColor => Colors.DarkGray;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 6;
|
||||
|
||||
}
|
||||
}
|
||||
23
Filtration.ObjectModel/BlockItemTypes/ElderMapBlockItem.cs
Normal file
23
Filtration.ObjectModel/BlockItemTypes/ElderMapBlockItem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public sealed class ElderMapBlockItem : BooleanBlockItem
|
||||
{
|
||||
public ElderMapBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public ElderMapBlockItem(bool booleanValue) : base(booleanValue)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "ElderMap";
|
||||
public override string DisplayHeading => "Elder Map";
|
||||
public override Color SummaryBackgroundColor => Colors.DarkGoldenrod;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 10;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
public override string PrefixText => "SetFontSize";
|
||||
public override int MaximumAllowed => 1;
|
||||
public override string DisplayHeading => "Font Size";
|
||||
public override int SortOrder => 15;
|
||||
public override int SortOrder => 25;
|
||||
public override int Minimum => 11;
|
||||
public override int Maximum => 45;
|
||||
}
|
||||
|
||||
28
Filtration.ObjectModel/BlockItemTypes/GemLevelBlockItem.cs
Normal file
28
Filtration.ObjectModel/BlockItemTypes/GemLevelBlockItem.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public class GemLevelBlockItem : NumericFilterPredicateBlockItem
|
||||
{
|
||||
public GemLevelBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public GemLevelBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand)
|
||||
: base(predicateOperator, predicateOperand)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "GemLevel";
|
||||
public override int MaximumAllowed => 2;
|
||||
public override string DisplayHeading => "Gem Level";
|
||||
public override string SummaryText => "Gem Level " + FilterPredicate;
|
||||
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 16;
|
||||
public override int Minimum => 0;
|
||||
public override int Maximum => 21;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public class HasExplicitModBlockItem : StringListBlockItem
|
||||
{
|
||||
public override string PrefixText => "HasExplicitMod";
|
||||
public override int MaximumAllowed => 8;
|
||||
public override string DisplayHeading => "Has Explicit Mod";
|
||||
|
||||
public override string SummaryText
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Items.Count > 0 && Items.Count < 4)
|
||||
{
|
||||
return "Item Explicit Mods: " +
|
||||
Items.Aggregate(string.Empty, (current, i) => current + i + ", ").TrimEnd(' ').TrimEnd(',');
|
||||
}
|
||||
if (Items.Count >= 4)
|
||||
{
|
||||
var remaining = Items.Count - 3;
|
||||
return "Item Explicit Mods: " + Items.Take(3)
|
||||
.Aggregate(string.Empty, (current, i) => current + i + ", ")
|
||||
.TrimEnd(' ')
|
||||
.TrimEnd(',') + " (+" + remaining + " more)";
|
||||
}
|
||||
return "Item Explicit Mods: (none)";
|
||||
}
|
||||
}
|
||||
|
||||
public override Color SummaryBackgroundColor => Colors.MidnightBlue;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 21;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
public override string SummaryText => "Height " + FilterPredicate;
|
||||
public override Color SummaryBackgroundColor => Colors.LightBlue;
|
||||
public override Color SummaryTextColor => Colors.Black;
|
||||
public override int SortOrder => 8;
|
||||
public override int SortOrder => 12;
|
||||
public override int Minimum => 0;
|
||||
public override int Maximum => 6;
|
||||
}
|
||||
|
||||
23
Filtration.ObjectModel/BlockItemTypes/IdentifiedBlockItem.cs
Normal file
23
Filtration.ObjectModel/BlockItemTypes/IdentifiedBlockItem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public sealed class IdentifiedBlockItem : BooleanBlockItem
|
||||
{
|
||||
public IdentifiedBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public IdentifiedBlockItem(bool booleanValue) : base(booleanValue)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "Identified";
|
||||
public override string DisplayHeading => "Identified";
|
||||
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 4;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
public override string SummaryText => "Item Level " + FilterPredicate;
|
||||
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 1;
|
||||
public override int SortOrder => 14;
|
||||
public override int Minimum => 0;
|
||||
public override int Maximum => 100;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
public override string SummaryText => "Linked Sockets " + FilterPredicate;
|
||||
public override Color SummaryBackgroundColor => Colors.Gold;
|
||||
public override Color SummaryTextColor => Colors.Black;
|
||||
public override int SortOrder => 6;
|
||||
public override int SortOrder => 1;
|
||||
public override int Minimum => 0;
|
||||
public override int Maximum => 6;
|
||||
}
|
||||
|
||||
24
Filtration.ObjectModel/BlockItemTypes/MapIconBlockItem.cs
Normal file
24
Filtration.ObjectModel/BlockItemTypes/MapIconBlockItem.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public class MapIconBlockItem : IconBlockItem
|
||||
{
|
||||
public MapIconBlockItem()
|
||||
{
|
||||
Size = IconSize.Largest;
|
||||
Color = IconColor.Red;
|
||||
Shape = IconShape.Circle;
|
||||
}
|
||||
|
||||
public MapIconBlockItem(IconSize size, IconColor iconColor, IconShape iconShape) : base(size, iconColor, iconShape)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "MinimapIcon";
|
||||
public override int MaximumAllowed => 1;
|
||||
public override string DisplayHeading => "Minimap Icon";
|
||||
public override int SortOrder => 29;
|
||||
}
|
||||
}
|
||||
28
Filtration.ObjectModel/BlockItemTypes/MapTierBlockItem.cs
Normal file
28
Filtration.ObjectModel/BlockItemTypes/MapTierBlockItem.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public class MapTierBlockItem : NumericFilterPredicateBlockItem
|
||||
{
|
||||
public MapTierBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public MapTierBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand)
|
||||
: base(predicateOperator, predicateOperand)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "MapTier";
|
||||
public override int MaximumAllowed => 2;
|
||||
public override string DisplayHeading => "Map Tier";
|
||||
public override string SummaryText => "Map Tier " + FilterPredicate;
|
||||
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 8;
|
||||
public override int Minimum => 1;
|
||||
public override int Maximum => 16;
|
||||
}
|
||||
}
|
||||
23
Filtration.ObjectModel/BlockItemTypes/PlayEffectBlockItem.cs
Normal file
23
Filtration.ObjectModel/BlockItemTypes/PlayEffectBlockItem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public class PlayEffectBlockItem : EffectColorBlockItem
|
||||
{
|
||||
public PlayEffectBlockItem()
|
||||
{
|
||||
Color = EffectColor.Red;
|
||||
Temporary = false;
|
||||
}
|
||||
|
||||
public PlayEffectBlockItem(EffectColor effectColor, bool temporary) : base(effectColor, temporary)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "PlayEffect";
|
||||
public override int MaximumAllowed => 1;
|
||||
public override string DisplayHeading => "Play Effect";
|
||||
public override int SortOrder => 30;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public class PositionalSoundBlockItem : StrIntBlockItem
|
||||
{
|
||||
public PositionalSoundBlockItem()
|
||||
{
|
||||
Value = "1";
|
||||
SecondValue = 79;
|
||||
}
|
||||
|
||||
public PositionalSoundBlockItem(string value, int secondValue) : base(value, secondValue)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "PlayAlertSoundPositional";
|
||||
public override int MaximumAllowed => 1;
|
||||
public override string DisplayHeading => "Play Positional Alert Sound";
|
||||
public override int SortOrder => 27;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 3;
|
||||
public override int Minimum => 0;
|
||||
public override int Maximum => 20;
|
||||
public override int Maximum => 30;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,11 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
}
|
||||
|
||||
public RarityBlockItem(FilterPredicateOperator predicateOperator, ItemRarity predicateOperand)
|
||||
: base(predicateOperator, (int)predicateOperand)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "Rarity";
|
||||
public override string OutputText => PrefixText + " " + FilterPredicate.PredicateOperator
|
||||
.GetAttributeDescription() + " " + ((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
|
||||
@@ -25,7 +30,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
|
||||
public override Color SummaryBackgroundColor => Colors.LightCoral;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 4;
|
||||
public override int SortOrder => 18;
|
||||
public override int Minimum => 0;
|
||||
public override int Maximum => (int)ItemRarity.Unique;
|
||||
}
|
||||
|
||||
23
Filtration.ObjectModel/BlockItemTypes/ShapedMapBlockItem.cs
Normal file
23
Filtration.ObjectModel/BlockItemTypes/ShapedMapBlockItem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public sealed class ShapedMapBlockItem : BooleanBlockItem
|
||||
{
|
||||
public ShapedMapBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public ShapedMapBlockItem(bool booleanValue) : base(booleanValue)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "ShapedMap";
|
||||
public override string DisplayHeading => "Shaped Map";
|
||||
public override Color SummaryBackgroundColor => Colors.DarkGoldenrod;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 9;
|
||||
|
||||
}
|
||||
}
|
||||
23
Filtration.ObjectModel/BlockItemTypes/ShaperItemBlockItem.cs
Normal file
23
Filtration.ObjectModel/BlockItemTypes/ShaperItemBlockItem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public sealed class ShaperItemBlockItem : BooleanBlockItem
|
||||
{
|
||||
public ShaperItemBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public ShaperItemBlockItem(bool booleanValue) : base(booleanValue)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "ShaperItem";
|
||||
public override string DisplayHeading => "Shaper Item";
|
||||
public override Color SummaryBackgroundColor => Colors.DimGray;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 7;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
|
||||
public override Color SummaryBackgroundColor => Colors.GhostWhite;
|
||||
public override Color SummaryTextColor => Colors.Black;
|
||||
public override int SortOrder => 9;
|
||||
public override int SortOrder => 11;
|
||||
|
||||
private SocketColor StringToSocketColor(char socketColorString)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
public override string SummaryText => "Sockets " + FilterPredicate;
|
||||
public override Color SummaryBackgroundColor => Colors.LightGray;
|
||||
public override Color SummaryTextColor => Colors.Black;
|
||||
public override int SortOrder => 5;
|
||||
public override int SortOrder => 2;
|
||||
public override int Minimum => 0;
|
||||
public override int Maximum => 6;
|
||||
}
|
||||
|
||||
@@ -2,21 +2,21 @@
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public class SoundBlockItem : DualIntegerBlockItem
|
||||
public class SoundBlockItem : StrIntBlockItem
|
||||
{
|
||||
public SoundBlockItem()
|
||||
{
|
||||
Value = 1;
|
||||
Value = "1";
|
||||
SecondValue = 79;
|
||||
}
|
||||
|
||||
public SoundBlockItem(int value, int secondValue) : base(value, secondValue)
|
||||
public SoundBlockItem(string value, int secondValue) : base(value, secondValue)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "PlayAlertSound";
|
||||
public override int MaximumAllowed => 1;
|
||||
public override string DisplayHeading => "Play Alert Sound";
|
||||
public override int SortOrder => 16;
|
||||
public override int SortOrder => 26;
|
||||
}
|
||||
}
|
||||
|
||||
28
Filtration.ObjectModel/BlockItemTypes/StackSizeBlockItem.cs
Normal file
28
Filtration.ObjectModel/BlockItemTypes/StackSizeBlockItem.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public class StackSizeBlockItem : NumericFilterPredicateBlockItem
|
||||
{
|
||||
public StackSizeBlockItem()
|
||||
{
|
||||
}
|
||||
|
||||
public StackSizeBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand)
|
||||
: base(predicateOperator, predicateOperand)
|
||||
{
|
||||
}
|
||||
|
||||
public override string PrefixText => "StackSize";
|
||||
public override int MaximumAllowed => 2;
|
||||
public override string DisplayHeading => "Stack Size";
|
||||
public override string SummaryText => "Stack Size " + FilterPredicate;
|
||||
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 17;
|
||||
public override int Minimum => 0;
|
||||
public override int Maximum => 1000;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
@@ -7,6 +8,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
{
|
||||
public TextColorBlockItem()
|
||||
{
|
||||
Color = PathOfExileNamedColors.Colors[PathOfExileNamedColor.WhiteItem];
|
||||
}
|
||||
|
||||
public TextColorBlockItem(Color color) : base(color)
|
||||
@@ -16,6 +18,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
public override string PrefixText => "SetTextColor";
|
||||
public override int MaximumAllowed => 1;
|
||||
public override string DisplayHeading => "Text Color";
|
||||
public override int SortOrder => 12;
|
||||
public override int SortOrder => 22;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||
public override string SummaryText => "Width " + FilterPredicate;
|
||||
public override Color SummaryBackgroundColor => Colors.MediumPurple;
|
||||
public override Color SummaryTextColor => Colors.White;
|
||||
public override int SortOrder => 7;
|
||||
public override int SortOrder => 13;
|
||||
public override int Minimum => 0;
|
||||
public override int Maximum => 2;
|
||||
}
|
||||
|
||||
61
Filtration.ObjectModel/Commands/CommandManager.cs
Normal file
61
Filtration.ObjectModel/Commands/CommandManager.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Filtration.ObjectModel.Commands
|
||||
{
|
||||
public interface ICommandManager
|
||||
{
|
||||
void ExecuteCommand(ICommand command);
|
||||
void Undo(int undoLevels = 1);
|
||||
void Redo(int redoLevels = 1);
|
||||
}
|
||||
|
||||
public interface ICommandManagerInternal : ICommandManager
|
||||
{
|
||||
void SetScript(IItemFilterScriptInternal layout);
|
||||
}
|
||||
|
||||
internal class CommandManager : ICommandManagerInternal
|
||||
{
|
||||
private readonly Stack<IUndoableCommand> _undoCommandStack = new Stack<IUndoableCommand>();
|
||||
private readonly Stack<IUndoableCommand> _redoCommandStack = new Stack<IUndoableCommand>();
|
||||
private IItemFilterScriptInternal _itemFilterScript;
|
||||
|
||||
public void SetScript(IItemFilterScriptInternal itemFilterScript)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
}
|
||||
|
||||
public void ExecuteCommand(ICommand command)
|
||||
{
|
||||
command.Execute();
|
||||
if (command is IUndoableCommand undoableCommand)
|
||||
{
|
||||
_undoCommandStack.Push(undoableCommand);
|
||||
_redoCommandStack.Clear();
|
||||
}
|
||||
_itemFilterScript.SetIsDirty(true);
|
||||
}
|
||||
|
||||
public void Undo(int undoLevels = 1)
|
||||
{
|
||||
for (var index = undoLevels; _undoCommandStack.Count > 0 && index > 0; --index)
|
||||
{
|
||||
var undoableCommand = _undoCommandStack.Pop();
|
||||
undoableCommand.Undo();
|
||||
_redoCommandStack.Push(undoableCommand);
|
||||
}
|
||||
_itemFilterScript.SetIsDirty(true);
|
||||
}
|
||||
|
||||
public void Redo(int redoLevels = 1)
|
||||
{
|
||||
for (int index = redoLevels; _redoCommandStack.Count > 0 && index > 0; --index)
|
||||
{
|
||||
var undoableCommand = _redoCommandStack.Pop();
|
||||
undoableCommand.Redo();
|
||||
_undoCommandStack.Push(undoableCommand);
|
||||
}
|
||||
_itemFilterScript.SetIsDirty(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
7
Filtration.ObjectModel/Commands/ICommand.cs
Normal file
7
Filtration.ObjectModel/Commands/ICommand.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Filtration.ObjectModel.Commands
|
||||
{
|
||||
public interface ICommand
|
||||
{
|
||||
void Execute();
|
||||
}
|
||||
}
|
||||
8
Filtration.ObjectModel/Commands/IUndoableCommand.cs
Normal file
8
Filtration.ObjectModel/Commands/IUndoableCommand.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Filtration.ObjectModel.Commands
|
||||
{
|
||||
internal interface IUndoableCommand : ICommand
|
||||
{
|
||||
void Undo();
|
||||
void Redo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
namespace Filtration.ObjectModel.Commands.ItemFilterScript
|
||||
{
|
||||
public class AddBlockCommand : IUndoableCommand
|
||||
{
|
||||
private readonly IItemFilterScript _itemFilterScript;
|
||||
private readonly IItemFilterBlockBase _addAfterItemFilterBlock;
|
||||
private IItemFilterBlock _newItemFilterBlock;
|
||||
|
||||
public AddBlockCommand(IItemFilterScript itemFilterScript, IItemFilterBlockBase addAfterItemFilterBlock)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_addAfterItemFilterBlock = addAfterItemFilterBlock;
|
||||
}
|
||||
public void Execute()
|
||||
{
|
||||
_newItemFilterBlock = new ItemFilterBlock(_itemFilterScript);
|
||||
if (_addAfterItemFilterBlock != null)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Insert(_itemFilterScript.ItemFilterBlocks.IndexOf(_addAfterItemFilterBlock) + 1, _newItemFilterBlock);
|
||||
}
|
||||
else
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Add(_newItemFilterBlock);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Undo()
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Remove(_newItemFilterBlock);
|
||||
}
|
||||
|
||||
public void Redo() => Execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace Filtration.ObjectModel.Commands.ItemFilterScript
|
||||
{
|
||||
public class AddCommentBlockCommand : IUndoableCommand
|
||||
{
|
||||
private readonly IItemFilterScript _itemFilterScript;
|
||||
private readonly IItemFilterBlockBase _addAfterItemFilterBlock;
|
||||
private IItemFilterCommentBlock _newItemFilterBlock;
|
||||
|
||||
public AddCommentBlockCommand(IItemFilterScript itemFilterScript, IItemFilterBlockBase addAfterItemFilterBlock)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_addAfterItemFilterBlock = addAfterItemFilterBlock;
|
||||
}
|
||||
public void Execute()
|
||||
{
|
||||
_newItemFilterBlock = new ItemFilterCommentBlock(_itemFilterScript)
|
||||
{
|
||||
Comment = string.Empty
|
||||
};
|
||||
if (_addAfterItemFilterBlock != null)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Insert(_itemFilterScript.ItemFilterBlocks.IndexOf(_addAfterItemFilterBlock) + 1, _newItemFilterBlock);
|
||||
}
|
||||
else
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Add(_newItemFilterBlock);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Undo()
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Remove(_newItemFilterBlock);
|
||||
}
|
||||
|
||||
public void Redo() => Execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Filtration.ObjectModel.Commands.ItemFilterScript
|
||||
{
|
||||
public class MoveBlocksToBottomCommand : IUndoableCommand
|
||||
{
|
||||
private readonly IItemFilterScript _itemFilterScript;
|
||||
private readonly List<int> _sourceIndexes;
|
||||
|
||||
public MoveBlocksToBottomCommand(IItemFilterScript itemFilterScript, IItemFilterBlockBase block)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_sourceIndexes = new List<int> { _itemFilterScript.ItemFilterBlocks.IndexOf(block) };
|
||||
}
|
||||
|
||||
public MoveBlocksToBottomCommand(IItemFilterScript itemFilterScript, List<int> sourceIndexes)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_sourceIndexes = sourceIndexes;
|
||||
_sourceIndexes.Sort();
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
List<IItemFilterBlockBase> blocksToMove = new List<IItemFilterBlockBase>();
|
||||
for (var i = 0; i < _sourceIndexes.Count; i++)
|
||||
{
|
||||
blocksToMove.Add(_itemFilterScript.ItemFilterBlocks[_sourceIndexes[i]]);
|
||||
}
|
||||
|
||||
for (var i = _sourceIndexes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.RemoveAt(_sourceIndexes[i]);
|
||||
}
|
||||
|
||||
foreach (var block in blocksToMove)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Add(block);
|
||||
}
|
||||
}
|
||||
|
||||
public void Undo()
|
||||
{
|
||||
List<IItemFilterBlockBase> blocksToMove = new List<IItemFilterBlockBase>();
|
||||
for (var i = 0; i < _sourceIndexes.Count; i++)
|
||||
{
|
||||
var movedIndex = _itemFilterScript.ItemFilterBlocks.Count - _sourceIndexes.Count;
|
||||
blocksToMove.Add(_itemFilterScript.ItemFilterBlocks[movedIndex]);
|
||||
_itemFilterScript.ItemFilterBlocks.RemoveAt(movedIndex);
|
||||
}
|
||||
|
||||
for (var i = 0; i < _sourceIndexes.Count; i++)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Insert(_sourceIndexes[i], blocksToMove[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void Redo() => Execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Filtration.ObjectModel.Commands.ItemFilterScript
|
||||
{
|
||||
public class MoveBlocksToIndexCommand : IUndoableCommand
|
||||
{
|
||||
private readonly IItemFilterScript _itemFilterScript;
|
||||
private List<int> _sourceIndexes;
|
||||
private int _targetIndex;
|
||||
|
||||
public MoveBlocksToIndexCommand(IItemFilterScript itemFilterScript, IItemFilterBlockBase block, int targetIndex)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_sourceIndexes = new List<int> { _itemFilterScript.ItemFilterBlocks.IndexOf(block) };
|
||||
_targetIndex = targetIndex;
|
||||
}
|
||||
|
||||
public MoveBlocksToIndexCommand(IItemFilterScript itemFilterScript, List<int> sourceIndexes, int targetIndex)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_sourceIndexes = sourceIndexes;
|
||||
_sourceIndexes.Sort();
|
||||
_targetIndex = targetIndex;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
List<IItemFilterBlockBase> blocksToMove = new List<IItemFilterBlockBase>();
|
||||
for (var i = 0; i < _sourceIndexes.Count; i++)
|
||||
{
|
||||
blocksToMove.Add(_itemFilterScript.ItemFilterBlocks[_sourceIndexes[i]]);
|
||||
}
|
||||
|
||||
for (var i = _sourceIndexes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.RemoveAt(_sourceIndexes[i]);
|
||||
}
|
||||
|
||||
for (var i = 0; i < blocksToMove.Count; i++)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Insert(_targetIndex + i, blocksToMove[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void Undo()
|
||||
{
|
||||
List<IItemFilterBlockBase> blocksToMove = new List<IItemFilterBlockBase>();
|
||||
for (var i = 0; i < _sourceIndexes.Count; i++)
|
||||
{
|
||||
blocksToMove.Add(_itemFilterScript.ItemFilterBlocks[_targetIndex]);
|
||||
_itemFilterScript.ItemFilterBlocks.RemoveAt(_targetIndex);
|
||||
}
|
||||
|
||||
for (var i = 0; i < _sourceIndexes.Count; i++)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Insert(_sourceIndexes[i], blocksToMove[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void Redo() => Execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Filtration.ObjectModel.Commands.ItemFilterScript
|
||||
{
|
||||
public class MoveBlocksToTopCommand : IUndoableCommand
|
||||
{
|
||||
private readonly IItemFilterScript _itemFilterScript;
|
||||
private readonly List<int> _sourceIndexes;
|
||||
|
||||
public MoveBlocksToTopCommand(IItemFilterScript itemFilterScript, IItemFilterBlockBase block)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_sourceIndexes = new List<int> { _itemFilterScript.ItemFilterBlocks.IndexOf(block) };
|
||||
}
|
||||
|
||||
public MoveBlocksToTopCommand(IItemFilterScript itemFilterScript, List<int> sourceIndexes)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_sourceIndexes = sourceIndexes;
|
||||
_sourceIndexes.Sort();
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
List<IItemFilterBlockBase> blocksToMove = new List<IItemFilterBlockBase>();
|
||||
for (var i = 0; i < _sourceIndexes.Count; i++)
|
||||
{
|
||||
blocksToMove.Add(_itemFilterScript.ItemFilterBlocks[_sourceIndexes[i]]);
|
||||
}
|
||||
|
||||
for (var i = _sourceIndexes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.RemoveAt(_sourceIndexes[i]);
|
||||
}
|
||||
|
||||
for (var i = 0; i < _sourceIndexes.Count; i++)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Insert(i, blocksToMove[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void Undo()
|
||||
{
|
||||
List<IItemFilterBlockBase> blocksToMove = new List<IItemFilterBlockBase>();
|
||||
for (var i = 0; i < _sourceIndexes.Count; i++)
|
||||
{
|
||||
blocksToMove.Add(_itemFilterScript.ItemFilterBlocks[0]);
|
||||
_itemFilterScript.ItemFilterBlocks.RemoveAt(0);
|
||||
}
|
||||
|
||||
for (var i = 0; i < _sourceIndexes.Count; i++)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Insert(_sourceIndexes[i], blocksToMove[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void Redo() => Execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Filtration.ObjectModel.Commands.ItemFilterScript
|
||||
{
|
||||
public class PasteBlocksCommand : IUndoableCommand
|
||||
{
|
||||
private readonly IItemFilterScript _itemFilterScript;
|
||||
private readonly List<IItemFilterBlockBase> _pastedItemFilterBlocks;
|
||||
private readonly IItemFilterBlockBase _addAfterItemFilterBlock;
|
||||
|
||||
public PasteBlocksCommand(IItemFilterScript itemFilterScript, IItemFilterBlockBase block, IItemFilterBlockBase addAfterItemFilterBlock)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_pastedItemFilterBlocks = new List<IItemFilterBlockBase> { block };
|
||||
_addAfterItemFilterBlock = addAfterItemFilterBlock;
|
||||
}
|
||||
|
||||
public PasteBlocksCommand(IItemFilterScript itemFilterScript, List<IItemFilterBlockBase> pastedItemFilterBlocks, IItemFilterBlockBase addAfterItemFilterBlock)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_pastedItemFilterBlocks = pastedItemFilterBlocks;
|
||||
_addAfterItemFilterBlock = addAfterItemFilterBlock;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
if (_addAfterItemFilterBlock != null)
|
||||
{
|
||||
var lastAddedBlock = _addAfterItemFilterBlock;
|
||||
foreach (var block in _pastedItemFilterBlocks)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Insert(_itemFilterScript.ItemFilterBlocks.IndexOf(lastAddedBlock) + 1, block);
|
||||
lastAddedBlock = block;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var block in _pastedItemFilterBlocks)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Add(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Undo()
|
||||
{
|
||||
foreach (var block in _pastedItemFilterBlocks)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Remove(block);
|
||||
}
|
||||
}
|
||||
|
||||
public void Redo() => Execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Filtration.ObjectModel.Commands.ItemFilterScript
|
||||
{
|
||||
public class PasteSectionCommand : IUndoableCommand
|
||||
{
|
||||
private readonly IItemFilterScript _itemFilterScript;
|
||||
private readonly List<IItemFilterBlockBase> _pastedItemFilterBlocks;
|
||||
private readonly IItemFilterBlockBase _addAfterItemFilterBlock;
|
||||
|
||||
public PasteSectionCommand(IItemFilterScript itemFilterScript, List<IItemFilterBlockBase> pastedItemFilterBlocks, IItemFilterBlockBase addAfterItemFilterBlock)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_pastedItemFilterBlocks = pastedItemFilterBlocks;
|
||||
_addAfterItemFilterBlock = addAfterItemFilterBlock;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
if (_addAfterItemFilterBlock != null)
|
||||
{
|
||||
var lastAddedBlock = _addAfterItemFilterBlock;
|
||||
foreach(var block in _pastedItemFilterBlocks)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Insert(_itemFilterScript.ItemFilterBlocks.IndexOf(lastAddedBlock) + 1, block);
|
||||
lastAddedBlock = block;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var block in _pastedItemFilterBlocks)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Add(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Undo()
|
||||
{
|
||||
foreach (var block in _pastedItemFilterBlocks)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Remove(block);
|
||||
}
|
||||
}
|
||||
|
||||
public void Redo() => Execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Filtration.ObjectModel.Commands.ItemFilterScript
|
||||
{
|
||||
public class RemoveBlocksCommand : IUndoableCommand
|
||||
{
|
||||
private readonly IItemFilterScript _itemFilterScript;
|
||||
private List<IItemFilterBlockBase> _removedItemFilterBlocks;
|
||||
private List<int> _sourceIndexes;
|
||||
|
||||
public RemoveBlocksCommand(IItemFilterScript itemFilterScript, IItemFilterBlockBase block)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_sourceIndexes = new List<int> { _itemFilterScript.ItemFilterBlocks.IndexOf(block) };
|
||||
_removedItemFilterBlocks = new List<IItemFilterBlockBase> { block };
|
||||
}
|
||||
|
||||
public RemoveBlocksCommand(IItemFilterScript itemFilterScript, List<int> sourceIndexes)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_sourceIndexes = sourceIndexes;
|
||||
_sourceIndexes.Sort();
|
||||
_removedItemFilterBlocks = new List<IItemFilterBlockBase>();
|
||||
for (var i = 0; i < _sourceIndexes.Count; i++)
|
||||
{
|
||||
_removedItemFilterBlocks.Add(_itemFilterScript.ItemFilterBlocks[_sourceIndexes[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
for (var i = _sourceIndexes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.RemoveAt(_sourceIndexes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void Undo()
|
||||
{
|
||||
for (var i = 0; i < _sourceIndexes.Count; i++)
|
||||
{
|
||||
_itemFilterScript.ItemFilterBlocks.Insert(_sourceIndexes[i], _removedItemFilterBlocks[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void Redo() => Execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
|
||||
namespace Filtration.ObjectModel.Commands.ItemFilterScript
|
||||
{
|
||||
public class SetScriptDescriptionCommand : IUndoableCommand
|
||||
{
|
||||
private readonly IItemFilterScript _itemFilterScript;
|
||||
private readonly string _newDescription;
|
||||
private string _oldDescription;
|
||||
|
||||
public SetScriptDescriptionCommand(IItemFilterScript itemFilterScript, string newDescription)
|
||||
{
|
||||
_itemFilterScript = itemFilterScript;
|
||||
_newDescription = newDescription;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
_oldDescription = _itemFilterScript.Description;
|
||||
_itemFilterScript.Description = _newDescription;
|
||||
}
|
||||
|
||||
public void Undo()
|
||||
{
|
||||
_itemFilterScript.Description = _oldDescription;
|
||||
}
|
||||
|
||||
public void Redo() => Execute();
|
||||
}
|
||||
}
|
||||
20
Filtration.ObjectModel/Enums/EffectColor.cs
Normal file
20
Filtration.ObjectModel/Enums/EffectColor.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Filtration.ObjectModel.Enums
|
||||
{
|
||||
public enum EffectColor
|
||||
{
|
||||
[Description("Red")]
|
||||
Red,
|
||||
[Description("Green")]
|
||||
Green,
|
||||
[Description("Blue")]
|
||||
Blue,
|
||||
[Description("Brown")]
|
||||
Brown,
|
||||
[Description("White")]
|
||||
White,
|
||||
[Description("Yellow")]
|
||||
Yellow
|
||||
}
|
||||
}
|
||||
26
Filtration.ObjectModel/Enums/IconColor.cs
Normal file
26
Filtration.ObjectModel/Enums/IconColor.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Filtration.ObjectModel.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Each of the colors supported by the MinimapIcon block rule.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The ordering here should match the ordering of the colors within the source image.
|
||||
/// </remarks>
|
||||
public enum IconColor
|
||||
{
|
||||
[Description("Blue")]
|
||||
Blue,
|
||||
[Description("Green")]
|
||||
Green,
|
||||
[Description("Brown")]
|
||||
Brown,
|
||||
[Description("Red")]
|
||||
Red,
|
||||
[Description("White")]
|
||||
White,
|
||||
[Description("Yellow")]
|
||||
Yellow
|
||||
}
|
||||
}
|
||||
26
Filtration.ObjectModel/Enums/IconShape.cs
Normal file
26
Filtration.ObjectModel/Enums/IconShape.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Filtration.ObjectModel.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Each of the shapes supported by the MinimapIcon block rule.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The ordering here should match the ordering of the shapes within the source image.
|
||||
/// </remarks>
|
||||
public enum IconShape
|
||||
{
|
||||
[Description("Circle")]
|
||||
Circle,
|
||||
[Description("Diamond")]
|
||||
Diamond,
|
||||
[Description("Hexagon")]
|
||||
Hexagon,
|
||||
[Description("Square")]
|
||||
Square,
|
||||
[Description("Star")]
|
||||
Star,
|
||||
[Description("Triangle")]
|
||||
Triangle
|
||||
}
|
||||
}
|
||||
20
Filtration.ObjectModel/Enums/IconSize.cs
Normal file
20
Filtration.ObjectModel/Enums/IconSize.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Filtration.ObjectModel.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Each of the sizes supported by the MinimapIcon block rule.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The ordering here should match the ordering of the sizes within the source image.
|
||||
/// </remarks>
|
||||
public enum IconSize
|
||||
{
|
||||
[Description("Largest")]
|
||||
Largest,
|
||||
[Description("Medium")]
|
||||
Medium,
|
||||
[Description("Small")]
|
||||
Small
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,16 @@ namespace Filtration.ObjectModel.Enums
|
||||
[Description("Background")]
|
||||
BackgroundColor,
|
||||
[Description("Border")]
|
||||
BorderColor
|
||||
BorderColor,
|
||||
[Description("Font Size")]
|
||||
FontSize,
|
||||
[Description("Alert Sound")]
|
||||
AlertSound,
|
||||
[Description("Custom Sound")]
|
||||
CustomSound,
|
||||
[Description("Icon")]
|
||||
Icon,
|
||||
[Description("Effect")]
|
||||
Effect
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Filtration.ObjectModel.Factories
|
||||
{
|
||||
public interface IItemFilterScriptFactory
|
||||
{
|
||||
IItemFilterScript Create();
|
||||
|
||||
void Release(IItemFilterScript itemFilterScript);
|
||||
}
|
||||
}
|
||||
@@ -24,8 +24,8 @@ namespace Filtration.ObjectModel
|
||||
ItemFilterBlock = itemFilterBlock;
|
||||
|
||||
BlockAction = itemFilterBlock?.Action ?? BlockAction.Show;
|
||||
BackgroundColor = itemFilterBlock?.DisplayBackgroundColor ?? new Color { A = 255, R = 0, G = 0, B = 0 };
|
||||
BorderColor = itemFilterBlock?.DisplayBorderColor ?? new Color {A = 255, R = 0, G = 0, B = 0};
|
||||
BackgroundColor = itemFilterBlock?.DisplayBackgroundColor ?? new Color { A = 240, R = 0, G = 0, B = 0 };
|
||||
BorderColor = itemFilterBlock?.DisplayBorderColor ?? new Color {A = 240, R = 0, G = 0, B = 0};
|
||||
FontSize = (itemFilterBlock?.DisplayFontSize ?? 34) / 1.8;
|
||||
|
||||
SetTextColor();
|
||||
|
||||
@@ -31,10 +31,32 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.3.3.0\lib\net45\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Castle.Windsor, Version=3.4.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Windsor.3.4.0\lib\net45\Castle.Windsor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -43,45 +65,83 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BlockItemBaseTypes\ActionBlockItem.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\BlockItembase.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\BlockItemBase.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\BooleanBlockItem.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\ColorBlockItem.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\ColorBooleanBlockItem.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\DualIntegerBlockItem.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\EffectColorBlockItem.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\IconBlockItem.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\StringBlockItem.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\StrIntBlockItem.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\IntegerBlockItem.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\NumericFilterPredicateBlockItem.cs" />
|
||||
<Compile Include="BlockItemBaseTypes\StringListBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\BackgroundColorBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\BaseTypeBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\MapTierBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\PlayEffectBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\BorderColorBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\ClassBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\CustomSoundBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\DisableDropSoundBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\ElderMapBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\GemLevelBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\HasExplicitModBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\MapIconBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\ShapedMapBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\ShaperItemBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\ElderItemBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\CorruptedBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\DropLevelBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\FontSizeBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\HeightBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\IdentifiedBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\ItemLevelBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\LinkedSocketsBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\QualityBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\RarityBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\SocketGroupBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\SocketsBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\PositionalSoundBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\SoundBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\StackSizeBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\TextColorBlockItem.cs" />
|
||||
<Compile Include="BlockItemTypes\WidthBlockItem.cs" />
|
||||
<Compile Include="Commands\CommandManager.cs" />
|
||||
<Compile Include="Commands\ICommand.cs" />
|
||||
<Compile Include="Commands\ItemFilterScript\MoveBlocksToIndexCommand.cs" />
|
||||
<Compile Include="Commands\ItemFilterScript\MoveBlocksToBottomCommand.cs" />
|
||||
<Compile Include="Commands\ItemFilterScript\AddCommentBlockCommand.cs" />
|
||||
<Compile Include="Commands\ItemFilterScript\MoveBlocksToTopCommand.cs" />
|
||||
<Compile Include="Commands\ItemFilterScript\PasteBlocksCommand.cs" />
|
||||
<Compile Include="Commands\ItemFilterScript\RemoveBlocksCommand.cs" />
|
||||
<Compile Include="Commands\ItemFilterScript\SetScriptDescriptionCommand.cs" />
|
||||
<Compile Include="Commands\ItemFilterScript\AddBlockCommand.cs" />
|
||||
<Compile Include="Commands\IUndoableCommand.cs" />
|
||||
<Compile Include="Enums\BlockAction.cs" />
|
||||
<Compile Include="Enums\BlockItemType.cs" />
|
||||
<Compile Include="Enums\EffectColor.cs" />
|
||||
<Compile Include="Enums\FilterPredicateOperator.cs" />
|
||||
<Compile Include="Enums\FilterType.cs" />
|
||||
<Compile Include="Enums\IconColor.cs" />
|
||||
<Compile Include="Enums\IconShape.cs" />
|
||||
<Compile Include="Enums\IconSize.cs" />
|
||||
<Compile Include="Enums\ItemRarity.cs" />
|
||||
<Compile Include="Enums\SocketColor.cs" />
|
||||
<Compile Include="Enums\ThemeComponentType.cs" />
|
||||
<Compile Include="Extensions\EnumHelper.cs" />
|
||||
<Compile Include="Extensions\ItemRarityExtensions.cs" />
|
||||
<Compile Include="Factories\IItemFilterScriptFactory.cs" />
|
||||
<Compile Include="FilteredItem.cs" />
|
||||
<Compile Include="IAudioVisualBlockItem.cs" />
|
||||
<Compile Include="IBlockItemWithTheme.cs" />
|
||||
<Compile Include="IItemFilterBlockItem.cs" />
|
||||
<Compile Include="Item.cs" />
|
||||
<Compile Include="ItemFilterBlock.cs" />
|
||||
<Compile Include="ItemFilterBlockGroup.cs" />
|
||||
<Compile Include="ItemFilterScript.cs" />
|
||||
<Compile Include="ItemFilterSection.cs" />
|
||||
<Compile Include="ItemFilterScriptSettings.cs" />
|
||||
<Compile Include="ItemSet.cs" />
|
||||
<Compile Include="NumericFilterPredicate.cs" />
|
||||
<Compile Include="PathOfExileNamedColors.cs" />
|
||||
@@ -91,9 +151,20 @@
|
||||
<Compile Include="ReplaceColorsParameterSet.cs" />
|
||||
<Compile Include="Socket.cs" />
|
||||
<Compile Include="SocketGroup.cs" />
|
||||
<Compile Include="ThemeEditor\EffectColorThemeComponent.cs" />
|
||||
<Compile Include="ThemeEditor\IconThemeComponent.cs" />
|
||||
<Compile Include="ThemeEditor\StringThemeComponent.cs" />
|
||||
<Compile Include="ThemeEditor\StrIntThemeComponent.cs" />
|
||||
<Compile Include="ThemeEditor\IntegerThemeComponent.cs" />
|
||||
<Compile Include="ThemeEditor\Theme.cs" />
|
||||
<Compile Include="ThemeEditor\ColorThemeComponent.cs" />
|
||||
<Compile Include="ThemeEditor\ThemeComponent.cs" />
|
||||
<Compile Include="ThemeEditor\ThemeComponentCollection.cs" />
|
||||
<Compile Include="WindsorInstallers\CommandsInstaller.cs" />
|
||||
<Compile Include="WindsorInstallers\ModelsInstaller.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
9
Filtration.ObjectModel/IBlockItemWithTheme.cs
Normal file
9
Filtration.ObjectModel/IBlockItemWithTheme.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Filtration.ObjectModel.ThemeEditor;
|
||||
|
||||
namespace Filtration.ObjectModel
|
||||
{
|
||||
public interface IBlockItemWithTheme : IItemFilterBlockItem
|
||||
{
|
||||
ThemeComponent ThemeComponent { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,6 @@ namespace Filtration.ObjectModel
|
||||
{
|
||||
public interface IItemFilterBlockItem : INotifyPropertyChanged
|
||||
{
|
||||
event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
string PrefixText { get; }
|
||||
string OutputText { get; }
|
||||
string DisplayHeading { get; }
|
||||
@@ -16,5 +14,6 @@ namespace Filtration.ObjectModel
|
||||
int MaximumAllowed { get; }
|
||||
int SortOrder { get; }
|
||||
bool IsDirty { get; }
|
||||
string Comment { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,47 +1,136 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
using Filtration.ObjectModel.BlockItemTypes;
|
||||
using Filtration.ObjectModel.Commands;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
using Filtration.ObjectModel.Extensions;
|
||||
|
||||
namespace Filtration.ObjectModel
|
||||
{
|
||||
public interface IItemFilterBlock
|
||||
public interface IItemFilterBlock : IItemFilterBlockBase
|
||||
{
|
||||
bool Enabled { get; set; }
|
||||
event EventHandler EnabledStatusChanged;
|
||||
string Description { get; set; }
|
||||
ItemFilterBlockGroup BlockGroup { get; set; }
|
||||
BlockAction Action { get; set; }
|
||||
ActionBlockItem ActionBlockItem { get; }
|
||||
ObservableCollection<IItemFilterBlockItem> BlockItems { get; }
|
||||
Color DisplayBackgroundColor { get; }
|
||||
Color DisplayTextColor { get; }
|
||||
Color DisplayBorderColor { get; }
|
||||
double DisplayFontSize { get; }
|
||||
int BlockCount(Type type);
|
||||
bool AddBlockItemAllowed(Type type);
|
||||
int DisplayIconSize { get; }
|
||||
int DisplayIconColor { get; }
|
||||
int DisplayIconShape { get; }
|
||||
Color DisplayEffectColor { get; }
|
||||
bool HasBlockItemOfType<T>();
|
||||
bool HasBlockGroupInParentHierarchy(ItemFilterBlockGroup targetBlockGroup, ItemFilterBlockGroup startingBlockGroup);
|
||||
}
|
||||
|
||||
public class ItemFilterBlock : IItemFilterBlock
|
||||
public interface IItemFilterBlockBase
|
||||
{
|
||||
private ItemFilterBlockGroup _blockGroup;
|
||||
bool IsEdited { get; set; }
|
||||
string OriginalText { get; set; }
|
||||
}
|
||||
|
||||
public ItemFilterBlock()
|
||||
public abstract class ItemFilterBlockBase : IItemFilterBlockBase
|
||||
{
|
||||
protected ItemFilterBlockBase()
|
||||
{
|
||||
BlockItems = new ObservableCollection<IItemFilterBlockItem> {new ActionBlockItem(BlockAction.Show)};
|
||||
Enabled = true;
|
||||
}
|
||||
|
||||
public bool Enabled { get; set; }
|
||||
public string Description { get; set; }
|
||||
protected ItemFilterBlockBase(IItemFilterScript parentScript)
|
||||
{
|
||||
CommandManager = parentScript.CommandManager;
|
||||
ParentScript = parentScript;
|
||||
}
|
||||
|
||||
public ICommandManager CommandManager { get; }
|
||||
public IItemFilterScript ParentScript { get; set; }
|
||||
public bool IsEdited { get; set; }
|
||||
public string OriginalText { get; set; }
|
||||
}
|
||||
|
||||
public interface IItemFilterCommentBlock : IItemFilterBlockBase
|
||||
{
|
||||
string Comment { get; set; }
|
||||
}
|
||||
|
||||
public class ItemFilterCommentBlock : ItemFilterBlockBase, IItemFilterCommentBlock
|
||||
{
|
||||
private string _comment;
|
||||
public ItemFilterCommentBlock(IItemFilterScript parentScript) : base(parentScript)
|
||||
{
|
||||
}
|
||||
|
||||
public string Comment
|
||||
{
|
||||
get { return _comment; }
|
||||
set
|
||||
{
|
||||
_comment = value;
|
||||
IsEdited = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemFilterBlock : ItemFilterBlockBase, IItemFilterBlock
|
||||
{
|
||||
private ItemFilterBlockGroup _blockGroup;
|
||||
private bool _enabled;
|
||||
private string _description;
|
||||
|
||||
internal ItemFilterBlock()
|
||||
{
|
||||
BlockItems = new ObservableCollection<IItemFilterBlockItem> { ActionBlockItem };
|
||||
BlockItems.CollectionChanged += new NotifyCollectionChangedEventHandler(OnBlockItemsChanged);
|
||||
ActionBlockItem.PropertyChanged += OnActionBlockItemChanged;
|
||||
_enabled = true;
|
||||
}
|
||||
|
||||
public ItemFilterBlock(IItemFilterScript parentScript) : base(parentScript)
|
||||
{
|
||||
BlockItems = new ObservableCollection<IItemFilterBlockItem> { ActionBlockItem };
|
||||
BlockItems.CollectionChanged += new NotifyCollectionChangedEventHandler(OnBlockItemsChanged);
|
||||
ActionBlockItem.PropertyChanged += OnActionBlockItemChanged;
|
||||
_enabled = true;
|
||||
}
|
||||
|
||||
public bool Enabled
|
||||
{
|
||||
get { return _enabled; }
|
||||
set
|
||||
{
|
||||
_enabled = value;
|
||||
IsEdited = true;
|
||||
EnabledStatusChanged?.Invoke(null, null);
|
||||
if(BlockGroup != null && BlockGroup.IsEnableChecked != value)
|
||||
{
|
||||
BlockGroup.IsEnableChecked = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler EnabledStatusChanged;
|
||||
|
||||
public string Description
|
||||
{
|
||||
get { return _description; }
|
||||
set
|
||||
{
|
||||
_description = value;
|
||||
IsEdited = true;
|
||||
}
|
||||
}
|
||||
|
||||
public ItemFilterBlockGroup BlockGroup
|
||||
{
|
||||
get { return _blockGroup; }
|
||||
get => _blockGroup;
|
||||
set
|
||||
{
|
||||
var oldBlockGroup = _blockGroup;
|
||||
@@ -76,20 +165,34 @@ namespace Filtration.ObjectModel
|
||||
{
|
||||
var actionBlock = BlockItems.OfType<ActionBlockItem>().First();
|
||||
actionBlock.Action = value;
|
||||
IsEdited = true;
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<IItemFilterBlockItem> BlockItems { get; }
|
||||
public ActionBlockItem ActionBlockItem { get; } = new ActionBlockItem(BlockAction.Show);
|
||||
|
||||
public int BlockCount(Type type)
|
||||
public ObservableCollection<IItemFilterBlockItem> BlockItems { get; }
|
||||
private void OnBlockItemsChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
return BlockItems?.Count(b => b.GetType() == type) ?? 0;
|
||||
IsEdited = true;
|
||||
}
|
||||
private void OnActionBlockItemChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (BlockGroup != null && BlockGroup.IsShowChecked != (Action == BlockAction.Show))
|
||||
{
|
||||
BlockGroup.IsShowChecked = (Action == BlockAction.Show);
|
||||
}
|
||||
}
|
||||
|
||||
public bool AddBlockItemAllowed(Type type)
|
||||
{
|
||||
int BlockCount()
|
||||
{
|
||||
return BlockItems?.Count(b => b.GetType() == type) ?? 0;
|
||||
}
|
||||
|
||||
var blockItem = (IItemFilterBlockItem)Activator.CreateInstance(type);
|
||||
return BlockCount(type) < blockItem.MaximumAllowed;
|
||||
return BlockCount() < blockItem.MaximumAllowed;
|
||||
}
|
||||
|
||||
public bool HasBlockItemOfType<T>()
|
||||
@@ -113,14 +216,23 @@ namespace Filtration.ObjectModel
|
||||
|
||||
private void OnBlockGroupStatusChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (BlockGroup.IsChecked == false && Action == BlockAction.Show)
|
||||
if (BlockGroup.IsShowChecked == false && Action == BlockAction.Show)
|
||||
{
|
||||
Action = BlockAction.Hide;
|
||||
}
|
||||
else if (BlockGroup.IsChecked && Action == BlockAction.Hide)
|
||||
else if (BlockGroup.IsShowChecked == true && Action == BlockAction.Hide)
|
||||
{
|
||||
Action = BlockAction.Show;
|
||||
}
|
||||
|
||||
if (BlockGroup.IsEnableChecked == false && Enabled)
|
||||
{
|
||||
Enabled = false;
|
||||
}
|
||||
else if (BlockGroup.IsEnableChecked == true && !Enabled)
|
||||
{
|
||||
Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
public Color DisplayTextColor
|
||||
@@ -158,7 +270,7 @@ namespace Filtration.ObjectModel
|
||||
get
|
||||
{
|
||||
var backgroundColorBlockItem = BlockItems.OfType<BackgroundColorBlockItem>().FirstOrDefault();
|
||||
return backgroundColorBlockItem?.Color ?? new Color { A = 255, R = 0, G = 0, B = 0 };
|
||||
return backgroundColorBlockItem?.Color ?? new Color { A = 240, R = 0, G = 0, B = 0 };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +279,7 @@ namespace Filtration.ObjectModel
|
||||
get
|
||||
{
|
||||
var borderColorBlockItem = BlockItems.OfType<BorderColorBlockItem>().FirstOrDefault();
|
||||
return borderColorBlockItem?.Color ?? new Color { A = 255, R = 0, G = 0, B = 0 };
|
||||
return borderColorBlockItem?.Color ?? new Color { A = 240, R = 0, G = 0, B = 0 };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,5 +291,70 @@ namespace Filtration.ObjectModel
|
||||
return fontSizeBlockItem?.Value ?? 34;
|
||||
}
|
||||
}
|
||||
|
||||
public int DisplayIconSize
|
||||
{
|
||||
get
|
||||
{
|
||||
var mapIconBlockItem = BlockItems.OfType<MapIconBlockItem>().FirstOrDefault();
|
||||
if (mapIconBlockItem != null)
|
||||
return (int)mapIconBlockItem.Size;
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public int DisplayIconColor
|
||||
{
|
||||
get
|
||||
{
|
||||
var mapIconBlockItem = BlockItems.OfType<MapIconBlockItem>().FirstOrDefault();
|
||||
if (mapIconBlockItem != null)
|
||||
return (int)mapIconBlockItem.Color;
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public int DisplayIconShape
|
||||
{
|
||||
get
|
||||
{
|
||||
var mapIconBlockItem = BlockItems.OfType<MapIconBlockItem>().FirstOrDefault();
|
||||
if (mapIconBlockItem != null)
|
||||
return (int)mapIconBlockItem.Shape;
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public Color DisplayEffectColor
|
||||
{
|
||||
get
|
||||
{
|
||||
var beamBlockItem = BlockItems.OfType<PlayEffectBlockItem>().FirstOrDefault();
|
||||
|
||||
if (beamBlockItem != null)
|
||||
{
|
||||
switch (beamBlockItem.Color)
|
||||
{
|
||||
case EffectColor.Red:
|
||||
return Colors.Red;
|
||||
case EffectColor.Green:
|
||||
return Colors.Green;
|
||||
case EffectColor.Blue:
|
||||
return Colors.Blue;
|
||||
case EffectColor.Brown:
|
||||
return Colors.Brown;
|
||||
case EffectColor.White:
|
||||
return Colors.White;
|
||||
case EffectColor.Yellow:
|
||||
return Colors.Yellow;
|
||||
}
|
||||
}
|
||||
|
||||
return Colors.Transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,31 +5,34 @@ namespace Filtration.ObjectModel
|
||||
{
|
||||
public class ItemFilterBlockGroup
|
||||
{
|
||||
private bool _isChecked;
|
||||
private bool? _isShowChecked;
|
||||
private bool? _isEnableChecked;
|
||||
|
||||
public ItemFilterBlockGroup(string groupName, ItemFilterBlockGroup parent, bool advanced = false)
|
||||
public ItemFilterBlockGroup(string groupName, ItemFilterBlockGroup parent, bool advanced = false, bool isLeafNode = false)
|
||||
{
|
||||
GroupName = groupName;
|
||||
ParentGroup = parent;
|
||||
Advanced = advanced;
|
||||
ChildGroups = new List<ItemFilterBlockGroup>();
|
||||
IsLeafNode = isLeafNode;
|
||||
}
|
||||
|
||||
public string GroupName { get; }
|
||||
public ItemFilterBlockGroup ParentGroup { get; set; }
|
||||
public List<ItemFilterBlockGroup> ChildGroups { get; }
|
||||
public bool Advanced { get; }
|
||||
public bool IsLeafNode { get; }
|
||||
|
||||
public event EventHandler BlockGroupStatusChanged;
|
||||
|
||||
public string GroupName { get; }
|
||||
public ItemFilterBlockGroup ParentGroup { get; }
|
||||
public List<ItemFilterBlockGroup> ChildGroups { get; }
|
||||
public bool Advanced { get; }
|
||||
|
||||
public bool IsChecked
|
||||
public bool? IsShowChecked
|
||||
{
|
||||
get { return _isChecked; }
|
||||
get { return _isShowChecked; }
|
||||
set
|
||||
{
|
||||
if (value != _isChecked)
|
||||
if (value != _isShowChecked)
|
||||
{
|
||||
_isChecked = value;
|
||||
_isShowChecked = value;
|
||||
// Raise an event to let blocks that have this block group assigned that
|
||||
// they might need to change their Action due to the block group status changing.
|
||||
BlockGroupStatusChanged?.Invoke(null, null);
|
||||
@@ -37,20 +40,85 @@ namespace Filtration.ObjectModel
|
||||
}
|
||||
}
|
||||
|
||||
public bool? IsEnableChecked
|
||||
{
|
||||
get { return _isEnableChecked; }
|
||||
set
|
||||
{
|
||||
if (value != _isEnableChecked)
|
||||
{
|
||||
_isEnableChecked = value;
|
||||
// Raise an event to let blocks that have this block group assigned that
|
||||
// they might need to change their Enabled due to the block group status changing.
|
||||
BlockGroupStatusChanged?.Invoke(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearStatusChangeSubscribers()
|
||||
{
|
||||
BlockGroupStatusChanged = null;
|
||||
}
|
||||
|
||||
public void AddOrJoinBlockGroup(ItemFilterBlockGroup blockGroup)
|
||||
{
|
||||
var childIndex = ChildGroups.FindIndex(item => item.GroupName.Equals(blockGroup.GroupName));
|
||||
if (!blockGroup.IsLeafNode && childIndex >= 0)
|
||||
{
|
||||
while(blockGroup.ChildGroups.Count > 0)
|
||||
{
|
||||
ChildGroups[childIndex].AddOrJoinBlockGroup(blockGroup.ChildGroups[0]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(blockGroup.ParentGroup != null)
|
||||
{
|
||||
blockGroup.ParentGroup.ChildGroups.Remove(blockGroup);
|
||||
}
|
||||
blockGroup.ParentGroup = this;
|
||||
ChildGroups.Add(blockGroup);
|
||||
}
|
||||
}
|
||||
|
||||
public void DetachSelf(bool keepChildren)
|
||||
{
|
||||
if(ParentGroup == null)
|
||||
return;
|
||||
|
||||
if(IsLeafNode && ParentGroup.ParentGroup != null && ParentGroup.ChildGroups.Count < 2)
|
||||
{
|
||||
ParentGroup.DetachSelf(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ParentGroup.ChildGroups.Remove(this);
|
||||
|
||||
if (keepChildren)
|
||||
{
|
||||
foreach(var child in ChildGroups)
|
||||
{
|
||||
ParentGroup.AddOrJoinBlockGroup(child);
|
||||
}
|
||||
}
|
||||
|
||||
ParentGroup = null;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var currentBlockGroup = this;
|
||||
if(ParentGroup == null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var outputString = (Advanced ? "~" : string.Empty) + GroupName;
|
||||
|
||||
// TODO: This is retarded, fix this.
|
||||
if (currentBlockGroup.ParentGroup != null)
|
||||
var parentOutput = ParentGroup.ToString();
|
||||
if(!string.IsNullOrWhiteSpace(parentOutput))
|
||||
{
|
||||
while (currentBlockGroup.ParentGroup.ParentGroup != null)
|
||||
{
|
||||
outputString = (currentBlockGroup.ParentGroup.Advanced ? "~" : string.Empty) + currentBlockGroup.ParentGroup.GroupName + " - " + outputString;
|
||||
currentBlockGroup = currentBlockGroup.ParentGroup;
|
||||
}
|
||||
outputString = parentOutput + (IsLeafNode ? string.Empty : " - " + outputString);
|
||||
}
|
||||
|
||||
return outputString;
|
||||
|
||||
@@ -1,45 +1,101 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Filtration.ObjectModel.Annotations;
|
||||
using Filtration.ObjectModel.BlockItemTypes;
|
||||
using Filtration.ObjectModel.Commands;
|
||||
using Filtration.ObjectModel.ThemeEditor;
|
||||
|
||||
namespace Filtration.ObjectModel
|
||||
{
|
||||
public interface IItemFilterScript
|
||||
public interface IItemFilterScript : INotifyPropertyChanged
|
||||
{
|
||||
ObservableCollection<IItemFilterBlock> ItemFilterBlocks { get; }
|
||||
ICommandManager CommandManager { get; }
|
||||
|
||||
ObservableCollection<IItemFilterBlockBase> ItemFilterBlocks { get; }
|
||||
ObservableCollection<ItemFilterBlockGroup> ItemFilterBlockGroups { get; }
|
||||
ThemeComponentCollection ThemeComponents { get; set; }
|
||||
string FilePath { get; set; }
|
||||
string Description { get; set; }
|
||||
DateTime DateModified { get; set; }
|
||||
bool IsDirty { get; }
|
||||
|
||||
IItemFilterScriptSettings ItemFilterScriptSettings { get; }
|
||||
|
||||
List<string> Validate();
|
||||
void ReplaceColors(ReplaceColorsParameterSet replaceColorsParameterSet);
|
||||
}
|
||||
|
||||
public class ItemFilterScript : IItemFilterScript
|
||||
public interface IItemFilterScriptInternal : IItemFilterScript
|
||||
{
|
||||
public ItemFilterScript()
|
||||
void SetIsDirty(bool isDirty);
|
||||
}
|
||||
|
||||
public class ItemFilterScript : IItemFilterScriptInternal
|
||||
{
|
||||
private bool _isDirty;
|
||||
private string _description;
|
||||
|
||||
internal ItemFilterScript()
|
||||
{
|
||||
ItemFilterBlocks = new ObservableCollection<IItemFilterBlock>();
|
||||
ItemFilterBlocks = new ObservableCollection<IItemFilterBlockBase>();
|
||||
ItemFilterBlockGroups = new ObservableCollection<ItemFilterBlockGroup>
|
||||
{
|
||||
new ItemFilterBlockGroup("Root", null)
|
||||
};
|
||||
ThemeComponents = new ThemeComponentCollection { IsMasterCollection = true};
|
||||
ThemeComponents = new ThemeComponentCollection { IsMasterCollection = true };
|
||||
ItemFilterScriptSettings = new ItemFilterScriptSettings(ThemeComponents);
|
||||
}
|
||||
|
||||
public ObservableCollection<IItemFilterBlock> ItemFilterBlocks { get; }
|
||||
public ItemFilterScript(ICommandManagerInternal commandManager) : this()
|
||||
{
|
||||
CommandManager = commandManager;
|
||||
commandManager.SetScript(this);
|
||||
}
|
||||
|
||||
public ICommandManager CommandManager { get; }
|
||||
|
||||
public ObservableCollection<IItemFilterBlockBase> ItemFilterBlocks { get; }
|
||||
public ObservableCollection<ItemFilterBlockGroup> ItemFilterBlockGroups { get; }
|
||||
|
||||
public ThemeComponentCollection ThemeComponents { get; set; }
|
||||
|
||||
public IItemFilterScriptSettings ItemFilterScriptSettings { get; }
|
||||
|
||||
public string FilePath { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public string Description
|
||||
{
|
||||
get => _description;
|
||||
set
|
||||
{
|
||||
if (value == _description) return;
|
||||
_description = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime DateModified { get; set; }
|
||||
|
||||
public bool IsDirty
|
||||
{
|
||||
get => _isDirty;
|
||||
private set
|
||||
{
|
||||
if (value == _isDirty) return;
|
||||
_isDirty = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetIsDirty(bool isDirty)
|
||||
{
|
||||
IsDirty = isDirty;
|
||||
}
|
||||
|
||||
public List<string> Validate()
|
||||
{
|
||||
var validationErrors = new List<string>();
|
||||
@@ -54,9 +110,7 @@ namespace Filtration.ObjectModel
|
||||
|
||||
public void ReplaceColors(ReplaceColorsParameterSet replaceColorsParameterSet)
|
||||
{
|
||||
foreach (
|
||||
var block in
|
||||
ItemFilterBlocks.Where(b => BlockIsColorReplacementCandidate(replaceColorsParameterSet, b)))
|
||||
foreach (var block in ItemFilterBlocks.OfType<ItemFilterBlock>().Where(b => BlockIsColorReplacementCandidate(replaceColorsParameterSet, b)))
|
||||
{
|
||||
if (replaceColorsParameterSet.ReplaceTextColor)
|
||||
{
|
||||
@@ -78,15 +132,9 @@ namespace Filtration.ObjectModel
|
||||
|
||||
private bool BlockIsColorReplacementCandidate(ReplaceColorsParameterSet replaceColorsParameterSet, IItemFilterBlock block)
|
||||
{
|
||||
var textColorItem = block.HasBlockItemOfType<TextColorBlockItem>()
|
||||
? block.BlockItems.OfType<TextColorBlockItem>().First()
|
||||
: null;
|
||||
var backgroundColorItem = block.HasBlockItemOfType<BackgroundColorBlockItem>()
|
||||
? block.BlockItems.OfType<BackgroundColorBlockItem>().First()
|
||||
: null;
|
||||
var borderColorItem = block.HasBlockItemOfType<BorderColorBlockItem>()
|
||||
? block.BlockItems.OfType<BorderColorBlockItem>().First()
|
||||
: null;
|
||||
var textColorItem = block.BlockItems.OfType<TextColorBlockItem>().FirstOrDefault();
|
||||
var backgroundColorItem = block.BlockItems.OfType<BackgroundColorBlockItem>().FirstOrDefault();
|
||||
var borderColorItem = block.BlockItems.OfType<BorderColorBlockItem>().FirstOrDefault();
|
||||
|
||||
// If we don't have all of the things we want to replace, then we aren't a candidate for replacing those things.
|
||||
if ((textColorItem == null && replaceColorsParameterSet.ReplaceTextColor) ||
|
||||
@@ -109,5 +157,12 @@ namespace Filtration.ObjectModel
|
||||
return true;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
21
Filtration.ObjectModel/ItemFilterScriptSettings.cs
Normal file
21
Filtration.ObjectModel/ItemFilterScriptSettings.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Filtration.ObjectModel.ThemeEditor;
|
||||
|
||||
namespace Filtration.ObjectModel
|
||||
{
|
||||
public interface IItemFilterScriptSettings
|
||||
{
|
||||
bool BlockGroupsEnabled { get; set; }
|
||||
ThemeComponentCollection ThemeComponentCollection { get; }
|
||||
}
|
||||
|
||||
public class ItemFilterScriptSettings : IItemFilterScriptSettings
|
||||
{
|
||||
public ItemFilterScriptSettings(ThemeComponentCollection themeComponentCollection)
|
||||
{
|
||||
ThemeComponentCollection = themeComponentCollection;
|
||||
}
|
||||
|
||||
public bool BlockGroupsEnabled { get; set; }
|
||||
public ThemeComponentCollection ThemeComponentCollection { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Filtration.ObjectModel
|
||||
{
|
||||
public class ItemFilterSection : ItemFilterBlock
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -8,36 +8,36 @@ namespace Filtration.ObjectModel
|
||||
{
|
||||
public static Dictionary<PathOfExileNamedColor, Color> Colors => new Dictionary<PathOfExileNamedColor, Color>
|
||||
{
|
||||
{PathOfExileNamedColor.Default, new Color {A = 255, R = 127, G = 127, B = 127}},
|
||||
{PathOfExileNamedColor.ValueDefault, new Color {A = 255, R = 255, G = 255, B = 255}},
|
||||
{PathOfExileNamedColor.Pink, new Color {A = 255, R = 255, G = 192, B = 203}},
|
||||
{PathOfExileNamedColor.DodgerBlue, new Color {A = 255, R = 30, G = 144, B = 255}},
|
||||
{PathOfExileNamedColor.Fire, new Color {A = 255, R = 150, G = 0, B = 0}},
|
||||
{PathOfExileNamedColor.Cold, new Color {A = 255, R = 54, G = 100, B = 146}},
|
||||
{PathOfExileNamedColor.Lightning, new Color {A = 255, R = 255, G = 215, B = 0}},
|
||||
{PathOfExileNamedColor.Chaos, new Color {A = 255, R = 208, G = 32, B = 144}},
|
||||
{PathOfExileNamedColor.Augmented, new Color {A = 255, R = 136, G = 136, B = 255}},
|
||||
{PathOfExileNamedColor.Crafted, new Color {A = 255, R = 184, G = 218, B = 242}},
|
||||
{PathOfExileNamedColor.Unmet, new Color {A = 255, R = 210, G = 0, B = 0}},
|
||||
{PathOfExileNamedColor.UniqueItem, new Color {A = 255, R = 175, G = 96, B = 37}},
|
||||
{PathOfExileNamedColor.RareItem, new Color {A = 255, R = 255, G = 255, B = 119}},
|
||||
{PathOfExileNamedColor.MagicItem, new Color {A = 255, R = 136, G = 136, B = 255}},
|
||||
{PathOfExileNamedColor.WhiteItem, new Color {A = 255, R = 200, G = 200, B = 200}},
|
||||
{PathOfExileNamedColor.GemItem, new Color {A = 255, R = 27, G = 162, B = 155}},
|
||||
{PathOfExileNamedColor.CurrencyItem, new Color {A = 255, R = 170, G = 158, B = 130}},
|
||||
{PathOfExileNamedColor.QuestItem, new Color {A = 255, R = 74, G = 230, B = 58}},
|
||||
{PathOfExileNamedColor.NemesisMod, new Color {A = 255, R = 255, G = 200, B = 0}},
|
||||
{PathOfExileNamedColor.Default, new Color {A = 240, R = 127, G = 127, B = 127}},
|
||||
{PathOfExileNamedColor.ValueDefault, new Color {A = 240, R = 255, G = 255, B = 255}},
|
||||
{PathOfExileNamedColor.Pink, new Color {A = 240, R = 255, G = 192, B = 203}},
|
||||
{PathOfExileNamedColor.DodgerBlue, new Color {A = 240, R = 30, G = 144, B = 255}},
|
||||
{PathOfExileNamedColor.Fire, new Color {A = 240, R = 150, G = 0, B = 0}},
|
||||
{PathOfExileNamedColor.Cold, new Color {A = 240, R = 54, G = 100, B = 146}},
|
||||
{PathOfExileNamedColor.Lightning, new Color {A = 240, R = 255, G = 215, B = 0}},
|
||||
{PathOfExileNamedColor.Chaos, new Color {A = 240, R = 208, G = 32, B = 144}},
|
||||
{PathOfExileNamedColor.Augmented, new Color {A = 240, R = 136, G = 136, B = 255}},
|
||||
{PathOfExileNamedColor.Crafted, new Color {A = 240, R = 184, G = 218, B = 242}},
|
||||
{PathOfExileNamedColor.Unmet, new Color {A = 240, R = 210, G = 0, B = 0}},
|
||||
{PathOfExileNamedColor.UniqueItem, new Color {A = 240, R = 175, G = 96, B = 37}},
|
||||
{PathOfExileNamedColor.RareItem, new Color {A = 240, R = 255, G = 255, B = 119}},
|
||||
{PathOfExileNamedColor.MagicItem, new Color {A = 240, R = 136, G = 136, B = 255}},
|
||||
{PathOfExileNamedColor.WhiteItem, new Color {A = 240, R = 200, G = 200, B = 200}},
|
||||
{PathOfExileNamedColor.GemItem, new Color {A = 240, R = 27, G = 162, B = 155}},
|
||||
{PathOfExileNamedColor.CurrencyItem, new Color {A = 240, R = 170, G = 158, B = 130}},
|
||||
{PathOfExileNamedColor.QuestItem, new Color {A = 240, R = 74, G = 230, B = 58}},
|
||||
{PathOfExileNamedColor.NemesisMod, new Color {A = 240, R = 255, G = 200, B = 0}},
|
||||
{PathOfExileNamedColor.NemesisModOutline, new Color {A = 220, R = 255, G = 40, B = 0}},
|
||||
{PathOfExileNamedColor.Title, new Color {A = 255, R = 231, G = 180, B = 120}},
|
||||
{PathOfExileNamedColor.Corrupted, new Color {A = 255, R = 210, G = 0, B = 0}},
|
||||
{PathOfExileNamedColor.Favour, new Color {A = 255, R = 170, G = 158, B = 130}},
|
||||
{PathOfExileNamedColor.SupporterPackNewItem, new Color {A = 255, R = 180, G = 96, B = 0}},
|
||||
{PathOfExileNamedColor.SupporterPackItem, new Color {A = 255, R = 163, G = 141, B = 109}},
|
||||
{PathOfExileNamedColor.BloodlineMod, new Color {A = 255, R = 210, G = 0, B = 220}},
|
||||
{PathOfExileNamedColor.Title, new Color {A = 240, R = 231, G = 180, B = 120}},
|
||||
{PathOfExileNamedColor.Corrupted, new Color {A = 240, R = 210, G = 0, B = 0}},
|
||||
{PathOfExileNamedColor.Favour, new Color {A = 240, R = 170, G = 158, B = 130}},
|
||||
{PathOfExileNamedColor.SupporterPackNewItem, new Color {A = 240, R = 180, G = 96, B = 0}},
|
||||
{PathOfExileNamedColor.SupporterPackItem, new Color {A = 240, R = 163, G = 141, B = 109}},
|
||||
{PathOfExileNamedColor.BloodlineMod, new Color {A = 240, R = 210, G = 0, B = 220}},
|
||||
{PathOfExileNamedColor.BloodlineModOutline, new Color {A = 200, R = 74, G = 0, B = 160}},
|
||||
{PathOfExileNamedColor.TormentMod, new Color {A = 255, R = 50, G = 230, B = 100}},
|
||||
{PathOfExileNamedColor.TormentMod, new Color {A = 240, R = 50, G = 230, B = 100}},
|
||||
{PathOfExileNamedColor.TormentModOutline, new Color {A = 200, R = 0, G = 100, B = 150}},
|
||||
{PathOfExileNamedColor.CantTradeorModify, new Color {A = 255, R = 210, G = 0, B = 0}},
|
||||
{PathOfExileNamedColor.CantTradeorModify, new Color {A = 240, R = 210, G = 0, B = 0}},
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
using System;
|
||||
/* MIT License
|
||||
|
||||
Copyright (c) 2016 JetBrains http://www.jetbrains.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE. */
|
||||
|
||||
using System;
|
||||
|
||||
#pragma warning disable 1591
|
||||
// ReSharper disable UnusedMember.Global
|
||||
@@ -7,7 +29,6 @@
|
||||
// ReSharper disable IntroduceOptionalParameters.Global
|
||||
// ReSharper disable MemberCanBeProtected.Global
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
namespace Filtration.ObjectModel.Annotations
|
||||
{
|
||||
@@ -16,32 +37,37 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// so the check for <c>null</c> is necessary before its usage.
|
||||
/// </summary>
|
||||
/// <example><code>
|
||||
/// [CanBeNull] public object Test() { return null; }
|
||||
/// public void UseTest() {
|
||||
/// [CanBeNull] object Test() => null;
|
||||
///
|
||||
/// void UseTest() {
|
||||
/// var p = Test();
|
||||
/// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
|
||||
/// }
|
||||
/// </code></example>
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
|
||||
AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event)]
|
||||
AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event |
|
||||
AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.GenericParameter)]
|
||||
public sealed class CanBeNullAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the value of the marked element could never be <c>null</c>.
|
||||
/// </summary>
|
||||
/// <example><code>
|
||||
/// [NotNull] public object Foo() {
|
||||
/// [NotNull] object Foo() {
|
||||
/// return null; // Warning: Possible 'null' assignment
|
||||
/// }
|
||||
/// </code></example>
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
|
||||
AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event)]
|
||||
AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event |
|
||||
AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.GenericParameter)]
|
||||
public sealed class NotNullAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that collection or enumerable value does not contain null elements.
|
||||
/// Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task
|
||||
/// and Lazy classes to indicate that the value of a collection item, of the Task.Result property
|
||||
/// or of the Lazy.Value property can never be null.
|
||||
/// </summary>
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
|
||||
@@ -49,7 +75,9 @@ namespace Filtration.ObjectModel.Annotations
|
||||
public sealed class ItemNotNullAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that collection or enumerable value can contain null elements.
|
||||
/// Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task
|
||||
/// and Lazy classes to indicate that the value of a collection item, of the Task.Result property
|
||||
/// or of the Lazy.Value property can be null.
|
||||
/// </summary>
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
|
||||
@@ -63,8 +91,9 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// </summary>
|
||||
/// <example><code>
|
||||
/// [StringFormatMethod("message")]
|
||||
/// public void ShowError(string message, params object[] args) { /* do something */ }
|
||||
/// public void Foo() {
|
||||
/// void ShowError(string message, params object[] args) { /* do something */ }
|
||||
///
|
||||
/// void Foo() {
|
||||
/// ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
|
||||
/// }
|
||||
/// </code></example>
|
||||
@@ -76,22 +105,24 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// <param name="formatParameterName">
|
||||
/// Specifies which parameter of an annotated method should be treated as format-string
|
||||
/// </param>
|
||||
public StringFormatMethodAttribute(string formatParameterName)
|
||||
public StringFormatMethodAttribute([NotNull] string formatParameterName)
|
||||
{
|
||||
FormatParameterName = formatParameterName;
|
||||
}
|
||||
|
||||
public string FormatParameterName { get; private set; }
|
||||
[NotNull] public string FormatParameterName { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)]
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field,
|
||||
AllowMultiple = true)]
|
||||
public sealed class ValueProviderAttribute : Attribute
|
||||
{
|
||||
public ValueProviderAttribute(string name)
|
||||
public ValueProviderAttribute([NotNull] string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
@@ -105,7 +136,7 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// the parameter of <see cref="System.ArgumentNullException"/>.
|
||||
/// </summary>
|
||||
/// <example><code>
|
||||
/// public void Foo(string param) {
|
||||
/// void Foo(string param) {
|
||||
/// if (param == null)
|
||||
/// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
|
||||
/// }
|
||||
@@ -131,10 +162,12 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// <example><code>
|
||||
/// public class Foo : INotifyPropertyChanged {
|
||||
/// public event PropertyChangedEventHandler PropertyChanged;
|
||||
///
|
||||
/// [NotifyPropertyChangedInvocator]
|
||||
/// protected virtual void NotifyChanged(string propertyName) { ... }
|
||||
///
|
||||
/// private string _name;
|
||||
/// string _name;
|
||||
///
|
||||
/// public string Name {
|
||||
/// get { return _name; }
|
||||
/// set { _name = value; NotifyChanged("LastName"); /* Warning */ }
|
||||
@@ -153,12 +186,12 @@ namespace Filtration.ObjectModel.Annotations
|
||||
public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute
|
||||
{
|
||||
public NotifyPropertyChangedInvocatorAttribute() { }
|
||||
public NotifyPropertyChangedInvocatorAttribute(string parameterName)
|
||||
public NotifyPropertyChangedInvocatorAttribute([NotNull] string parameterName)
|
||||
{
|
||||
ParameterName = parameterName;
|
||||
}
|
||||
|
||||
public string ParameterName { get; private set; }
|
||||
[CanBeNull] public string ParameterName { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -174,15 +207,16 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// <item>Value ::= true | false | null | notnull | canbenull</item>
|
||||
/// </list>
|
||||
/// If method has single input parameter, it's name could be omitted.<br/>
|
||||
/// Using <c>halt</c> (or <c>void</c>/<c>nothing</c>, which is the same)
|
||||
/// for method output means that the methos doesn't return normally.<br/>
|
||||
/// <c>canbenull</c> annotation is only applicable for output parameters.<br/>
|
||||
/// You can use multiple <c>[ContractAnnotation]</c> for each FDT row,
|
||||
/// or use single attribute with rows separated by semicolon.<br/>
|
||||
/// Using <c>halt</c> (or <c>void</c>/<c>nothing</c>, which is the same) for method output
|
||||
/// means that the methos doesn't return normally (throws or terminates the process).<br/>
|
||||
/// Value <c>canbenull</c> is only applicable for output parameters.<br/>
|
||||
/// You can use multiple <c>[ContractAnnotation]</c> for each FDT row, or use single attribute
|
||||
/// with rows separated by semicolon. There is no notion of order rows, all rows are checked
|
||||
/// for applicability and applied per each program state tracked by R# analysis.<br/>
|
||||
/// </syntax>
|
||||
/// <examples><list>
|
||||
/// <item><code>
|
||||
/// [ContractAnnotation("=> halt")]
|
||||
/// [ContractAnnotation("=> halt")]
|
||||
/// public void TerminationMethod()
|
||||
/// </code></item>
|
||||
/// <item><code>
|
||||
@@ -190,17 +224,17 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// public void Assert(bool condition, string text) // regular assertion method
|
||||
/// </code></item>
|
||||
/// <item><code>
|
||||
/// [ContractAnnotation("s:null => true")]
|
||||
/// [ContractAnnotation("s:null => true")]
|
||||
/// public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()
|
||||
/// </code></item>
|
||||
/// <item><code>
|
||||
/// // A method that returns null if the parameter is null,
|
||||
/// // and not null if the parameter is not null
|
||||
/// [ContractAnnotation("null => null; notnull => notnull")]
|
||||
/// [ContractAnnotation("null => null; notnull => notnull")]
|
||||
/// public object Transform(object data)
|
||||
/// </code></item>
|
||||
/// <item><code>
|
||||
/// [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")]
|
||||
/// [ContractAnnotation("=> true, result: notnull; => false, result: null")]
|
||||
/// public bool TryParse(string s, out Person result)
|
||||
/// </code></item>
|
||||
/// </list></examples>
|
||||
@@ -216,7 +250,8 @@ namespace Filtration.ObjectModel.Annotations
|
||||
ForceFullStates = forceFullStates;
|
||||
}
|
||||
|
||||
public string Contract { get; private set; }
|
||||
[NotNull] public string Contract { get; private set; }
|
||||
|
||||
public bool ForceFullStates { get; private set; }
|
||||
}
|
||||
|
||||
@@ -225,14 +260,15 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// </summary>
|
||||
/// <example><code>
|
||||
/// [LocalizationRequiredAttribute(true)]
|
||||
/// public class Foo {
|
||||
/// private string str = "my string"; // Warning: Localizable string
|
||||
/// class Foo {
|
||||
/// string str = "my string"; // Warning: Localizable string
|
||||
/// }
|
||||
/// </code></example>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public sealed class LocalizationRequiredAttribute : Attribute
|
||||
{
|
||||
public LocalizationRequiredAttribute() : this(true) { }
|
||||
|
||||
public LocalizationRequiredAttribute(bool required)
|
||||
{
|
||||
Required = required;
|
||||
@@ -250,8 +286,9 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// <example><code>
|
||||
/// [CannotApplyEqualityOperator]
|
||||
/// class NoEquality { }
|
||||
///
|
||||
/// class UsesNoEquality {
|
||||
/// public void Test() {
|
||||
/// void Test() {
|
||||
/// var ca1 = new NoEquality();
|
||||
/// var ca2 = new NoEquality();
|
||||
/// if (ca1 != null) { // OK
|
||||
@@ -269,9 +306,10 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// </summary>
|
||||
/// <example><code>
|
||||
/// [BaseTypeRequired(typeof(IComponent)] // Specify requirement
|
||||
/// public class ComponentAttribute : Attribute { }
|
||||
/// class ComponentAttribute : Attribute { }
|
||||
///
|
||||
/// [Component] // ComponentAttribute requires implementing IComponent interface
|
||||
/// public class MyComponent : IComponent { }
|
||||
/// class MyComponent : IComponent { }
|
||||
/// </code></example>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
||||
[BaseTypeRequired(typeof(Attribute))]
|
||||
@@ -308,6 +346,7 @@ namespace Filtration.ObjectModel.Annotations
|
||||
}
|
||||
|
||||
public ImplicitUseKindFlags UseKindFlags { get; private set; }
|
||||
|
||||
public ImplicitUseTargetFlags TargetFlags { get; private set; }
|
||||
}
|
||||
|
||||
@@ -334,6 +373,7 @@ namespace Filtration.ObjectModel.Annotations
|
||||
}
|
||||
|
||||
[UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; private set; }
|
||||
|
||||
[UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; private set; }
|
||||
}
|
||||
|
||||
@@ -377,12 +417,13 @@ namespace Filtration.ObjectModel.Annotations
|
||||
public sealed class PublicAPIAttribute : Attribute
|
||||
{
|
||||
public PublicAPIAttribute() { }
|
||||
|
||||
public PublicAPIAttribute([NotNull] string comment)
|
||||
{
|
||||
Comment = comment;
|
||||
}
|
||||
|
||||
public string Comment { get; private set; }
|
||||
[CanBeNull] public string Comment { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -398,15 +439,51 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// The same as <c>System.Diagnostics.Contracts.PureAttribute</c>.
|
||||
/// </summary>
|
||||
/// <example><code>
|
||||
/// [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
|
||||
/// [Pure] int Multiply(int x, int y) => x * y;
|
||||
///
|
||||
/// void M() {
|
||||
/// Multiply(123, 42); // Waring: Return value of pure method is not used
|
||||
/// }
|
||||
/// </code></example>
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public sealed class PureAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the return value of method invocation must be used.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public sealed class MustUseReturnValueAttribute : Attribute
|
||||
{
|
||||
public MustUseReturnValueAttribute() { }
|
||||
|
||||
public MustUseReturnValueAttribute([NotNull] string justification)
|
||||
{
|
||||
Justification = justification;
|
||||
}
|
||||
|
||||
[CanBeNull] public string Justification { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the type member or parameter of some type, that should be used instead of all other ways
|
||||
/// to get the value that type. This annotation is useful when you have some "context" value evaluated
|
||||
/// and stored somewhere, meaning that all other ways to get this value must be consolidated with existing one.
|
||||
/// </summary>
|
||||
/// <example><code>
|
||||
/// class Foo {
|
||||
/// [ProvidesContext] IBarService _barService = ...;
|
||||
///
|
||||
/// void ProcessNode(INode node) {
|
||||
/// DoSomething(node, node.GetGlobalServices().Bar);
|
||||
/// // ^ Warning: use value of '_barService' field
|
||||
/// }
|
||||
/// }
|
||||
/// </code></example>
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.Method |
|
||||
AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct | AttributeTargets.GenericParameter)]
|
||||
public sealed class ProvidesContextAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// 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 (~).
|
||||
@@ -415,12 +492,13 @@ namespace Filtration.ObjectModel.Annotations
|
||||
public sealed class PathReferenceAttribute : Attribute
|
||||
{
|
||||
public PathReferenceAttribute() { }
|
||||
public PathReferenceAttribute([PathReference] string basePath)
|
||||
|
||||
public PathReferenceAttribute([NotNull, PathReference] string basePath)
|
||||
{
|
||||
BasePath = basePath;
|
||||
}
|
||||
|
||||
public string BasePath { get; private set; }
|
||||
[CanBeNull] public string BasePath { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -484,7 +562,7 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// Allows specifying a macro that will be executed for a <see cref="SourceTemplateAttribute">source template</see>
|
||||
/// parameter when the template is expanded.
|
||||
/// </summary>
|
||||
public string Expression { get; set; }
|
||||
[CanBeNull] public string Expression { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Allows specifying which occurrence of the target parameter becomes editable when the template is deployed.
|
||||
@@ -500,73 +578,73 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// Identifies the target parameter of a <see cref="SourceTemplateAttribute">source template</see> if the
|
||||
/// <see cref="MacroAttribute"/> is applied on a template method.
|
||||
/// </summary>
|
||||
public string Target { get; set; }
|
||||
[CanBeNull] public string Target { get; set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
|
||||
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
|
||||
public sealed class AspMvcAreaMasterLocationFormatAttribute : Attribute
|
||||
{
|
||||
public AspMvcAreaMasterLocationFormatAttribute(string format)
|
||||
public AspMvcAreaMasterLocationFormatAttribute([NotNull] string format)
|
||||
{
|
||||
Format = format;
|
||||
}
|
||||
|
||||
public string Format { get; private set; }
|
||||
[NotNull] public string Format { get; private set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
|
||||
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
|
||||
public sealed class AspMvcAreaPartialViewLocationFormatAttribute : Attribute
|
||||
{
|
||||
public AspMvcAreaPartialViewLocationFormatAttribute(string format)
|
||||
public AspMvcAreaPartialViewLocationFormatAttribute([NotNull] string format)
|
||||
{
|
||||
Format = format;
|
||||
}
|
||||
|
||||
public string Format { get; private set; }
|
||||
[NotNull] public string Format { get; private set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
|
||||
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
|
||||
public sealed class AspMvcAreaViewLocationFormatAttribute : Attribute
|
||||
{
|
||||
public AspMvcAreaViewLocationFormatAttribute(string format)
|
||||
public AspMvcAreaViewLocationFormatAttribute([NotNull] string format)
|
||||
{
|
||||
Format = format;
|
||||
}
|
||||
|
||||
public string Format { get; private set; }
|
||||
[NotNull] public string Format { get; private set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
|
||||
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
|
||||
public sealed class AspMvcMasterLocationFormatAttribute : Attribute
|
||||
{
|
||||
public AspMvcMasterLocationFormatAttribute(string format)
|
||||
public AspMvcMasterLocationFormatAttribute([NotNull] string format)
|
||||
{
|
||||
Format = format;
|
||||
}
|
||||
|
||||
public string Format { get; private set; }
|
||||
[NotNull] public string Format { get; private set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
|
||||
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
|
||||
public sealed class AspMvcPartialViewLocationFormatAttribute : Attribute
|
||||
{
|
||||
public AspMvcPartialViewLocationFormatAttribute(string format)
|
||||
public AspMvcPartialViewLocationFormatAttribute([NotNull] string format)
|
||||
{
|
||||
Format = format;
|
||||
}
|
||||
|
||||
public string Format { get; private set; }
|
||||
[NotNull] public string Format { get; private set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
|
||||
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
|
||||
public sealed class AspMvcViewLocationFormatAttribute : Attribute
|
||||
{
|
||||
public AspMvcViewLocationFormatAttribute(string format)
|
||||
public AspMvcViewLocationFormatAttribute([NotNull] string format)
|
||||
{
|
||||
Format = format;
|
||||
}
|
||||
|
||||
public string Format { get; private set; }
|
||||
[NotNull] public string Format { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -579,12 +657,13 @@ namespace Filtration.ObjectModel.Annotations
|
||||
public sealed class AspMvcActionAttribute : Attribute
|
||||
{
|
||||
public AspMvcActionAttribute() { }
|
||||
public AspMvcActionAttribute(string anonymousProperty)
|
||||
|
||||
public AspMvcActionAttribute([NotNull] string anonymousProperty)
|
||||
{
|
||||
AnonymousProperty = anonymousProperty;
|
||||
}
|
||||
|
||||
public string AnonymousProperty { get; private set; }
|
||||
[CanBeNull] public string AnonymousProperty { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -596,12 +675,13 @@ namespace Filtration.ObjectModel.Annotations
|
||||
public sealed class AspMvcAreaAttribute : Attribute
|
||||
{
|
||||
public AspMvcAreaAttribute() { }
|
||||
public AspMvcAreaAttribute(string anonymousProperty)
|
||||
|
||||
public AspMvcAreaAttribute([NotNull] string anonymousProperty)
|
||||
{
|
||||
AnonymousProperty = anonymousProperty;
|
||||
}
|
||||
|
||||
public string AnonymousProperty { get; private set; }
|
||||
[CanBeNull] public string AnonymousProperty { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -614,12 +694,13 @@ namespace Filtration.ObjectModel.Annotations
|
||||
public sealed class AspMvcControllerAttribute : Attribute
|
||||
{
|
||||
public AspMvcControllerAttribute() { }
|
||||
public AspMvcControllerAttribute(string anonymousProperty)
|
||||
|
||||
public AspMvcControllerAttribute([NotNull] string anonymousProperty)
|
||||
{
|
||||
AnonymousProperty = anonymousProperty;
|
||||
}
|
||||
|
||||
public string AnonymousProperty { get; private set; }
|
||||
[CanBeNull] public string AnonymousProperty { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -649,7 +730,7 @@ namespace Filtration.ObjectModel.Annotations
|
||||
/// ASP.NET MVC attribute. Allows disabling inspections for MVC views within a class or a method.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
|
||||
public sealed class AspMvcSupressViewErrorAttribute : Attribute { }
|
||||
public sealed class AspMvcSuppressViewErrorAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template.
|
||||
@@ -677,13 +758,27 @@ namespace Filtration.ObjectModel.Annotations
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// is an MVC view component. If applied to a method, the MVC view name is calculated implicitly
|
||||
/// from the context. Use this attribute for custom wrappers similar to
|
||||
/// <c>System.Web.Mvc.Controller.View(Object)</c>.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
|
||||
public sealed class AspMvcViewAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
|
||||
/// is an MVC view component name.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public sealed class AspMvcViewComponentAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
|
||||
/// is an MVC view component view. If applied to a method, the MVC view component view name is default.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
|
||||
public sealed class AspMvcViewComponentViewAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// ASP.NET MVC attribute. When applied to a parameter of an attribute,
|
||||
/// indicates that this parameter is an MVC action name.
|
||||
@@ -702,12 +797,13 @@ namespace Filtration.ObjectModel.Annotations
|
||||
public sealed class HtmlElementAttributesAttribute : Attribute
|
||||
{
|
||||
public HtmlElementAttributesAttribute() { }
|
||||
public HtmlElementAttributesAttribute(string name)
|
||||
|
||||
public HtmlElementAttributesAttribute([NotNull] string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public string Name { get; private set; }
|
||||
[CanBeNull] public string Name { get; private set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]
|
||||
@@ -730,9 +826,10 @@ namespace Filtration.ObjectModel.Annotations
|
||||
public sealed class RazorSectionAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates how method invocation affects content of the collection.
|
||||
/// Indicates how method, constructor invocation or property access
|
||||
/// over collection type affects content of the collection.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property)]
|
||||
public sealed class CollectionAccessAttribute : Attribute
|
||||
{
|
||||
public CollectionAccessAttribute(CollectionAccessType collectionAccessType)
|
||||
@@ -824,6 +921,16 @@ namespace Filtration.ObjectModel.Annotations
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public sealed class RegexPatternAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// Prevents the Member Reordering feature from tossing members of the marked class.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The attribute must be mentioned in your member reordering patterns
|
||||
/// </remarks>
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct | AttributeTargets.Enum)]
|
||||
public sealed class NoReorderAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// XAML attribute. Indicates the type that has <c>ItemsSource</c> property and should be treated
|
||||
/// as <c>ItemsControl</c>-derived type, to enable inner items <c>DataContext</c> type resolve.
|
||||
@@ -832,7 +939,7 @@ namespace Filtration.ObjectModel.Annotations
|
||||
public sealed class XamlItemsControlAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// XAML attibute. Indicates the property of some <c>BindingBase</c>-derived type, that
|
||||
/// XAML attribute. Indicates the property of some <c>BindingBase</c>-derived type, that
|
||||
/// is used to bind some item of <c>ItemsControl</c>-derived type. This annotation will
|
||||
/// enable the <c>DataContext</c> type resolve for XAML bindings for such properties.
|
||||
/// </summary>
|
||||
@@ -846,14 +953,15 @@ namespace Filtration.ObjectModel.Annotations
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
||||
public sealed class AspChildControlTypeAttribute : Attribute
|
||||
{
|
||||
public AspChildControlTypeAttribute(string tagName, Type controlType)
|
||||
public AspChildControlTypeAttribute([NotNull] string tagName, [NotNull] Type controlType)
|
||||
{
|
||||
TagName = tagName;
|
||||
ControlType = controlType;
|
||||
}
|
||||
|
||||
public string TagName { get; private set; }
|
||||
public Type ControlType { get; private set; }
|
||||
[NotNull] public string TagName { get; private set; }
|
||||
|
||||
[NotNull] public Type ControlType { get; private set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]
|
||||
@@ -873,7 +981,7 @@ namespace Filtration.ObjectModel.Annotations
|
||||
Attribute = attribute;
|
||||
}
|
||||
|
||||
public string Attribute { get; private set; }
|
||||
[NotNull] public string Attribute { get; private set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
@@ -890,25 +998,37 @@ namespace Filtration.ObjectModel.Annotations
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
|
||||
public sealed class RazorImportNamespaceAttribute : Attribute
|
||||
{
|
||||
public RazorImportNamespaceAttribute(string name)
|
||||
public RazorImportNamespaceAttribute([NotNull] string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public string Name { get; private set; }
|
||||
[NotNull] public string Name { get; private set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
|
||||
public sealed class RazorInjectionAttribute : Attribute
|
||||
{
|
||||
public RazorInjectionAttribute(string type, string fieldName)
|
||||
public RazorInjectionAttribute([NotNull] string type, [NotNull] string fieldName)
|
||||
{
|
||||
Type = type;
|
||||
FieldName = fieldName;
|
||||
}
|
||||
|
||||
public string Type { get; private set; }
|
||||
public string FieldName { get; private set; }
|
||||
[NotNull] public string Type { get; private set; }
|
||||
|
||||
[NotNull] public string FieldName { get; private set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
|
||||
public sealed class RazorDirectiveAttribute : Attribute
|
||||
{
|
||||
public RazorDirectiveAttribute([NotNull] string directive)
|
||||
{
|
||||
Directive = directive;
|
||||
}
|
||||
|
||||
[NotNull] public string Directive { get; private set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
@@ -925,13 +1045,4 @@ namespace Filtration.ObjectModel.Annotations
|
||||
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public sealed class RazorWriteMethodParameterAttribute : Attribute { }
|
||||
|
||||
/// <summary>
|
||||
/// Prevents the Member Reordering feature from tossing members of the marked class.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The attribute must be mentioned in your member reordering patterns
|
||||
/// </remarks>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public sealed class NoReorder : Attribute { }
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user