Compare commits
72 Commits
LootExplos
...
0.14
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7a40c8c6d | ||
|
|
dde9f65ea6 | ||
|
|
ae6e8c5211 | ||
|
|
67685d9eac | ||
|
|
af08cdfed6 | ||
|
|
0b791f5747 | ||
|
|
43bc1410ae | ||
|
|
b3520246b9 | ||
|
|
6d1c51361b | ||
|
|
360b1c8144 | ||
|
|
80b8318574 | ||
|
|
85f47ce654 | ||
|
|
c88c401ca8 | ||
|
|
45ab1a57e3 | ||
|
|
f77e9575fc | ||
|
|
6eb17555c0 | ||
|
|
ce4366d3fd | ||
|
|
03a291a309 | ||
|
|
0eecd5d1ff | ||
|
|
f947cd02da | ||
|
|
f75095ba72 | ||
|
|
76dd9fb22c | ||
|
|
8bfbe7cc66 | ||
|
|
86dc03f4ff | ||
|
|
d159f0b262 | ||
|
|
1bdc8bf6fd | ||
|
|
89e98fc8c6 | ||
|
|
014107c76b | ||
|
|
2f2a57e77a | ||
|
|
d014a93b70 | ||
|
|
7d2e20e9e1 | ||
|
|
bb45832d7a | ||
|
|
2dc56799fd | ||
|
|
9a117d118f | ||
|
|
94836f9673 | ||
|
|
c5eb27d08d | ||
|
|
4185c3dbde | ||
|
|
fc12c2dced | ||
|
|
94146467a3 | ||
|
|
da9fad05a6 | ||
|
|
eb73767560 | ||
|
|
2954cfe259 | ||
|
|
3694e6fa0c | ||
|
|
37258e563a | ||
|
|
71e1f2bf78 | ||
|
|
b2b412a73c | ||
|
|
ae948c83a5 | ||
|
|
3727166a44 | ||
|
|
32b0a0199f | ||
|
|
e54730d693 | ||
|
|
d11eefaeab | ||
|
|
da5b2c73a0 | ||
|
|
2ff1373c6b | ||
|
|
1882687601 | ||
|
|
3ba25b8f07 | ||
|
|
e80295cb69 | ||
|
|
f3ed386845 | ||
|
|
89e0c717e8 | ||
|
|
8924637b98 | ||
|
|
b0b912c676 | ||
|
|
92ebc51e7b | ||
|
|
95e7581a5b | ||
|
|
9cb854b584 | ||
|
|
61c2902f0c | ||
|
|
dc157713f3 | ||
|
|
16fe837544 | ||
|
|
58de6f06b9 | ||
|
|
af2dace29a | ||
|
|
59cf604430 | ||
|
|
93a51e7829 | ||
|
|
9d928a374a | ||
|
|
b5788504cb |
@@ -9,8 +9,9 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Filtration.Common.Tests</RootNamespace>
|
<RootNamespace>Filtration.Common.Tests</RootNamespace>
|
||||||
<AssemblyName>Filtration.Common.Tests</AssemblyName>
|
<AssemblyName>Filtration.Common.Tests</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@@ -30,11 +31,17 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Moq">
|
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Moq.4.2.1506.2515\lib\net40\Moq.dll</HintPath>
|
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="nunit.framework">
|
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
<HintPath>..\packages\Moq.4.5.21\lib\net45\Moq.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>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Moq" version="4.2.1506.2515" targetFramework="net451" />
|
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
|
||||||
<package id="NUnit" version="2.6.4" targetFramework="net451" />
|
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
||||||
|
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -13,10 +13,7 @@ namespace Filtration.Common.Converters
|
|||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value != null)
|
return ((SolidColorBrush) value)?.Color;
|
||||||
return ((SolidColorBrush)value).Color;
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,9 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Filtration.Common</RootNamespace>
|
<RootNamespace>Filtration.Common</RootNamespace>
|
||||||
<AssemblyName>Filtration.Common</AssemblyName>
|
<AssemblyName>Filtration.Common</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@@ -30,20 +31,24 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Castle.Core">
|
<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>
|
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Castle.Windsor">
|
<Reference Include="Castle.Windsor">
|
||||||
<HintPath>..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll</HintPath>
|
<HintPath>..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="GalaSoft.MvvmLight">
|
<Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
|
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="GalaSoft.MvvmLight.Extras">
|
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
|
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="GalaSoft.MvvmLight.Platform">
|
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
|
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Practices.ServiceLocation">
|
<Reference Include="Microsoft.Practices.ServiceLocation">
|
||||||
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
|
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
|
||||||
@@ -53,7 +58,8 @@
|
|||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MvvmLightLibs.5.1.1.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Xaml" />
|
<Reference Include="System.Xaml" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
@@ -73,7 +79,7 @@
|
|||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Services\FileSystemService.cs" />
|
<Compile Include="Services\FileSystemService.cs" />
|
||||||
<Compile Include="Services\MessageBoxService.cs" />
|
<Compile Include="Services\MessageBoxService.cs" />
|
||||||
<Compile Include="ViewModels\FiltrationViewModelBase.cs" />
|
<Compile Include="Utilities\LineReader.cs" />
|
||||||
<Compile Include="ViewModels\PaneViewModel.cs" />
|
<Compile Include="ViewModels\PaneViewModel.cs" />
|
||||||
<Compile Include="WindsorInstallers\ServicesInstaller.cs" />
|
<Compile Include="WindsorInstallers\ServicesInstaller.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Filtration.Common.Messages
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Filtration.Common.Messages
|
|
||||||
{
|
{
|
||||||
class ThemeClosedMessage
|
class ThemeClosedMessage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace Filtration.Common.Services
|
namespace Filtration.Common.Services
|
||||||
{
|
{
|
||||||
@@ -20,7 +21,7 @@ namespace Filtration.Common.Services
|
|||||||
|
|
||||||
public void WriteFileFromString(string filePath, string inputString)
|
public void WriteFileFromString(string filePath, string inputString)
|
||||||
{
|
{
|
||||||
File.WriteAllText(filePath, inputString);
|
File.WriteAllText(filePath, inputString, Encoding.UTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DirectoryExists(string directoryPath)
|
public bool DirectoryExists(string directoryPath)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Filtration.Utilities
|
namespace Filtration.Common.Utilities
|
||||||
{
|
{
|
||||||
|
|
||||||
public sealed class LineReader : IEnumerable<string>
|
public sealed class LineReader : IEnumerable<string>
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
using System.Runtime.CompilerServices;
|
|
||||||
using Filtration.ObjectModel.Annotations;
|
|
||||||
using GalaSoft.MvvmLight;
|
|
||||||
|
|
||||||
namespace Filtration.Common.ViewModels
|
|
||||||
{
|
|
||||||
public class FiltrationViewModelBase : ViewModelBase
|
|
||||||
{
|
|
||||||
/// This gives us the ReSharper option to transform an autoproperty into a property with change notification
|
|
||||||
/// Also leverages .net 4.5 callermembername attribute
|
|
||||||
[NotifyPropertyChangedInvocator]
|
|
||||||
protected override void RaisePropertyChanged([CallerMemberName]string property = "")
|
|
||||||
{
|
|
||||||
base.RaisePropertyChanged(property);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using GalaSoft.MvvmLight;
|
||||||
|
|
||||||
namespace Filtration.Common.ViewModels
|
namespace Filtration.Common.ViewModels
|
||||||
{
|
{
|
||||||
public class PaneViewModel : FiltrationViewModelBase
|
public class PaneViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
private string _title;
|
private string _title;
|
||||||
public string Title
|
public string Title
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Castle.Core" version="3.3.0" targetFramework="net451" />
|
<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.3.0" targetFramework="net451" />
|
||||||
<package id="CommonServiceLocator" version="1.3" targetFramework="net451" />
|
<package id="CommonServiceLocator" version="1.3" targetFramework="net451" />
|
||||||
<package id="MvvmLightLibs" version="5.1.1.0" targetFramework="net451" />
|
<package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -9,8 +9,9 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Filtration.Interface</RootNamespace>
|
<RootNamespace>Filtration.Interface</RootNamespace>
|
||||||
<AssemblyName>Filtration.Interface</AssemblyName>
|
<AssemblyName>Filtration.Interface</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
namespace Filtration.Interface
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Filtration.Interface
|
||||||
{
|
{
|
||||||
public interface IDocument
|
public interface IDocument
|
||||||
{
|
{
|
||||||
bool IsScript { get; }
|
bool IsScript { get; }
|
||||||
bool IsTheme { get; }
|
bool IsTheme { get; }
|
||||||
void Close();
|
Task Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
namespace Filtration.Interface
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Filtration.Interface
|
||||||
{
|
{
|
||||||
public interface IEditableDocument : IDocument
|
public interface IEditableDocument : IDocument
|
||||||
{
|
{
|
||||||
bool IsDirty { get; }
|
bool IsDirty { get; }
|
||||||
void Save();
|
Task SaveAsync();
|
||||||
void SaveAs();
|
Task SaveAsAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
|
|||||||
31
Filtration.ItemFilterPreview.Data.Tests/App.config
Normal file
31
Filtration.ItemFilterPreview.Data.Tests/App.config
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
|
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||||
|
</configSections>
|
||||||
|
<entityFramework>
|
||||||
|
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
|
||||||
|
<parameters>
|
||||||
|
<parameter value="mssqllocaldb" />
|
||||||
|
</parameters>
|
||||||
|
</defaultConnectionFactory>
|
||||||
|
<providers>
|
||||||
|
<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
|
||||||
|
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||||
|
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
|
||||||
|
</providers>
|
||||||
|
</entityFramework>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
|
</startup>
|
||||||
|
<connectionStrings>
|
||||||
|
<add name="FiltrationDbContext" connectionString="data source="D:\C# Projects\Filtration\Filtration.db"" providerName="System.Data.SQLite.EF6" />
|
||||||
|
</connectionStrings>
|
||||||
|
|
||||||
|
<system.data>
|
||||||
|
<DbProviderFactories>
|
||||||
|
<remove invariant="System.Data.SQLite.EF6" />
|
||||||
|
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
|
||||||
|
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
|
||||||
|
</system.data></configuration>
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{7A5720DE-A41B-47EA-AAAB-7C5608FF0C1F}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Filtration.ItemFilterPreview.Data.Tests</RootNamespace>
|
||||||
|
<AssemblyName>Filtration.ItemFilterPreview.Data.Tests</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||||
|
<IsCodedUITest>False</IsCodedUITest>
|
||||||
|
<TestProjectType>UnitTest</TestProjectType>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
|
<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>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
|
<Reference Include="System.Data.SQLite, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Data.SQLite.Core.1.0.102.0\lib\net46\System.Data.SQLite.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Data.SQLite.EF6, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Data.SQLite.EF6.1.0.102.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Data.SQLite.Linq, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.102.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Choose>
|
||||||
|
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||||
|
</ItemGroup>
|
||||||
|
</When>
|
||||||
|
<Otherwise>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Otherwise>
|
||||||
|
</Choose>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Repositories\TestItemSetRepository.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Filtration.ItemFilterPreview.Data\Filtration.ItemFilterPreview.Data.csproj">
|
||||||
|
<Project>{855b38cc-eef2-471d-bbbc-eb3e2ff3d387}</Project>
|
||||||
|
<Name>Filtration.ItemFilterPreview.Data</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
|
||||||
|
<Project>{4aac3beb-1dc1-483e-9d11-0e9334e80227}</Project>
|
||||||
|
<Name>Filtration.ObjectModel</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Choose>
|
||||||
|
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
</When>
|
||||||
|
</Choose>
|
||||||
|
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<Import Project="..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets')" />
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets'))" />
|
||||||
|
</Target>
|
||||||
|
<!-- 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.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("Filtration.ItemFilterPreview.Data.Tests")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("Filtration.ItemFilterPreview.Data.Tests")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("7a5720de-a41b-47ea-aaab-7c5608ff0c1f")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Filtration.ItemFilterPreview.Data.Repositories;
|
||||||
|
using Filtration.ObjectModel;
|
||||||
|
using Filtration.ObjectModel.Enums;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Data.Tests.Repositories
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class TestItemSetRepository
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public void All_ReturnsAllItemSets()
|
||||||
|
{
|
||||||
|
using (var repository = new ItemSetRepository())
|
||||||
|
{
|
||||||
|
var result = repository.All.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void AddItemToItemSet()
|
||||||
|
{
|
||||||
|
ItemSet fetchedItemSet;
|
||||||
|
using (var repository = new ItemSetRepository())
|
||||||
|
{
|
||||||
|
fetchedItemSet = repository.Find(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
var newItem = new Item
|
||||||
|
{
|
||||||
|
BaseType = "Test Base",
|
||||||
|
Description = "Test Item Supreme",
|
||||||
|
DropLevel = 75,
|
||||||
|
Height = 3,
|
||||||
|
Width = 2,
|
||||||
|
ItemClass = "Super Class",
|
||||||
|
ItemRarity = ItemRarity.Rare,
|
||||||
|
ItemLevel = 50,
|
||||||
|
ItemSet = fetchedItemSet,
|
||||||
|
ItemSetId = fetchedItemSet.Id
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
fetchedItemSet.Items.Add(newItem);
|
||||||
|
|
||||||
|
using (var repository = new ItemSetRepository())
|
||||||
|
{
|
||||||
|
repository.InsertOrUpdate(fetchedItemSet);
|
||||||
|
repository.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
9
Filtration.ItemFilterPreview.Data.Tests/packages.config
Normal file
9
Filtration.ItemFilterPreview.Data.Tests/packages.config
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?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="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" />
|
||||||
|
<package id="System.Data.SQLite.Linq" version="1.0.102.0" targetFramework="net461" />
|
||||||
|
</packages>
|
||||||
29
Filtration.ItemFilterPreview.Data/App.config
Normal file
29
Filtration.ItemFilterPreview.Data/App.config
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||||
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
|
</configSections>
|
||||||
|
<entityFramework>
|
||||||
|
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
|
||||||
|
<parameters>
|
||||||
|
<parameter value="mssqllocaldb" />
|
||||||
|
</parameters>
|
||||||
|
</defaultConnectionFactory>
|
||||||
|
<providers>
|
||||||
|
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
|
||||||
|
</providers>
|
||||||
|
</entityFramework>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
|
</startup>
|
||||||
|
|
||||||
|
<connectionStrings>
|
||||||
|
<add name="FiltrationDbContext" connectionString="data source="D:\C# Projects\Filtration\Filtration.db"" providerName="System.Data.SQLite.EF6" />
|
||||||
|
</connectionStrings>
|
||||||
|
<system.data>
|
||||||
|
<DbProviderFactories>
|
||||||
|
<remove invariant="System.Data.SQLite.EF6" />
|
||||||
|
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
|
||||||
|
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
|
||||||
|
</system.data></configuration>
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
using System;
|
||||||
|
using System.Data.Entity;
|
||||||
|
using Filtration.ObjectModel;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Data.DataContexts
|
||||||
|
{
|
||||||
|
public class FiltrationDbContext : DbContext
|
||||||
|
{
|
||||||
|
public FiltrationDbContext() : base("name=FiltrationDbContext")
|
||||||
|
{
|
||||||
|
// Disable database initializer
|
||||||
|
Database.SetInitializer<FiltrationDbContext>(null);
|
||||||
|
Database.Log = Console.WriteLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual DbSet<Item> Items { get; set; }
|
||||||
|
public virtual DbSet<ItemSet> ItemSets { get; set; }
|
||||||
|
|
||||||
|
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
modelBuilder.Entity<Item>()
|
||||||
|
.Property(e => e.Description)
|
||||||
|
.IsUnicode(false);
|
||||||
|
|
||||||
|
modelBuilder.Entity<Item>()
|
||||||
|
.Property(e => e.BaseType)
|
||||||
|
.IsUnicode(false);
|
||||||
|
|
||||||
|
modelBuilder.Entity<Item>()
|
||||||
|
.Property(e => e.ItemClass)
|
||||||
|
.IsUnicode(false);
|
||||||
|
|
||||||
|
modelBuilder.Entity<Item>()
|
||||||
|
.Property(e => e.Sockets)
|
||||||
|
.IsUnicode(false);
|
||||||
|
|
||||||
|
modelBuilder.Entity<ItemSet>()
|
||||||
|
.Property(e => e.Name)
|
||||||
|
.IsUnicode(false);
|
||||||
|
|
||||||
|
modelBuilder.Entity<ItemSet>()
|
||||||
|
.HasMany(e => e.Items)
|
||||||
|
.WithRequired(e => e.ItemSet)
|
||||||
|
.WillCascadeOnDelete(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{855B38CC-EEF2-471D-BBBC-EB3E2FF3D387}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Filtration.ItemFilterPreview.Data</RootNamespace>
|
||||||
|
<AssemblyName>Filtration.ItemFilterPreview.Data</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Data.SQLite, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Data.SQLite.Core.1.0.102.0\lib\net46\System.Data.SQLite.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Data.SQLite.EF6, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Data.SQLite.EF6.1.0.102.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Data.SQLite.Linq, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.102.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Runtime.Serialization" />
|
||||||
|
<Reference Include="System.Security" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="DataContexts\FiltrationDbContext.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Repositories\IEntityRepository.cs" />
|
||||||
|
<Compile Include="Repositories\ItemSetRepository.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
|
||||||
|
<Project>{4aac3beb-1dc1-483e-9d11-0e9334e80227}</Project>
|
||||||
|
<Name>Filtration.ObjectModel</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<Import Project="..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets')" />
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets'))" />
|
||||||
|
</Target>
|
||||||
|
<!-- 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.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
||||||
36
Filtration.ItemFilterPreview.Data/Properties/AssemblyInfo.cs
Normal file
36
Filtration.ItemFilterPreview.Data/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("Filtration.ItemFilterPreview.Data")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("Filtration.ItemFilterPreview.Data")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("855b38cc-eef2-471d-bbbc-eb3e2ff3d387")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Data.Repositories
|
||||||
|
{
|
||||||
|
public interface IEntityRepository<T> : IDisposable
|
||||||
|
{
|
||||||
|
IQueryable<T> All { get; }
|
||||||
|
IQueryable<T> AllIncluding(params Expression<Func<T, object>>[] includeProperties);
|
||||||
|
T Find(int id);
|
||||||
|
void InsertOrUpdate(T itemSet);
|
||||||
|
void Delete(int id);
|
||||||
|
void Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
using System;
|
||||||
|
using System.Data.Entity;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using Filtration.ItemFilterPreview.Data.DataContexts;
|
||||||
|
using Filtration.ObjectModel;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Data.Repositories
|
||||||
|
{
|
||||||
|
public class ItemSetRepository : IEntityRepository<ItemSet>
|
||||||
|
{
|
||||||
|
FiltrationDbContext _context = new FiltrationDbContext();
|
||||||
|
|
||||||
|
|
||||||
|
public IQueryable<ItemSet> All => _context.ItemSets;
|
||||||
|
|
||||||
|
public IQueryable<ItemSet> AllIncluding(params Expression<Func<ItemSet, object>>[] includeProperties)
|
||||||
|
{
|
||||||
|
IQueryable<ItemSet> query = _context.ItemSets;
|
||||||
|
foreach (var includeProperty in includeProperties)
|
||||||
|
{
|
||||||
|
query = query.Include(includeProperty);
|
||||||
|
}
|
||||||
|
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemSet Find(int id)
|
||||||
|
{
|
||||||
|
return _context.ItemSets.Find(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InsertOrUpdate(ItemSet itemSet)
|
||||||
|
{
|
||||||
|
if (itemSet.Id == default(long))
|
||||||
|
{
|
||||||
|
// New entity
|
||||||
|
_context.ItemSets.Add(itemSet);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Existing entity
|
||||||
|
_context.Entry(itemSet).State = EntityState.Modified;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Delete(int id)
|
||||||
|
{
|
||||||
|
var itemSet = _context.ItemSets.Find(id);
|
||||||
|
_context.ItemSets.Remove(itemSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Save()
|
||||||
|
{
|
||||||
|
_context.SaveChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
_context.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
Filtration.ItemFilterPreview.Data/packages.config
Normal file
8
Filtration.ItemFilterPreview.Data/packages.config
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="EntityFramework" version="6.1.3" targetFramework="net46" />
|
||||||
|
<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" />
|
||||||
|
<package id="System.Data.SQLite.Linq" version="1.0.102.0" targetFramework="net461" />
|
||||||
|
</packages>
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProductVersion>
|
||||||
|
</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{58CD3B9C-EBBA-4527-A81C-78B7EA9CA298}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Filtration.ItemFilterPreview.Tests</RootNamespace>
|
||||||
|
<AssemblyName>Filtration.ItemFilterPreview.Tests</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
|
<TargetPlatformVersion>8.1</TargetPlatformVersion>
|
||||||
|
<MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||||
|
<IsCodedUITest>True</IsCodedUITest>
|
||||||
|
<TestProjectType>CodedUITest</TestProjectType>
|
||||||
|
<IsWindowsStoreCodedUITest>True</IsWindowsStoreCodedUITest>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<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.3\lib\net45\Castle.Core.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="FluentAssertions, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="FluentAssertions.Core, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.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>
|
||||||
|
<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>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="YamlDotNet, Version=3.9.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\YamlDotNet.3.9.0\lib\net35\YamlDotNet.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</CodeAnalysisDependentAssemblyPaths>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Services\serializationtest.cs" />
|
||||||
|
<Compile Include="Services\TestItemBlockItemMatcher.cs" />
|
||||||
|
<Compile Include="Services\TestItemFilterProcessor.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="app.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Filtration.ItemFilterPreview\Filtration.ItemFilterPreview.csproj">
|
||||||
|
<Project>{3ab98b6e-05db-44fa-9dad-584aa88f0739}</Project>
|
||||||
|
<Name>Filtration.ItemFilterPreview</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
|
||||||
|
<Project>{4aac3beb-1dc1-483e-9d11-0e9334e80227}</Project>
|
||||||
|
<Name>Filtration.ObjectModel</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Filtration.Parser.Interface\Filtration.Parser.Interface.csproj">
|
||||||
|
<Project>{46383F20-02DF-48B4-B092-9088FA4ACD5A}</Project>
|
||||||
|
<Name>Filtration.Parser.Interface</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Filtration.Parser\Filtration.Parser.csproj">
|
||||||
|
<Project>{10a7c2bc-ec6f-4a38-bdda-e35935004c02}</Project>
|
||||||
|
<Name>Filtration.Parser</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Filtration\Filtration.csproj">
|
||||||
|
<Project>{55e0a34c-e039-43d7-a024-a4045401cdda}</Project>
|
||||||
|
<Name>Filtration</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<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.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("Filtration.ItemFilterPreview.Tests")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("Filtration.ItemFilterPreview.Tests")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("58cd3b9c-ebba-4527-a81c-78b7ea9ca298")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
82
Filtration.ItemFilterPreview.Tests/Properties/Resources.Designer.cs
generated
Normal file
82
Filtration.ItemFilterPreview.Tests/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Tests.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
/// </summary>
|
||||||
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
|
// class via a tool like ResGen or Visual Studio.
|
||||||
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
|
// with the /str option, or rebuild your VS project.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Filtration.ItemFilterPreview.Tests.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
|
/// resource lookups using this strongly typed resource class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to ###############################################################################
|
||||||
|
///################ Path of Exile Item Filter - Script by Muldini ################
|
||||||
|
///###############################################################################
|
||||||
|
///############ http://www.pathofexile.com/forum/view-thread/1259059 #############
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///###############################################################################
|
||||||
|
///### Overview ##################################################################
|
||||||
|
///################## [rest of string was truncated]";.
|
||||||
|
/// </summary>
|
||||||
|
internal static string MuldiniFilterScript {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("MuldiniFilterScript", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
124
Filtration.ItemFilterPreview.Tests/Properties/Resources.resx
Normal file
124
Filtration.ItemFilterPreview.Tests/Properties/Resources.resx
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="MuldiniFilterScript" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\MuldiniFilterScript.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
11106
Filtration.ItemFilterPreview.Tests/Resources/MuldiniFilterScript.txt
Normal file
11106
Filtration.ItemFilterPreview.Tests/Resources/MuldiniFilterScript.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,522 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Filtration.ItemFilterPreview.Services;
|
||||||
|
using Filtration.ObjectModel;
|
||||||
|
using Filtration.ObjectModel.BlockItemTypes;
|
||||||
|
using Filtration.ObjectModel.Enums;
|
||||||
|
using Moq;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Tests.Services
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class TestItemBlockItemMatcher
|
||||||
|
{
|
||||||
|
private ItemBlockItemMatcherTestUtility _testUtility;
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void ItemBlockItemMatcherTestSetUp()
|
||||||
|
{
|
||||||
|
_testUtility = new ItemBlockItemMatcherTestUtility();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ItemBlockMatch_EmptyShowBlock_ReturnsTrue()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>();
|
||||||
|
var testInputBlock = new ItemFilterBlock();
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockMatch(testInputBlock, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.IsTrue(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ItemBlockMatch_SingleBlockItem_Matches_ReturnsTrue()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testBaseType = "Test Base Type";
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.BaseType == testBaseType);
|
||||||
|
var testInputBlock = new ItemFilterBlock();
|
||||||
|
var baseTypeBlockItem = new BaseTypeBlockItem();
|
||||||
|
baseTypeBlockItem.Items.Add(testBaseType);
|
||||||
|
testInputBlock.BlockItems.Add(baseTypeBlockItem);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockMatch(testInputBlock, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.IsTrue(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ItemBlockMatch_SingleBlockItem_DoesNotMatche_ReturnsFalse()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.BaseType == "Base Type 1");
|
||||||
|
var testInputBlock = new ItemFilterBlock();
|
||||||
|
var baseTypeBlockItem = new BaseTypeBlockItem();
|
||||||
|
baseTypeBlockItem.Items.Add("Base Type 2");
|
||||||
|
testInputBlock.BlockItems.Add(baseTypeBlockItem);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockMatch(testInputBlock, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.IsFalse(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ItemBlockMatch_MultipleBlockItems_Matches_ReturnsTrue()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.BaseType == "Base Type 1" && i.Height == 4 && i.Width == 2);
|
||||||
|
var testInputBlock = new ItemFilterBlock();
|
||||||
|
var baseTypeBlockItem = new BaseTypeBlockItem();
|
||||||
|
baseTypeBlockItem.Items.Add("Base Type 1");
|
||||||
|
var heightBlockItem = new HeightBlockItem(FilterPredicateOperator.Equal, 4);
|
||||||
|
var widthBlockItem = new WidthBlockItem(FilterPredicateOperator.Equal, 2);
|
||||||
|
|
||||||
|
testInputBlock.BlockItems.Add(baseTypeBlockItem);
|
||||||
|
testInputBlock.BlockItems.Add(heightBlockItem);
|
||||||
|
testInputBlock.BlockItems.Add(widthBlockItem);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockMatch(testInputBlock, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.IsTrue(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ItemBlockMatch_MultipleBlockItems_DoesNotMatch_ReturnsFalse()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.BaseType == "Base Type 1" && i.Height == 4 && i.Width == 2);
|
||||||
|
var testInputBlock = new ItemFilterBlock();
|
||||||
|
var baseTypeBlockItem = new BaseTypeBlockItem();
|
||||||
|
baseTypeBlockItem.Items.Add("Base Type d");
|
||||||
|
var heightBlockItem = new HeightBlockItem(FilterPredicateOperator.Equal, 3);
|
||||||
|
var widthBlockItem = new WidthBlockItem(FilterPredicateOperator.Equal, 2);
|
||||||
|
|
||||||
|
testInputBlock.BlockItems.Add(baseTypeBlockItem);
|
||||||
|
testInputBlock.BlockItems.Add(heightBlockItem);
|
||||||
|
testInputBlock.BlockItems.Add(widthBlockItem);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockMatch(testInputBlock, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.IsFalse(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase("Test Base Type", true)]
|
||||||
|
[TestCase("Test Bas", true)]
|
||||||
|
[TestCase("T", true)]
|
||||||
|
[TestCase("Base Type", false)]
|
||||||
|
public void ItemBlockItemMatch_BaseTypeBlockItem_SingleBlockItemValue_ReturnsTrue(string testInputBaseType, bool expectedResult)
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.BaseType == "Test Base Type");
|
||||||
|
var testInputBaseTypeBlockItem = new BaseTypeBlockItem();
|
||||||
|
testInputBaseTypeBlockItem.Items.Add(testInputBaseType);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBaseTypeBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase("Test Base Type", true)]
|
||||||
|
[TestCase("Test Bas", true)]
|
||||||
|
[TestCase("T", true)]
|
||||||
|
[TestCase("Base Type", false)]
|
||||||
|
public void ItemBlockItemMatch_BaseTypeBlockItem_MultipleBlockItemValues_ReturnsCorrectResult(string testInputBaseType, bool expectedResult)
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.BaseType == "Test Base Type");
|
||||||
|
var testInputBlockItem = new BaseTypeBlockItem();
|
||||||
|
testInputBlockItem.Items.Add("Something else");
|
||||||
|
testInputBlockItem.Items.Add(testInputBaseType);
|
||||||
|
testInputBlockItem.Items.Add("Blah");
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase("Test Item Class", true)]
|
||||||
|
[TestCase("Test It", true)]
|
||||||
|
[TestCase("T", true)]
|
||||||
|
[TestCase("Carrots", false)]
|
||||||
|
[TestCase("Item Class", true)]
|
||||||
|
public void ItemBlockItemMatch_ClassBlockItem_SingleBlockItemValue_ReturnsCorrectResult(string testInputBlockItemItemClass, bool expectedResult)
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.ItemClass == "Test Item Class");
|
||||||
|
var testInputBlockItem = new ClassBlockItem();
|
||||||
|
testInputBlockItem.Items.Add(testInputBlockItemItemClass);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 49, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 50, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 51, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 49, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 50, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 51, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 49, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 50, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 51, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 49, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 50, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 51, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 49, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 50, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 51, true)]
|
||||||
|
[TestCase(-1, 51, false)]
|
||||||
|
public void ItemBlockItemMatch_DropLevelBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemDropLevel, bool expectedResult)
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.DropLevel == 50);
|
||||||
|
var testInputBlockItem = new DropLevelBlockItem(testInputFilterPredicateOperator, testInputBlockItemDropLevel);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 1, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 2, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 3, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 1, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 2, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 3, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 1, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 2, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 3, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 1, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 2, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 3, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 1, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 2, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 3, true)]
|
||||||
|
[TestCase(-1, 3, false)]
|
||||||
|
public void ItemBlockItemMatch_HeightBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemHeight, bool expectedResult)
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.Height == 2);
|
||||||
|
var testInputBlockItem = new HeightBlockItem(testInputFilterPredicateOperator, testInputBlockItemHeight);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 49, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 50, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 51, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 49, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 50, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 51, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 49, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 50, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 51, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 49, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 50, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 51, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 49, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 50, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 51, true)]
|
||||||
|
[TestCase(-1, 51, false)]
|
||||||
|
public void ItemBlockItemMatch_ItemLevelBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemItemLevel, bool expectedResult)
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.ItemLevel == 50);
|
||||||
|
var testInputBlockItem = new ItemLevelBlockItem(testInputFilterPredicateOperator, testInputBlockItemItemLevel);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 2, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 3, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 4, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 2, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 3, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 4, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 2, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 3, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 4, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 2, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 3, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 4, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 2, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 3, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 4, true)]
|
||||||
|
[TestCase(-1, 3, false)]
|
||||||
|
public void ItemBlockItemMatch_LinkedSocketsBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemLinkedSockets, bool expectedResult)
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.LinkedSockets == 3);
|
||||||
|
var testInputBlockItem = new LinkedSocketsBlockItem(testInputFilterPredicateOperator, testInputBlockItemLinkedSockets);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 11, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 12, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 13, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 11, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 12, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 13, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 11, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 12, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 13, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 11, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 12, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 13, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 11, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 12, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 13, true)]
|
||||||
|
[TestCase(-1, 13, false)]
|
||||||
|
public void ItemBlockItemMatch_QualityBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemQuality, bool expectedResult)
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.Quality == 12);
|
||||||
|
var testInputBlockItem = new QualityBlockItem(testInputFilterPredicateOperator, testInputBlockItemQuality);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, ItemRarity.Normal, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, ItemRarity.Magic , true)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, ItemRarity.Rare, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, ItemRarity.Normal, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, ItemRarity.Magic, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, ItemRarity.Rare, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, ItemRarity.Normal, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, ItemRarity.Magic, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, ItemRarity.Rare, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, ItemRarity.Normal, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, ItemRarity.Magic, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, ItemRarity.Rare, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, ItemRarity.Normal, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, ItemRarity.Magic, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, ItemRarity.Rare, true)]
|
||||||
|
[TestCase(-1, 13, false)]
|
||||||
|
public void ItemBlockItemMatch_RarityBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemRarity, bool expectedResult)
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.ItemRarity == ItemRarity.Magic);
|
||||||
|
var testInputBlockItem = new RarityBlockItem(testInputFilterPredicateOperator, testInputBlockItemRarity);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 2, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 3, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 4, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 2, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 3, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 4, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 2, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 3, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 4, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 2, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 3, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 4, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 2, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 3, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 4, true)]
|
||||||
|
[TestCase(-1, 3, false)]
|
||||||
|
public void ItemBlockItemMatch_SocketsBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemSockets, bool expectedResult)
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.SocketCount == 3);
|
||||||
|
var testInputBlockItem = new SocketsBlockItem(testInputFilterPredicateOperator, testInputBlockItemSockets);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 1, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 2, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.Equal, 3, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 1, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 2, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThan, 3, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 1, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 2, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 3, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 1, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 2, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThan, 3, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 1, false)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 2, true)]
|
||||||
|
[TestCase(FilterPredicateOperator.LessThanOrEqual, 3, true)]
|
||||||
|
[TestCase(-1, 3, false)]
|
||||||
|
public void ItemBlockItemMatch_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemWidth, bool expectedResult)
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.Width == 2);
|
||||||
|
var testInputBlockItem = new WidthBlockItem(testInputFilterPredicateOperator, testInputBlockItemWidth);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ItemBlockItemMatch_SocketGroupBlockItem_SingleItemSocketGroup_SingleBlockItemSocketGroup_Match_ReturnsCorrectResult()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputBlockItem = new SocketGroupBlockItem();
|
||||||
|
testInputBlockItem.Items.Add("RGB");
|
||||||
|
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.LinkedSocketGroups == new List<SocketGroup>
|
||||||
|
{
|
||||||
|
new SocketGroup(new List<Socket>
|
||||||
|
{
|
||||||
|
new Socket(SocketColor.Red),
|
||||||
|
new Socket(SocketColor.Green),
|
||||||
|
new Socket(SocketColor.Blue),
|
||||||
|
}, true)
|
||||||
|
});
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.IsTrue(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ItemBlockItemMatch_SocketGroupBlockItem_SingleItemSocketGroup_SingleBlockItemSocketGroup_NoMatch_ReturnsCorrectResult()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputBlockItem = new SocketGroupBlockItem();
|
||||||
|
testInputBlockItem.Items.Add("RGB");
|
||||||
|
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.LinkedSocketGroups == new List<SocketGroup>
|
||||||
|
{
|
||||||
|
new SocketGroup(new List<Socket>
|
||||||
|
{
|
||||||
|
new Socket(SocketColor.Red),
|
||||||
|
new Socket(SocketColor.Green)
|
||||||
|
}, true)
|
||||||
|
});
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.IsFalse(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ItemBlockItemMatch_SocketGroupBlockItem_MultipleItemSocketGroup_SingleBlockItemSocketGroup_NoMatch_ReturnsCorrectResult()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputBlockItem = new SocketGroupBlockItem();
|
||||||
|
testInputBlockItem.Items.Add("RGB");
|
||||||
|
testInputBlockItem.Items.Add("RGWW");
|
||||||
|
testInputBlockItem.Items.Add("RRGG");
|
||||||
|
testInputBlockItem.Items.Add("WWWW");
|
||||||
|
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.LinkedSocketGroups == new List<SocketGroup>
|
||||||
|
{
|
||||||
|
new SocketGroup(new List<Socket>
|
||||||
|
{
|
||||||
|
new Socket(SocketColor.Red),
|
||||||
|
new Socket(SocketColor.Green),
|
||||||
|
new Socket(SocketColor.White),
|
||||||
|
new Socket(SocketColor.Green)
|
||||||
|
|
||||||
|
}, true)
|
||||||
|
});
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.IsFalse(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ItemBlockItemMatch_SocketGroupBlockItem_MultipleItemSocketGroup_SingleBlockItemSocketGroup_Match_ReturnsCorrectResult()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputBlockItem = new SocketGroupBlockItem();
|
||||||
|
testInputBlockItem.Items.Add("RGB");
|
||||||
|
testInputBlockItem.Items.Add("RGWW");
|
||||||
|
testInputBlockItem.Items.Add("RGWG");
|
||||||
|
testInputBlockItem.Items.Add("WWWW");
|
||||||
|
|
||||||
|
var testInputItem = Mock.Of<IItem>(i => i.LinkedSocketGroups == new List<SocketGroup>
|
||||||
|
{
|
||||||
|
new SocketGroup(new List<Socket>
|
||||||
|
{
|
||||||
|
new Socket(SocketColor.Red),
|
||||||
|
new Socket(SocketColor.Green),
|
||||||
|
new Socket(SocketColor.White),
|
||||||
|
new Socket(SocketColor.Green)
|
||||||
|
|
||||||
|
}, true)
|
||||||
|
});
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.IsTrue(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ItemBlockItemMatcherTestUtility
|
||||||
|
{
|
||||||
|
public ItemBlockItemMatcherTestUtility()
|
||||||
|
{
|
||||||
|
// Mock setups
|
||||||
|
|
||||||
|
// Class under-test instantiation
|
||||||
|
BlockItemMatcher = new BlockItemMatcher();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockItemMatcher BlockItemMatcher { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,246 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using Filtration.ItemFilterPreview.Services;
|
||||||
|
using Filtration.ItemFilterPreview.Tests.Properties;
|
||||||
|
using Filtration.ObjectModel;
|
||||||
|
using Filtration.ObjectModel.BlockItemTypes;
|
||||||
|
using Filtration.ObjectModel.Enums;
|
||||||
|
using Filtration.Parser.Services;
|
||||||
|
using Moq;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Tests.Services
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class TestItemFilterProcessor
|
||||||
|
{
|
||||||
|
private ItemFilterProcessorTestUtility _testUtility;
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void ItemFilterProcessorTestSetUp()
|
||||||
|
{
|
||||||
|
_testUtility = new ItemFilterProcessorTestUtility();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ProcessItemsAgainstItemFilterScript_Matches_ReturnsTrue()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>();
|
||||||
|
var testInputBlock = Mock.Of<IItemFilterBlock>();
|
||||||
|
var testInputScript = Mock.Of<IItemFilterScript>(s => s.ItemFilterBlocks == new ObservableCollection<IItemFilterBlock> {testInputBlock});
|
||||||
|
|
||||||
|
_testUtility.MockBlockItemMatcher
|
||||||
|
.Setup(b => b.ItemBlockMatch(testInputBlock, testInputItem))
|
||||||
|
.Returns(true)
|
||||||
|
.Verifiable();
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.ItemFilterProcessor.ProcessItemsAgainstItemFilterScript(testInputScript, new List<IItem> { testInputItem });
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
_testUtility.MockBlockItemMatcher.Verify();
|
||||||
|
Assert.AreEqual(testInputBlock, result.First(r => r.ItemFilterBlock == testInputBlock).ItemFilterBlock);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ProcessItemsAgainstItemFilterScript_DoesNotMatch_ResultHasNullItemFilterBlock()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputItem = Mock.Of<IItem>();
|
||||||
|
var testInputBlock = Mock.Of<IItemFilterBlock>();
|
||||||
|
var testInputScript = Mock.Of<IItemFilterScript>(s => s.ItemFilterBlocks == new ObservableCollection<IItemFilterBlock> { testInputBlock });
|
||||||
|
|
||||||
|
_testUtility.MockBlockItemMatcher
|
||||||
|
.Setup(b => b.ItemBlockMatch(testInputBlock, testInputItem))
|
||||||
|
.Returns(false)
|
||||||
|
.Verifiable();
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = _testUtility.ItemFilterProcessor.ProcessItemsAgainstItemFilterScript(testInputScript, new List<IItem> { testInputItem });
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
_testUtility.MockBlockItemMatcher.Verify();
|
||||||
|
Assert.AreEqual(null, result.First(r => r.Item == testInputItem).ItemFilterBlock);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ProcessItemsAgainstItemFilterScript_IntegrationTest()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputScriptFile = Resources.MuldiniFilterScript;
|
||||||
|
var blockGroupHierarchyBuilder = new BlockGroupHierarchyBuilder();
|
||||||
|
var scriptTranslator = new ItemFilterScriptTranslator(new ItemFilterBlockTranslator(blockGroupHierarchyBuilder), blockGroupHierarchyBuilder);
|
||||||
|
var script = scriptTranslator.TranslateStringToItemFilterScript(testInputScriptFile);
|
||||||
|
|
||||||
|
var testInputItem = new Item
|
||||||
|
{
|
||||||
|
BaseType = "BlahdeBlah",
|
||||||
|
ItemClass = "Wands",
|
||||||
|
ItemRarity = ItemRarity.Magic,
|
||||||
|
ItemLevel = 9,
|
||||||
|
DropLevel = 9,
|
||||||
|
Height = 3,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
|
||||||
|
};
|
||||||
|
|
||||||
|
var itemFilterProcessor = new ItemFilterProcessor(new BlockItemMatcher());
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = itemFilterProcessor.ProcessItemsAgainstItemFilterScript(script, new List<IItem> { testInputItem });
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual("Wands", result.First().ItemFilterBlock.BlockItems.OfType<ClassBlockItem>().First().Items.First());
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ProcessItemsAgainstItemFilterScript_IntegrationTest_10Items()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var testInputScriptFile = Resources.MuldiniFilterScript;
|
||||||
|
var blockGroupHierarchyBuilder = new BlockGroupHierarchyBuilder();
|
||||||
|
var scriptTranslator = new ItemFilterScriptTranslator(new ItemFilterBlockTranslator(blockGroupHierarchyBuilder), blockGroupHierarchyBuilder);
|
||||||
|
var script = scriptTranslator.TranslateStringToItemFilterScript(testInputScriptFile);
|
||||||
|
|
||||||
|
var testInputItems = new List<IItem>
|
||||||
|
{
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
BaseType = "BlahdeBlah",
|
||||||
|
ItemClass = "Wands",
|
||||||
|
ItemRarity = ItemRarity.Magic,
|
||||||
|
ItemLevel = 9,
|
||||||
|
DropLevel = 9,
|
||||||
|
Height = 3,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
BaseType = "BlahdeBlah",
|
||||||
|
ItemClass = "Wands",
|
||||||
|
ItemRarity = ItemRarity.Magic,
|
||||||
|
ItemLevel = 9,
|
||||||
|
DropLevel = 9,
|
||||||
|
Height = 3,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
BaseType = "BlahdeBlah",
|
||||||
|
ItemClass = "Wands",
|
||||||
|
ItemRarity = ItemRarity.Magic,
|
||||||
|
ItemLevel = 9,
|
||||||
|
DropLevel = 9,
|
||||||
|
Height = 3,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
BaseType = "BlahdeBlah",
|
||||||
|
ItemClass = "Wands",
|
||||||
|
ItemRarity = ItemRarity.Magic,
|
||||||
|
ItemLevel = 9,
|
||||||
|
DropLevel = 9,
|
||||||
|
Height = 3,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
BaseType = "BlahdeBlah",
|
||||||
|
ItemClass = "Wands",
|
||||||
|
ItemRarity = ItemRarity.Magic,
|
||||||
|
ItemLevel = 9,
|
||||||
|
DropLevel = 9,
|
||||||
|
Height = 3,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
BaseType = "BlahdeBlah",
|
||||||
|
ItemClass = "Wands",
|
||||||
|
ItemRarity = ItemRarity.Magic,
|
||||||
|
ItemLevel = 9,
|
||||||
|
DropLevel = 9,
|
||||||
|
Height = 3,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
BaseType = "BlahdeBlah",
|
||||||
|
ItemClass = "Wands",
|
||||||
|
ItemRarity = ItemRarity.Magic,
|
||||||
|
ItemLevel = 9,
|
||||||
|
DropLevel = 9,
|
||||||
|
Height = 3,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
BaseType = "BlahdeBlah",
|
||||||
|
ItemClass = "Wands",
|
||||||
|
ItemRarity = ItemRarity.Magic,
|
||||||
|
ItemLevel = 9,
|
||||||
|
DropLevel = 9,
|
||||||
|
Height = 3,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
BaseType = "BlahdeBlah",
|
||||||
|
ItemClass = "Wands",
|
||||||
|
ItemRarity = ItemRarity.Magic,
|
||||||
|
ItemLevel = 9,
|
||||||
|
DropLevel = 9,
|
||||||
|
Height = 3,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
BaseType = "BlahdeBlah",
|
||||||
|
ItemClass = "Wands",
|
||||||
|
ItemRarity = ItemRarity.Magic,
|
||||||
|
ItemLevel = 9,
|
||||||
|
DropLevel = 9,
|
||||||
|
Height = 3,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var itemFilterProcessor = new ItemFilterProcessor(new BlockItemMatcher());
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var result = itemFilterProcessor.ProcessItemsAgainstItemFilterScript(script, testInputItems);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Assert.AreEqual("Wands", result.First().ItemFilterBlock.BlockItems.OfType<ClassBlockItem>().First().Items.First());
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ItemFilterProcessorTestUtility
|
||||||
|
{
|
||||||
|
public ItemFilterProcessorTestUtility()
|
||||||
|
{
|
||||||
|
// Mock setups
|
||||||
|
MockBlockItemMatcher = new Mock<IBlockItemMatcher>();
|
||||||
|
|
||||||
|
// Class under-test instantiation
|
||||||
|
ItemFilterProcessor = new ItemFilterProcessor(MockBlockItemMatcher.Object);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemFilterProcessor ItemFilterProcessor { get; private set; }
|
||||||
|
|
||||||
|
public Mock<IBlockItemMatcher> MockBlockItemMatcher { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Xml;
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
var item = new Item
|
||||||
|
{
|
||||||
|
ItemClass = "Test Class",
|
||||||
|
BaseType = "Test Base Type",
|
||||||
|
DropLevel = 54,
|
||||||
|
Height = 2,
|
||||||
|
Width = 2,
|
||||||
|
ItemLevel = 50,
|
||||||
|
ItemRarity = ItemRarity.Rare,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red), new Socket(SocketColor.Blue), new Socket(SocketColor.White)}, true)},
|
||||||
|
Quality = 12
|
||||||
|
};
|
||||||
|
|
||||||
|
//Act
|
||||||
|
|
||||||
|
var serializer = new XmlSerializer(item.GetType());
|
||||||
|
var output = string.Empty;
|
||||||
|
using (var textWriter = new StringWriter())
|
||||||
|
{
|
||||||
|
serializer.Serialize(textWriter, item);
|
||||||
|
output = textWriter.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
var x = 2;
|
||||||
|
//Assert
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
Filtration.ItemFilterPreview.Tests/app.config
Normal file
15
Filtration.ItemFilterPreview.Tests/app.config
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Xceed.Wpf.AvalonDock" publicKeyToken="3e4669d2f30244f4" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-2.9.0.0" newVersion="2.9.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="ControlzEx" publicKeyToken="f08b075e934b7045" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-2.1.2.3" newVersion="2.1.2.3" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
</configuration>
|
||||||
8
Filtration.ItemFilterPreview.Tests/packages.config
Normal file
8
Filtration.ItemFilterPreview.Tests/packages.config
Normal file
@@ -0,0 +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.1" targetFramework="net461" />
|
||||||
|
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
||||||
|
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
||||||
|
<package id="YamlDotNet" version="3.9.0" targetFramework="net461" />
|
||||||
|
</packages>
|
||||||
6
Filtration.ItemFilterPreview/App.config
Normal file
6
Filtration.ItemFilterPreview/App.config
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
8
Filtration.ItemFilterPreview/App.xaml
Normal file
8
Filtration.ItemFilterPreview/App.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<Application x:Class="Filtration.ItemFilterPreview.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
Startup="Application_Startup">
|
||||||
|
<Application.Resources>
|
||||||
|
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
||||||
25
Filtration.ItemFilterPreview/App.xaml.cs
Normal file
25
Filtration.ItemFilterPreview/App.xaml.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using System.Windows;
|
||||||
|
using Castle.Facilities.TypedFactory;
|
||||||
|
using Castle.Windsor;
|
||||||
|
using Castle.Windsor.Installer;
|
||||||
|
using Filtration.ItemFilterPreview.Views;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview
|
||||||
|
{
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
private IWindsorContainer _container;
|
||||||
|
|
||||||
|
private void Application_Startup(object sender, StartupEventArgs e)
|
||||||
|
{
|
||||||
|
_container = new WindsorContainer();
|
||||||
|
|
||||||
|
_container.AddFacility<TypedFactoryFacility>();
|
||||||
|
_container.Install(FromAssembly.InThisApplication());
|
||||||
|
_container.Install(FromAssembly.Named("Filtration.Parser"));
|
||||||
|
|
||||||
|
var mainWindow = _container.Resolve<IMainWindow>();
|
||||||
|
mainWindow.Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
204
Filtration.ItemFilterPreview/Filtration.ItemFilterPreview.csproj
Normal file
204
Filtration.ItemFilterPreview/Filtration.ItemFilterPreview.csproj
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{3AB98B6E-05DB-44FA-9DAD-584AA88F0739}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Filtration.ItemFilterPreview</RootNamespace>
|
||||||
|
<AssemblyName>Filtration.ItemFilterPreview</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<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.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>
|
||||||
|
<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>
|
||||||
|
<Private>True</Private>
|
||||||
|
</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>
|
||||||
|
<Private>True</Private>
|
||||||
|
</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>
|
||||||
|
<Private>True</Private>
|
||||||
|
</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>
|
||||||
|
<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>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<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>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xaml">
|
||||||
|
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
|
<Reference Include="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ApplicationDefinition Include="App.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</ApplicationDefinition>
|
||||||
|
<Compile Include="Services\BlockItemMatcher.cs" />
|
||||||
|
<Compile Include="Services\ItemFilterProcessor.cs" />
|
||||||
|
<Compile Include="UserControls\DesignTime\DesignTimeItemControl.cs" />
|
||||||
|
<Compile Include="UserControls\ItemControl.xaml.cs">
|
||||||
|
<DependentUpon>ItemControl.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="UserControls\ItemSocketsControl.xaml.cs">
|
||||||
|
<DependentUpon>ItemSocketsControl.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="UserControls\LootExplosionSceneUserControl.xaml.cs">
|
||||||
|
<DependentUpon>LootExplosionSceneUserControl.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="ViewModels\LootExplosionViewModel.cs" />
|
||||||
|
<Compile Include="ViewModels\MainWindowViewModel.cs" />
|
||||||
|
<Compile Include="Views\LootExplosionView.xaml.cs">
|
||||||
|
<DependentUpon>LootExplosionView.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="WindsorInstallers\ViewModelsInstaller.cs" />
|
||||||
|
<Compile Include="WindsorInstallers\ViewsInstaller.cs" />
|
||||||
|
<Compile Include="WindsorInstallers\ServicesInstaller.cs" />
|
||||||
|
<Page Include="UserControls\ItemControl.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="UserControls\LootExplosionSceneUserControl.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Views\LootExplosionView.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Views\MainWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Compile Include="App.xaml.cs">
|
||||||
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Views\MainWindow.xaml.cs">
|
||||||
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Page Include="UserControls\ItemSocketsControl.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<AppDesigner Include="Properties\" />
|
||||||
|
<Resource Include="Resources\Fontin-SmallCaps.ttf" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Filtration.Common\Filtration.Common.csproj">
|
||||||
|
<Project>{8cb44f28-2956-4c2a-9314-72727262edd4}</Project>
|
||||||
|
<Name>Filtration.Common</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
|
||||||
|
<Project>{4aac3beb-1dc1-483e-9d11-0e9334e80227}</Project>
|
||||||
|
<Name>Filtration.ObjectModel</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Filtration.Parser.Interface\Filtration.Parser.Interface.csproj">
|
||||||
|
<Project>{46383f20-02df-48b4-b092-9088fa4acd5a}</Project>
|
||||||
|
<Name>Filtration.Parser.Interface</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Filtration.Parser\Filtration.Parser.csproj">
|
||||||
|
<Project>{10a7c2bc-ec6f-4a38-bdda-e35935004c02}</Project>
|
||||||
|
<Name>Filtration.Parser</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Resources\neversink.filter.txt" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Resources\muldini.txt" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Model\" />
|
||||||
|
</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.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
||||||
59
Filtration.ItemFilterPreview/Properties/AssemblyInfo.cs
Normal file
59
Filtration.ItemFilterPreview/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Resources;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("Filtration.ItemFilterPreview")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("Filtration.ItemFilterPreview")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
//In order to begin building localizable applications, set
|
||||||
|
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||||
|
//inside a <PropertyGroup>. For example, if you are using US english
|
||||||
|
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||||
|
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||||
|
//the line below to match the UICulture setting in the project file.
|
||||||
|
|
||||||
|
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||||
|
|
||||||
|
|
||||||
|
[assembly: ThemeInfo(
|
||||||
|
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// or application resource dictionaries)
|
||||||
|
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// app, or any theme specific resource dictionaries)
|
||||||
|
)]
|
||||||
|
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
|
||||||
|
|
||||||
|
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]
|
||||||
|
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
|
||||||
100
Filtration.ItemFilterPreview/Properties/Resources.Designer.cs
generated
Normal file
100
Filtration.ItemFilterPreview/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
/// </summary>
|
||||||
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
|
// class via a tool like ResGen or Visual Studio.
|
||||||
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
|
// with the /str option, or rebuild your VS project.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Filtration.ItemFilterPreview.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
|
/// resource lookups using this strongly typed resource class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to ###############################################################################
|
||||||
|
///################ Path of Exile Item Filter - Script by Muldini ################
|
||||||
|
///###############################################################################
|
||||||
|
///############ http://www.pathofexile.com/forum/view-thread/1259059 #############
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///###############################################################################
|
||||||
|
///### Overview ##################################################################
|
||||||
|
///################## [rest of string was truncated]";.
|
||||||
|
/// </summary>
|
||||||
|
internal static string muldini {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("muldini", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to #---------------------------------------------------------------------------------------------------------------
|
||||||
|
///# NeverSink's Indepth Loot Filter
|
||||||
|
///# VERSION 3.0 - Full
|
||||||
|
///#---------------------------------------------------------------------------------------------------------------
|
||||||
|
///#
|
||||||
|
///# You can always find the latest version here:
|
||||||
|
///# http://pastebin.com/Af00CbhA
|
||||||
|
///# Forum discussion thread. You can post question and feedback here:
|
||||||
|
///# http://www.pathofexile.com/forum/view-thread/1246208/page/1
|
||||||
|
///# Please use [rest of string was truncated]";.
|
||||||
|
/// </summary>
|
||||||
|
internal static string neversinkfilter {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("neversinkfilter", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
127
Filtration.ItemFilterPreview/Properties/Resources.resx
Normal file
127
Filtration.ItemFilterPreview/Properties/Resources.resx
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="muldini" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\muldini.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||||
|
</data>
|
||||||
|
<data name="neversinkfilter" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\neversink.filter.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
26
Filtration.ItemFilterPreview/Properties/Settings.Designer.cs
generated
Normal file
26
Filtration.ItemFilterPreview/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Properties {
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default {
|
||||||
|
get {
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
BIN
Filtration.ItemFilterPreview/Resources/Fontin-SmallCaps.ttf
Normal file
BIN
Filtration.ItemFilterPreview/Resources/Fontin-SmallCaps.ttf
Normal file
Binary file not shown.
11126
Filtration.ItemFilterPreview/Resources/muldini.txt
Normal file
11126
Filtration.ItemFilterPreview/Resources/muldini.txt
Normal file
File diff suppressed because it is too large
Load Diff
2631
Filtration.ItemFilterPreview/Resources/neversink.filter.txt
Normal file
2631
Filtration.ItemFilterPreview/Resources/neversink.filter.txt
Normal file
File diff suppressed because it is too large
Load Diff
155
Filtration.ItemFilterPreview/Services/BlockItemMatcher.cs
Normal file
155
Filtration.ItemFilterPreview/Services/BlockItemMatcher.cs
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Filtration.ObjectModel;
|
||||||
|
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||||
|
using Filtration.ObjectModel.BlockItemTypes;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Services
|
||||||
|
{
|
||||||
|
internal interface IBlockItemMatcher
|
||||||
|
{
|
||||||
|
bool ItemBlockMatch(IItemFilterBlock block, IItem item);
|
||||||
|
bool ItemBlockItemMatch(IItemFilterBlockItem blockItem, IItem item);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class BlockItemMatcher : IBlockItemMatcher
|
||||||
|
{
|
||||||
|
public bool ItemBlockMatch(IItemFilterBlock block, IItem item)
|
||||||
|
{
|
||||||
|
|
||||||
|
var match = block.BlockItems
|
||||||
|
.Where(blockItem => !(blockItem is IAudioVisualBlockItem) && !(blockItem is ActionBlockItem))
|
||||||
|
.All(blockItem => ItemBlockItemMatch(blockItem, item));
|
||||||
|
|
||||||
|
return match;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ItemBlockItemMatch(IItemFilterBlockItem blockItem, IItem item)
|
||||||
|
{
|
||||||
|
var blockItemType = blockItem.GetType();
|
||||||
|
|
||||||
|
if (blockItemType == typeof (BaseTypeBlockItem))
|
||||||
|
return BaseTypeBlockItemMatch((BaseTypeBlockItem)blockItem, item);
|
||||||
|
|
||||||
|
if (blockItemType == typeof (ClassBlockItem))
|
||||||
|
return ClassBlockItemMatch((ClassBlockItem) blockItem, item);
|
||||||
|
|
||||||
|
if (blockItemType == typeof(DropLevelBlockItem))
|
||||||
|
return DropLevelBlockItemMatch((DropLevelBlockItem)blockItem, item);
|
||||||
|
|
||||||
|
if (blockItemType == typeof(HeightBlockItem))
|
||||||
|
return HeightBlockItemMatch((HeightBlockItem)blockItem, item);
|
||||||
|
|
||||||
|
if (blockItemType == typeof(ItemLevelBlockItem))
|
||||||
|
return ItemLevelBlockItemMatch((ItemLevelBlockItem)blockItem, item);
|
||||||
|
|
||||||
|
if (blockItemType == typeof(LinkedSocketsBlockItem))
|
||||||
|
return LinkedSocketsBlockItemMatch((LinkedSocketsBlockItem)blockItem, item);
|
||||||
|
|
||||||
|
if (blockItemType == typeof(QualityBlockItem))
|
||||||
|
return QualityBlockItemMatch((QualityBlockItem)blockItem, item);
|
||||||
|
|
||||||
|
if (blockItemType == typeof(RarityBlockItem))
|
||||||
|
return RarityBlockItemMatch((RarityBlockItem)blockItem, item);
|
||||||
|
|
||||||
|
if (blockItemType == typeof(SocketsBlockItem))
|
||||||
|
return SocketsBlockItemMatch((SocketsBlockItem)blockItem, item);
|
||||||
|
|
||||||
|
if (blockItemType == typeof(WidthBlockItem))
|
||||||
|
return WidthBlockItemMatch((WidthBlockItem)blockItem, item);
|
||||||
|
|
||||||
|
if (blockItemType == typeof(SocketGroupBlockItem))
|
||||||
|
return SocketGroupBlockItemMatch((SocketGroupBlockItem)blockItem, item);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool BaseTypeBlockItemMatch(BaseTypeBlockItem baseTypeBlockItem, IItem item)
|
||||||
|
{
|
||||||
|
return baseTypeBlockItem.Items.Any(b => item.BaseType.StartsWith(b));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool ClassBlockItemMatch(ClassBlockItem classBlockItem, IItem item)
|
||||||
|
{
|
||||||
|
return classBlockItem.Items.Any(c => item.ItemClass.Contains(c));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool DropLevelBlockItemMatch(DropLevelBlockItem dropLevelBlockItem, IItem item)
|
||||||
|
{
|
||||||
|
return NumericFilterPredicateBlockItemMatch(dropLevelBlockItem, item.DropLevel);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool HeightBlockItemMatch(HeightBlockItem heightBlockItem, IItem item)
|
||||||
|
{
|
||||||
|
return NumericFilterPredicateBlockItemMatch(heightBlockItem, item.Height);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool ItemLevelBlockItemMatch(ItemLevelBlockItem itemLevelBlockItem, IItem item)
|
||||||
|
{
|
||||||
|
return NumericFilterPredicateBlockItemMatch(itemLevelBlockItem, item.ItemLevel);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool LinkedSocketsBlockItemMatch(LinkedSocketsBlockItem linkedSocketsBlockItem, IItem item)
|
||||||
|
{
|
||||||
|
return NumericFilterPredicateBlockItemMatch(linkedSocketsBlockItem, item.LinkedSockets);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool QualityBlockItemMatch(QualityBlockItem qualityBlockItem, IItem item)
|
||||||
|
{
|
||||||
|
return NumericFilterPredicateBlockItemMatch(qualityBlockItem, item.Quality);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool RarityBlockItemMatch(RarityBlockItem qualityBlockItem, IItem item)
|
||||||
|
{
|
||||||
|
return NumericFilterPredicateBlockItemMatch(qualityBlockItem, (int)item.ItemRarity);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool SocketsBlockItemMatch(SocketsBlockItem socketsBlockItem, IItem item)
|
||||||
|
{
|
||||||
|
return NumericFilterPredicateBlockItemMatch(socketsBlockItem, item.SocketCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool WidthBlockItemMatch(WidthBlockItem widthBlockItem, IItem item)
|
||||||
|
{
|
||||||
|
return NumericFilterPredicateBlockItemMatch(widthBlockItem, item.Width);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool SocketGroupBlockItemMatch(SocketGroupBlockItem socketGroupBlockItem, IItem item)
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach (var blockItemSocketGroup in socketGroupBlockItem.SocketGroups) // for each group of sockets in the block item
|
||||||
|
{
|
||||||
|
foreach (var itemLinkedSocketGroup in item.LinkedSocketGroups) // for each linked socket group in the item
|
||||||
|
{
|
||||||
|
if (SocketGroupHasRequiredSocketColors(itemLinkedSocketGroup, blockItemSocketGroup))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool SocketGroupHasRequiredSocketColors(SocketGroup itemLinkedSocketGroup, SocketGroup blockItemSocketGroup)
|
||||||
|
{
|
||||||
|
|
||||||
|
var blockSocketGroupColorCounts = blockItemSocketGroup.GroupBy(i => i.Color, (key, values) => new { SocketColor = key, Count = values.Count() }).ToList();
|
||||||
|
var itemSocketGroupColorCounts = itemLinkedSocketGroup.GroupBy(i => i.Color, (key, values) => new {SocketColor = key, Count = values.Count()}).ToList();
|
||||||
|
|
||||||
|
foreach (var blockItemSocketColorCount in blockSocketGroupColorCounts)
|
||||||
|
{
|
||||||
|
var match = itemSocketGroupColorCounts.FirstOrDefault(i => i.SocketColor == blockItemSocketColorCount.SocketColor && i.Count >= blockItemSocketColorCount.Count);
|
||||||
|
if (match == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool NumericFilterPredicateBlockItemMatch<T>(T numericFilterPredicateBlockItem, int matchValue) where T : NumericFilterPredicateBlockItem
|
||||||
|
{
|
||||||
|
return numericFilterPredicateBlockItem.FilterPredicate.CompareUsing(matchValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
48
Filtration.ItemFilterPreview/Services/ItemFilterProcessor.cs
Normal file
48
Filtration.ItemFilterPreview/Services/ItemFilterProcessor.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using Filtration.ObjectModel;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Services
|
||||||
|
{
|
||||||
|
internal interface IItemFilterProcessor
|
||||||
|
{
|
||||||
|
List<IFilteredItem> ProcessItemsAgainstItemFilterScript(IItemFilterScript itemFilterScript, IEnumerable<IItem> items);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class ItemFilterProcessor : IItemFilterProcessor
|
||||||
|
{
|
||||||
|
private readonly IBlockItemMatcher _blockItemMatcher;
|
||||||
|
|
||||||
|
public ItemFilterProcessor(IBlockItemMatcher blockItemMatcher)
|
||||||
|
{
|
||||||
|
_blockItemMatcher = blockItemMatcher;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<IFilteredItem> ProcessItemsAgainstItemFilterScript(IItemFilterScript itemFilterScript, IEnumerable<IItem> items)
|
||||||
|
{
|
||||||
|
var overallsw = Stopwatch.StartNew();
|
||||||
|
|
||||||
|
var filteredItems = new List<IFilteredItem>();
|
||||||
|
|
||||||
|
var sw = Stopwatch.StartNew();
|
||||||
|
foreach (var item in items)
|
||||||
|
{
|
||||||
|
sw.Restart();
|
||||||
|
|
||||||
|
var matchedBlock = itemFilterScript.ItemFilterBlocks
|
||||||
|
.Where(b => !(b is ItemFilterSection))
|
||||||
|
.FirstOrDefault(block => _blockItemMatcher.ItemBlockMatch(block, item));
|
||||||
|
|
||||||
|
filteredItems.Add(new FilteredItem(item, matchedBlock));
|
||||||
|
|
||||||
|
Debug.WriteLine("Processed Item in {0}ms", sw.ElapsedMilliseconds);
|
||||||
|
}
|
||||||
|
sw.Stop();
|
||||||
|
|
||||||
|
overallsw.Stop();
|
||||||
|
Debug.WriteLine("Total processing time: {0}ms", overallsw.ElapsedMilliseconds);
|
||||||
|
return filteredItems;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System.Windows.Media;
|
||||||
|
using Filtration.ObjectModel;
|
||||||
|
using Moq;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.UserControls.DesignTime
|
||||||
|
{
|
||||||
|
public class DesignTimeItemControl
|
||||||
|
{
|
||||||
|
public IFilteredItem FilteredItem
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Mock.Of<IFilteredItem>(f => f.BackgroundColor == Colors.Bisque && f.TextColor == Colors.Maroon && f.BorderColor == Colors.CornflowerBlue && f.FontSize == 15);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
39
Filtration.ItemFilterPreview/UserControls/ItemControl.xaml
Normal file
39
Filtration.ItemFilterPreview/UserControls/ItemControl.xaml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<UserControl x:Class="Filtration.ItemFilterPreview.UserControls.ItemControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:designTime="clr-namespace:Filtration.ItemFilterPreview.UserControls.DesignTime"
|
||||||
|
xmlns:converters="clr-namespace:Filtration.Common.Converters;assembly=Filtration.Common"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DataContext="{d:DesignInstance Type=designTime:DesignTimeItemControl, IsDesignTimeCreatable=True}"
|
||||||
|
d:DesignHeight="35" d:DesignWidth="170">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<Style x:Key="PathOfExileFont" TargetType="{x:Type TextBlock}">
|
||||||
|
<Setter Property="FontFamily" Value="pack://application:,,,/resources/#Fontin SmallCaps" />
|
||||||
|
</Style>
|
||||||
|
<converters:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter"/>
|
||||||
|
</UserControl.Resources>
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Border Grid.Row="1" Grid.Column="1" Margin="3" Padding="4,0,4,0" BorderThickness="1" BorderBrush="{Binding FilteredItem.BorderColor, Converter={StaticResource ColorToSolidColorBrushConverter}}">
|
||||||
|
<Border.Background>
|
||||||
|
<SolidColorBrush Color="{Binding FilteredItem.BackgroundColor}" />
|
||||||
|
</Border.Background>
|
||||||
|
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding FilteredItem.Item.Description}" Style="{StaticResource PathOfExileFont}" FontSize="{Binding FilteredItem.FontSize}">
|
||||||
|
<TextBlock.Foreground>
|
||||||
|
<SolidColorBrush Color="{Binding FilteredItem.TextColor}" />
|
||||||
|
</TextBlock.Foreground>
|
||||||
|
</TextBlock>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System.Windows;
|
||||||
|
using Filtration.ObjectModel;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.UserControls
|
||||||
|
{
|
||||||
|
public partial class ItemControl
|
||||||
|
{
|
||||||
|
public ItemControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
// ReSharper disable once PossibleNullReferenceException
|
||||||
|
(Content as FrameworkElement).DataContext = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty FilteredItemProperty = DependencyProperty.Register(
|
||||||
|
"FilteredItem",
|
||||||
|
typeof (IFilteredItem),
|
||||||
|
typeof (ItemControl),
|
||||||
|
new FrameworkPropertyMetadata()
|
||||||
|
);
|
||||||
|
|
||||||
|
public IFilteredItem FilteredItem
|
||||||
|
{
|
||||||
|
get { return (IFilteredItem)GetValue(FilteredItemProperty); }
|
||||||
|
set { SetValue(FilteredItemProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<UserControl x:Class="Filtration.ItemFilterPreview.UserControls.ItemSocketsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:Filtration.ItemFilterPreview.UserControls"
|
||||||
|
mc:Ignorable="d" SizeChanged="ItemSocketsControl_OnSizeChanged" RenderOptions.EdgeMode="Aliased" SnapsToDevicePixels="True"
|
||||||
|
Height="29" Width="17" >
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="3*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="3*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="3*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="2"/>
|
||||||
|
<RowDefinition Height="3"/>
|
||||||
|
<RowDefinition Height="2"/>
|
||||||
|
<RowDefinition Height="4"/>
|
||||||
|
<RowDefinition Height="2"/>
|
||||||
|
<RowDefinition Height="3"/>
|
||||||
|
<RowDefinition Height="2"/>
|
||||||
|
<RowDefinition Height="4"/>
|
||||||
|
<RowDefinition Height="2"/>
|
||||||
|
<RowDefinition Height="3"/>
|
||||||
|
<RowDefinition Height="2"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Border Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="3" Background="Tomato" />
|
||||||
|
|
||||||
|
<Border Grid.Row="1" Grid.Column="3" Background="White" />
|
||||||
|
|
||||||
|
<Border Grid.Row="0" Grid.RowSpan="3" Grid.Column="4" Grid.ColumnSpan="3" Background="GreenYellow" />
|
||||||
|
|
||||||
|
<Border Grid.Row="3" Grid.Column="5" Background="White" />
|
||||||
|
|
||||||
|
<Border Grid.Row="4" Grid.RowSpan="3" Grid.Column="4" Grid.ColumnSpan="3" Background="GreenYellow" />
|
||||||
|
|
||||||
|
<Border Grid.Row="5" Grid.Column="3" Background="White" />
|
||||||
|
|
||||||
|
<Border Grid.Row="4" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="3" Background="CornflowerBlue" />
|
||||||
|
|
||||||
|
<Border Grid.Row="7" Grid.Column="1" Background="White" />
|
||||||
|
|
||||||
|
<Border Grid.Row="8" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="3" Background="CornflowerBlue" />
|
||||||
|
|
||||||
|
<Border Grid.Row="9" Grid.Column="3" Background="White" />
|
||||||
|
|
||||||
|
<Border Grid.Row="8" Grid.RowSpan="3" Grid.Column="4" Grid.ColumnSpan="3" Background="Tomato" />
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.UserControls
|
||||||
|
{
|
||||||
|
public partial class ItemSocketsControl
|
||||||
|
{
|
||||||
|
public ItemSocketsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ItemSocketsControl_OnSizeChanged(object sender, SizeChangedEventArgs e)
|
||||||
|
{
|
||||||
|
const double ratio = 2d/3d;
|
||||||
|
Width = Height * ratio;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<UserControl x:Class="Filtration.ItemFilterPreview.UserControls.LootExplosionSceneUserControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:Filtration.ItemFilterPreview.UserControls"
|
||||||
|
xmlns:model="clr-namespace:Filtration.ObjectModel;assembly=Filtration.ObjectModel"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance local:LootExplosionSceneUserControl}">
|
||||||
|
<Grid Background="DimGray">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Button Grid.Row="0" Click="ButtonBase_OnClick">Test Canvas</Button>
|
||||||
|
<ItemsControl Grid.Row="1" ItemsSource="{Binding FilteredItems}" x:Name="FilteredItemsControl" Height="800">
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<Canvas />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type model:IFilteredItem}">
|
||||||
|
<local:ItemControl FilteredItem="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using Filtration.ObjectModel;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.UserControls
|
||||||
|
{
|
||||||
|
public partial class LootExplosionSceneUserControl : UserControl
|
||||||
|
{
|
||||||
|
public LootExplosionSceneUserControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty FilteredItemsProperty = DependencyProperty.Register(
|
||||||
|
"FilteredItems",
|
||||||
|
typeof(IEnumerable<IFilteredItem>),
|
||||||
|
typeof(LootExplosionSceneUserControl),
|
||||||
|
new FrameworkPropertyMetadata()
|
||||||
|
);
|
||||||
|
|
||||||
|
public IEnumerable<IFilteredItem> FilteredItems
|
||||||
|
{
|
||||||
|
get { return (IEnumerable<IFilteredItem>)GetValue(FilteredItemsProperty); }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetValue(FilteredItemsProperty, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LootCanvas_OnSourceUpdated(object sender, DataTransferEventArgs e)
|
||||||
|
{
|
||||||
|
var canvas = sender as Canvas;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var canvas = GetItemsPanel(FilteredItemsControl) as Canvas;
|
||||||
|
if (canvas == null) return;
|
||||||
|
var rand = new Random();
|
||||||
|
|
||||||
|
foreach (var child in canvas.Children.OfType<ContentPresenter>())
|
||||||
|
{
|
||||||
|
Canvas.SetLeft(child, rand.Next((int)(canvas.ActualWidth - child.ActualWidth)));
|
||||||
|
Canvas.SetTop(child, rand.Next((int)(canvas.ActualHeight - child.ActualHeight)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Panel GetItemsPanel(DependencyObject itemsControl)
|
||||||
|
{
|
||||||
|
var itemsPresenter = GetVisualChild<ItemsPresenter>(itemsControl);
|
||||||
|
var itemsPanel = VisualTreeHelper.GetChild(itemsPresenter, 0) as Panel;
|
||||||
|
return itemsPanel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static T GetVisualChild<T>(DependencyObject parent) where T : Visual
|
||||||
|
{
|
||||||
|
var child = default(T);
|
||||||
|
|
||||||
|
var numVisuals = VisualTreeHelper.GetChildrenCount(parent);
|
||||||
|
for (var i = 0; i < numVisuals; i++)
|
||||||
|
{
|
||||||
|
var v = (Visual)VisualTreeHelper.GetChild(parent, i);
|
||||||
|
child = v as T;
|
||||||
|
if (child == null)
|
||||||
|
{
|
||||||
|
child = GetVisualChild<T>(v);
|
||||||
|
}
|
||||||
|
if (child != null)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return child;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace Filtration.ItemFilterPreview.ViewModels
|
||||||
|
{
|
||||||
|
internal class LootExplosionViewModel
|
||||||
|
{
|
||||||
|
public LootExplosionViewModel()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
189
Filtration.ItemFilterPreview/ViewModels/MainWindowViewModel.cs
Normal file
189
Filtration.ItemFilterPreview/ViewModels/MainWindowViewModel.cs
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using Filtration.ItemFilterPreview.Properties;
|
||||||
|
using Filtration.ItemFilterPreview.Services;
|
||||||
|
using Filtration.ObjectModel;
|
||||||
|
using Filtration.ObjectModel.Enums;
|
||||||
|
using Filtration.Parser.Interface.Services;
|
||||||
|
using GalaSoft.MvvmLight;
|
||||||
|
using GalaSoft.MvvmLight.CommandWpf;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.ViewModels
|
||||||
|
{
|
||||||
|
internal interface IMainWindowViewModel
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class MainWindowViewModel : ViewModelBase, IMainWindowViewModel
|
||||||
|
{
|
||||||
|
private readonly IItemFilterScriptTranslator _itemFilterScriptTranslator;
|
||||||
|
private readonly IItemFilterProcessor _itemFilterProcessor;
|
||||||
|
private IItemFilterScript _itemFilterScript;
|
||||||
|
|
||||||
|
|
||||||
|
public MainWindowViewModel(IItemFilterScriptTranslator itemFilterScriptTranslator, IItemFilterProcessor itemFilterProcessor)
|
||||||
|
{
|
||||||
|
_itemFilterScriptTranslator = itemFilterScriptTranslator;
|
||||||
|
_itemFilterProcessor = itemFilterProcessor;
|
||||||
|
LoadScriptCommand = new RelayCommand(OnLoadScriptCommand);
|
||||||
|
LoadAlternateScriptCommand = new RelayCommand(OnLoadAlternateScriptCommand);
|
||||||
|
ProcessItemFilterCommand = new RelayCommand(OnProcessItemFilterCommand);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RelayCommand LoadScriptCommand { get; private set; }
|
||||||
|
public RelayCommand LoadAlternateScriptCommand { get; private set; }
|
||||||
|
public RelayCommand ProcessItemFilterCommand { get; private set; }
|
||||||
|
|
||||||
|
public IEnumerable<IFilteredItem> FilteredItems
|
||||||
|
{
|
||||||
|
get { return _filteredItems; }
|
||||||
|
private set
|
||||||
|
{
|
||||||
|
_filteredItems = value;
|
||||||
|
RaisePropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnLoadScriptCommand()
|
||||||
|
{
|
||||||
|
_itemFilterScript = _itemFilterScriptTranslator.TranslateStringToItemFilterScript(Resources.neversinkfilter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnLoadAlternateScriptCommand()
|
||||||
|
{
|
||||||
|
_itemFilterScript = _itemFilterScriptTranslator.TranslateStringToItemFilterScript(Resources.muldini);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnProcessItemFilterCommand()
|
||||||
|
{
|
||||||
|
FilteredItems = _itemFilterProcessor.ProcessItemsAgainstItemFilterScript(_itemFilterScript, TestItems);
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly List<IItem> TestItems = new List<IItem>
|
||||||
|
{
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
Description = "Full Plate",
|
||||||
|
BaseType = "Full Plate",
|
||||||
|
ItemClass = "Body Armors",
|
||||||
|
ItemRarity = ItemRarity.Normal,
|
||||||
|
ItemLevel = 66,
|
||||||
|
DropLevel = 28,
|
||||||
|
Height = 3,
|
||||||
|
Width = 2,
|
||||||
|
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> { new Socket(SocketColor.Red) , new Socket(SocketColor.Red) , new Socket(SocketColor.Red) , new Socket(SocketColor.Red) , new Socket(SocketColor.Red) , new Socket(SocketColor.Red) }, true)}
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
Description = "Scroll of Wisdom",
|
||||||
|
BaseType = "Scroll of Wisdom",
|
||||||
|
ItemClass = "Currency",
|
||||||
|
ItemRarity = ItemRarity.Normal,
|
||||||
|
ItemLevel = 75,
|
||||||
|
DropLevel = 1,
|
||||||
|
Height = 1,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup>()
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
Description = "Unset Ring",
|
||||||
|
BaseType = "Unset Ring",
|
||||||
|
ItemClass = "Rings",
|
||||||
|
ItemRarity = ItemRarity.Rare,
|
||||||
|
ItemLevel = 53,
|
||||||
|
DropLevel = 45,
|
||||||
|
Height = 1,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup>()
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
Description = "Incinerate",
|
||||||
|
BaseType = "Incinerate",
|
||||||
|
ItemClass = "Active Skill Gems",
|
||||||
|
ItemRarity = ItemRarity.Normal,
|
||||||
|
ItemLevel = 9,
|
||||||
|
DropLevel = 9,
|
||||||
|
Quality = 10,
|
||||||
|
Height = 1,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup>()
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
Description = "Mirror of Kalandra",
|
||||||
|
BaseType = "Mirror of Kalandra",
|
||||||
|
ItemClass = "Currency",
|
||||||
|
ItemRarity = ItemRarity.Normal,
|
||||||
|
ItemLevel = 77,
|
||||||
|
DropLevel = 1,
|
||||||
|
Height = 1,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup>()
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
Description = "The Gemcutter",
|
||||||
|
BaseType = "The Gemcutter",
|
||||||
|
ItemClass = "Divination Card",
|
||||||
|
ItemRarity = ItemRarity.Normal,
|
||||||
|
ItemLevel = 1,
|
||||||
|
DropLevel = 72,
|
||||||
|
Height = 1,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup>()
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
Description = "Thaumetic Sulphite",
|
||||||
|
BaseType = "Thaumetic Sulphite",
|
||||||
|
ItemClass = "Quest Items",
|
||||||
|
ItemRarity = ItemRarity.Normal,
|
||||||
|
ItemLevel = 32,
|
||||||
|
DropLevel = 1,
|
||||||
|
Height = 2,
|
||||||
|
Width = 2,
|
||||||
|
SocketGroups = new List<SocketGroup>()
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
Description = "Fishing Rod",
|
||||||
|
BaseType = "Fishing Rod",
|
||||||
|
ItemClass = "Fishing Rods",
|
||||||
|
ItemRarity = ItemRarity.Normal,
|
||||||
|
ItemLevel = 1,
|
||||||
|
DropLevel = 1,
|
||||||
|
Height = 4,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup>()
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
Description = "Dry Peninsula Map",
|
||||||
|
BaseType = "Dry Peninsula Map",
|
||||||
|
ItemClass = "Maps",
|
||||||
|
ItemRarity = ItemRarity.Magic,
|
||||||
|
ItemLevel = 75,
|
||||||
|
DropLevel = 75,
|
||||||
|
Height = 1,
|
||||||
|
Width = 1,
|
||||||
|
SocketGroups = new List<SocketGroup>()
|
||||||
|
},
|
||||||
|
new Item
|
||||||
|
{
|
||||||
|
Description = "Stone Hammer",
|
||||||
|
BaseType = "Stone Hammer",
|
||||||
|
ItemClass = "One Hand Maces",
|
||||||
|
ItemRarity = ItemRarity.Normal,
|
||||||
|
ItemLevel = 1,
|
||||||
|
DropLevel = 1,
|
||||||
|
Height = 3,
|
||||||
|
Width = 2,
|
||||||
|
SocketGroups = new List<SocketGroup>()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private IEnumerable<IFilteredItem> _filteredItems;
|
||||||
|
}
|
||||||
|
}
|
||||||
13
Filtration.ItemFilterPreview/Views/LootExplosionView.xaml
Normal file
13
Filtration.ItemFilterPreview/Views/LootExplosionView.xaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<UserControl x:Class="Filtration.ItemFilterPreview.Views.LootExplosionView"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:Filtration.ItemFilterPreview.Views"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="300" d:DesignWidth="300">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
28
Filtration.ItemFilterPreview/Views/LootExplosionView.xaml.cs
Normal file
28
Filtration.ItemFilterPreview/Views/LootExplosionView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Views
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for LootExplosionView.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class LootExplosionView : UserControl
|
||||||
|
{
|
||||||
|
public LootExplosionView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
22
Filtration.ItemFilterPreview/Views/MainWindow.xaml
Normal file
22
Filtration.ItemFilterPreview/Views/MainWindow.xaml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<Window x:Class="Filtration.ItemFilterPreview.Views.MainWindow"
|
||||||
|
x:ClassModifier="internal"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:userControls="clr-namespace:Filtration.ItemFilterPreview.UserControls"
|
||||||
|
xmlns:viewModels="clr-namespace:Filtration.ItemFilterPreview.ViewModels"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DataContext="{d:DesignInstance viewModels:MainWindowViewModel}"
|
||||||
|
Title="MainWindow" Height="960" Width="1280" >
|
||||||
|
<Grid>
|
||||||
|
<StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Button Command="{Binding LoadScriptCommand}">Load Neversink Script</Button>
|
||||||
|
<Button Command="{Binding LoadAlternateScriptCommand}">Load Muldini Script</Button>
|
||||||
|
</StackPanel>
|
||||||
|
<Button Command="{Binding ProcessItemFilterCommand}">Process Item Filter</Button>
|
||||||
|
<userControls:LootExplosionSceneUserControl FilteredItems="{Binding FilteredItems}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
18
Filtration.ItemFilterPreview/Views/MainWindow.xaml.cs
Normal file
18
Filtration.ItemFilterPreview/Views/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using Filtration.ItemFilterPreview.ViewModels;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.Views
|
||||||
|
{
|
||||||
|
public interface IMainWindow
|
||||||
|
{
|
||||||
|
void Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
internal partial class MainWindow : IMainWindow
|
||||||
|
{
|
||||||
|
public MainWindow(IMainWindowViewModel mainWindowViewModel)
|
||||||
|
{
|
||||||
|
DataContext = mainWindowViewModel;
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using Castle.MicroKernel.Registration;
|
||||||
|
using Castle.MicroKernel.SubSystems.Configuration;
|
||||||
|
using Castle.Windsor;
|
||||||
|
using Filtration.ItemFilterPreview.Services;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.WindsorInstallers
|
||||||
|
{
|
||||||
|
public class ServicesInstaller : IWindsorInstaller
|
||||||
|
{
|
||||||
|
public void Install(IWindsorContainer container, IConfigurationStore store)
|
||||||
|
{
|
||||||
|
container.Register(
|
||||||
|
Component.For<IBlockItemMatcher>()
|
||||||
|
.ImplementedBy<BlockItemMatcher>()
|
||||||
|
.LifeStyle.Singleton);
|
||||||
|
|
||||||
|
container.Register(
|
||||||
|
Component.For<IItemFilterProcessor>()
|
||||||
|
.ImplementedBy<ItemFilterProcessor>()
|
||||||
|
.LifeStyle.Singleton);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using Castle.MicroKernel.Registration;
|
||||||
|
using Castle.MicroKernel.SubSystems.Configuration;
|
||||||
|
using Castle.Windsor;
|
||||||
|
using Filtration.ItemFilterPreview.ViewModels;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.WindsorInstallers
|
||||||
|
{
|
||||||
|
public class ViewModelsInstaller : IWindsorInstaller
|
||||||
|
{
|
||||||
|
public void Install(IWindsorContainer container, IConfigurationStore store)
|
||||||
|
{
|
||||||
|
container.Register(
|
||||||
|
Component.For<IMainWindowViewModel>()
|
||||||
|
.ImplementedBy<MainWindowViewModel>()
|
||||||
|
.LifeStyle.Singleton);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using Castle.MicroKernel.Registration;
|
||||||
|
using Castle.MicroKernel.SubSystems.Configuration;
|
||||||
|
using Castle.Windsor;
|
||||||
|
using Filtration.ItemFilterPreview.Views;
|
||||||
|
|
||||||
|
namespace Filtration.ItemFilterPreview.WindsorInstallers
|
||||||
|
{
|
||||||
|
public class ViewsInstaller : IWindsorInstaller
|
||||||
|
{
|
||||||
|
public void Install(IWindsorContainer container, IConfigurationStore store)
|
||||||
|
{
|
||||||
|
container.Register(
|
||||||
|
Component.For<IMainWindow>()
|
||||||
|
.ImplementedBy<MainWindow>()
|
||||||
|
.LifeStyle.Singleton);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
Filtration.ItemFilterPreview/packages.config
Normal file
8
Filtration.ItemFilterPreview/packages.config
Normal file
@@ -0,0 +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="CommonServiceLocator" version="1.3" targetFramework="net461" />
|
||||||
|
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
||||||
|
<package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net461" />
|
||||||
|
</packages>
|
||||||
@@ -9,8 +9,9 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Filtration.ObjectModel.Tests</RootNamespace>
|
<RootNamespace>Filtration.ObjectModel.Tests</RootNamespace>
|
||||||
<AssemblyName>Filtration.ObjectModel.Tests</AssemblyName>
|
<AssemblyName>Filtration.ObjectModel.Tests</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@@ -30,11 +31,17 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Moq">
|
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Moq.4.2.1506.2016\lib\net40\Moq.dll</HintPath>
|
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="nunit.framework">
|
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
<HintPath>..\packages\Moq.4.5.21\lib\net45\Moq.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>
|
</Reference>
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
@@ -61,7 +68,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- 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.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Filtration.ObjectModel.Tests
|
|||||||
public void ToString_ReturnsFullBlockHierarchy()
|
public void ToString_ReturnsFullBlockHierarchy()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
const string ExpectedResult = "Child 1 Block Group - Child 2 Block Group";
|
const string expectedResult = "Child 1 Block Group - Child 2 Block Group";
|
||||||
|
|
||||||
var rootBlockGroup = new ItemFilterBlockGroup("Root Block Group", null);
|
var rootBlockGroup = new ItemFilterBlockGroup("Root Block Group", null);
|
||||||
var child1BlockGroup = new ItemFilterBlockGroup("Child 1 Block Group", rootBlockGroup);
|
var child1BlockGroup = new ItemFilterBlockGroup("Child 1 Block Group", rootBlockGroup);
|
||||||
@@ -19,14 +19,14 @@ namespace Filtration.ObjectModel.Tests
|
|||||||
var result = child2BlockGroup.ToString();
|
var result = child2BlockGroup.ToString();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.AreEqual(ExpectedResult, result);
|
Assert.AreEqual(expectedResult, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ToString_AddsTildeForAdvancedBlock()
|
public void ToString_AddsTildeForAdvancedBlock()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
const string ExpectedResult = "~Child 1 Block Group - Child 2 Block Group";
|
const string expectedResult = "~Child 1 Block Group - Child 2 Block Group";
|
||||||
|
|
||||||
var rootBlockGroup = new ItemFilterBlockGroup("Root Block Group", null);
|
var rootBlockGroup = new ItemFilterBlockGroup("Root Block Group", null);
|
||||||
var child1BlockGroup = new ItemFilterBlockGroup("Child 1 Block Group", rootBlockGroup, true);
|
var child1BlockGroup = new ItemFilterBlockGroup("Child 1 Block Group", rootBlockGroup, true);
|
||||||
@@ -36,7 +36,7 @@ namespace Filtration.ObjectModel.Tests
|
|||||||
var result = child2BlockGroup.ToString();
|
var result = child2BlockGroup.ToString();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.AreEqual(ExpectedResult, result);
|
Assert.AreEqual(expectedResult, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Moq" version="4.2.1506.2016" targetFramework="net451" />
|
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
|
||||||
<package id="NUnit" version="2.6.4" targetFramework="net451" />
|
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
||||||
|
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -4,9 +4,10 @@ using Filtration.ObjectModel.Extensions;
|
|||||||
|
|
||||||
namespace Filtration.ObjectModel.BlockItemBaseTypes
|
namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||||
{
|
{
|
||||||
public class ActionBlockItem : BlockItemBase
|
public sealed class ActionBlockItem : BlockItemBase
|
||||||
{
|
{
|
||||||
private BlockAction _action;
|
private BlockAction _action;
|
||||||
|
private bool _isDirty;
|
||||||
|
|
||||||
public ActionBlockItem(BlockAction action)
|
public ActionBlockItem(BlockAction action)
|
||||||
{
|
{
|
||||||
@@ -19,61 +20,39 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
_action = value;
|
_action = value;
|
||||||
|
IsDirty = true;
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
OnPropertyChanged("SummaryText");
|
OnPropertyChanged(nameof(SummaryText));
|
||||||
OnPropertyChanged("SummaryBackgroundColor");
|
OnPropertyChanged(nameof(SummaryBackgroundColor));
|
||||||
OnPropertyChanged("SummaryTextColor");
|
OnPropertyChanged(nameof(SummaryText));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string OutputText
|
public override string OutputText => Action.GetAttributeDescription();
|
||||||
{
|
|
||||||
get { return Action.GetAttributeDescription(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => string.Empty;
|
||||||
{
|
|
||||||
get { return string.Empty; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int MaximumAllowed
|
public override int MaximumAllowed => 1;
|
||||||
{
|
|
||||||
get { return 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DisplayHeading
|
public override string DisplayHeading => "Action";
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Action";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText
|
public override string SummaryText => Action == BlockAction.Show ? "Show" : "Hide";
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Action == BlockAction.Show ? "Show" : "Hide";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor
|
public override Color SummaryBackgroundColor => Action == BlockAction.Show ? Colors.LimeGreen : Colors.OrangeRed;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Action == BlockAction.Show ? Colors.LimeGreen : Colors.OrangeRed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryTextColor
|
public override Color SummaryTextColor => Action == BlockAction.Show ? Colors.Black : Colors.White;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Action == BlockAction.Show ? Colors.Black : Colors.White;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder { get { return 0; } }
|
public override int SortOrder => 0;
|
||||||
|
|
||||||
|
public override bool IsDirty
|
||||||
|
{
|
||||||
|
get { return _isDirty; }
|
||||||
|
protected set
|
||||||
|
{
|
||||||
|
_isDirty = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void ToggleAction()
|
public void ToggleAction()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
public abstract Color SummaryBackgroundColor { get; }
|
public abstract Color SummaryBackgroundColor { get; }
|
||||||
public abstract Color SummaryTextColor { get; }
|
public abstract Color SummaryTextColor { get; }
|
||||||
public abstract int SortOrder { get; }
|
public abstract int SortOrder { get; }
|
||||||
|
public abstract bool IsDirty { get; protected set; }
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||||
{
|
{
|
||||||
var handler = PropertyChanged;
|
var handler = PropertyChanged;
|
||||||
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
|
handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,20 +18,13 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
Color = color;
|
Color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string OutputText
|
public override string OutputText => PrefixText + " " + +Color.R + " " + Color.G + " "
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return PrefixText + " " + +Color.R + " " + Color.G + " "
|
|
||||||
+ Color.B + (Color.A < 255 ? " " + Color.A : string.Empty) +
|
+ Color.B + (Color.A < 255 ? " " + Color.A : string.Empty) +
|
||||||
(ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
|
(ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText
|
public override string SummaryText => string.Empty;
|
||||||
{
|
|
||||||
get { return string.Empty; }
|
public override bool IsDirty { get; protected set; }
|
||||||
}
|
|
||||||
|
|
||||||
public ThemeComponent ThemeComponent
|
public ThemeComponent ThemeComponent
|
||||||
{
|
{
|
||||||
@@ -56,8 +49,8 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor { get { return Colors.Transparent; } }
|
public override Color SummaryBackgroundColor => Colors.Transparent;
|
||||||
public override Color SummaryTextColor { get { return Colors.Transparent; } }
|
public override Color SummaryTextColor => Colors.Transparent;
|
||||||
|
|
||||||
public Color Color
|
public Color Color
|
||||||
{
|
{
|
||||||
@@ -65,6 +58,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
_color = value;
|
_color = value;
|
||||||
|
IsDirty = true;
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,14 +17,13 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
SecondValue = secondValue;
|
SecondValue = secondValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string OutputText
|
public override string OutputText => PrefixText + " " + Value + " " + SecondValue;
|
||||||
{
|
|
||||||
get { return PrefixText + " " + Value + " " + SecondValue; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText { get { return string.Empty; } }
|
public override string SummaryText => string.Empty;
|
||||||
public override Color SummaryBackgroundColor { get { return Colors.Transparent; } }
|
public override Color SummaryBackgroundColor => Colors.Transparent;
|
||||||
public override Color SummaryTextColor { get { return Colors.Transparent; } }
|
public override Color SummaryTextColor => Colors.Transparent;
|
||||||
|
|
||||||
|
public override bool IsDirty { get; protected set; }
|
||||||
|
|
||||||
public int Value
|
public int Value
|
||||||
{
|
{
|
||||||
@@ -32,6 +31,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
_value = value;
|
_value = value;
|
||||||
|
IsDirty = true;
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -42,6 +42,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
_secondValue = value;
|
_secondValue = value;
|
||||||
|
IsDirty = true;
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,24 +15,24 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
Value = value;
|
Value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string OutputText
|
public override string OutputText => PrefixText + " " + Value;
|
||||||
{
|
|
||||||
get { return PrefixText + " " + Value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText { get { return string.Empty; } }
|
public override string SummaryText => string.Empty;
|
||||||
public override Color SummaryBackgroundColor { get { return Colors.Transparent; } }
|
public override Color SummaryBackgroundColor => Colors.Transparent;
|
||||||
public override Color SummaryTextColor { get { return Colors.Transparent; } }
|
public override Color SummaryTextColor => Colors.Transparent;
|
||||||
|
|
||||||
public abstract int Minimum { get; }
|
public abstract int Minimum { get; }
|
||||||
public abstract int Maximum { get; }
|
public abstract int Maximum { get; }
|
||||||
|
|
||||||
|
public override bool IsDirty { get; protected set; }
|
||||||
|
|
||||||
public int Value
|
public int Value
|
||||||
{
|
{
|
||||||
get { return _value; }
|
get { return _value; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_value = value;
|
_value = value;
|
||||||
|
IsDirty = true;
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,18 +20,14 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
FilterPredicate.PropertyChanged += OnFilterPredicateChanged;
|
FilterPredicate.PropertyChanged += OnFilterPredicateChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string OutputText
|
public override string OutputText => PrefixText + " " + FilterPredicate.PredicateOperator.GetAttributeDescription() +
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return PrefixText + " " + FilterPredicate.PredicateOperator.GetAttributeDescription() +
|
|
||||||
" " + FilterPredicate.PredicateOperand;
|
" " + FilterPredicate.PredicateOperand;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract int Minimum { get; }
|
public abstract int Minimum { get; }
|
||||||
public abstract int Maximum { get; }
|
public abstract int Maximum { get; }
|
||||||
|
|
||||||
|
public override bool IsDirty { get; protected set; }
|
||||||
|
|
||||||
public NumericFilterPredicate FilterPredicate
|
public NumericFilterPredicate FilterPredicate
|
||||||
{
|
{
|
||||||
get { return _filterPredicate; }
|
get { return _filterPredicate; }
|
||||||
@@ -44,8 +40,9 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
|
|
||||||
private void OnFilterPredicateChanged(object sender, EventArgs e)
|
private void OnFilterPredicateChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
OnPropertyChanged("FilterPredicate");
|
IsDirty = true;
|
||||||
OnPropertyChanged("SummaryText");
|
OnPropertyChanged(nameof(FilterPredicate));
|
||||||
|
OnPropertyChanged(nameof(SummaryText));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
if (enumerable.Count > 0)
|
if (enumerable.Count > 0)
|
||||||
{
|
{
|
||||||
return PrefixText + " " +
|
return PrefixText + " " +
|
||||||
string.Format("\"{0}\"",
|
$"\"{string.Join("\" \"", enumerable.ToArray())}\"";
|
||||||
string.Join("\" \"", enumerable.ToArray()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
@@ -31,10 +30,13 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
|||||||
|
|
||||||
public ObservableCollection<string> Items { get; protected set; }
|
public ObservableCollection<string> Items { get; protected set; }
|
||||||
|
|
||||||
|
public override bool IsDirty { get; protected set; }
|
||||||
|
|
||||||
private void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
private void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
OnPropertyChanged("Items");
|
IsDirty = true;
|
||||||
OnPropertyChanged("SummaryText");
|
OnPropertyChanged(nameof(Items));
|
||||||
|
OnPropertyChanged(nameof(SummaryText));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,27 +13,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => "SetBackgroundColor";
|
||||||
{
|
public override int MaximumAllowed => 1;
|
||||||
get { return "SetBackgroundColor"; }
|
public override string DisplayHeading => "Background Color";
|
||||||
}
|
public override int SortOrder => 13;
|
||||||
|
|
||||||
public override int MaximumAllowed
|
|
||||||
{
|
|
||||||
get { return 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Background Color";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 13; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,20 +6,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
public class BaseTypeBlockItem : StringListBlockItem
|
public class BaseTypeBlockItem : StringListBlockItem
|
||||||
{
|
{
|
||||||
public override string PrefixText { get { return "BaseType"; } }
|
public override string PrefixText => "BaseType";
|
||||||
|
public override int MaximumAllowed => 1;
|
||||||
public override int MaximumAllowed
|
public override string DisplayHeading => "Base Type";
|
||||||
{
|
|
||||||
get { return 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Base Type";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText
|
public override string SummaryText
|
||||||
{
|
{
|
||||||
@@ -42,19 +31,8 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor
|
public override Color SummaryBackgroundColor => Colors.MediumTurquoise;
|
||||||
{
|
public override Color SummaryTextColor => Colors.Black;
|
||||||
get { return Colors.MediumTurquoise; }
|
public override int SortOrder => 11;
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryTextColor
|
|
||||||
{
|
|
||||||
get { return Colors.Black; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 11; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,27 +13,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => "SetBorderColor";
|
||||||
{
|
public override int MaximumAllowed => 1;
|
||||||
get { return "SetBorderColor"; }
|
public override string DisplayHeading => "Border Color";
|
||||||
}
|
public override int SortOrder => 14;
|
||||||
|
|
||||||
public override int MaximumAllowed
|
|
||||||
{
|
|
||||||
get { return 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Border Color";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 14; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,14 +6,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
public class ClassBlockItem : StringListBlockItem
|
public class ClassBlockItem : StringListBlockItem
|
||||||
{
|
{
|
||||||
public override string PrefixText { get { return "Class"; } }
|
public override string PrefixText => "Class";
|
||||||
|
public override int MaximumAllowed => 1;
|
||||||
public override int MaximumAllowed
|
public override string DisplayHeading => "Class";
|
||||||
{
|
|
||||||
get { return 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DisplayHeading { get { return "Class"; } }
|
|
||||||
|
|
||||||
public override string SummaryText
|
public override string SummaryText
|
||||||
{
|
{
|
||||||
@@ -36,19 +31,8 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor
|
public override Color SummaryBackgroundColor => Colors.MediumSeaGreen;
|
||||||
{
|
public override Color SummaryTextColor => Colors.White;
|
||||||
get { return Colors.MediumSeaGreen; }
|
public override int SortOrder => 10;
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryTextColor
|
|
||||||
{
|
|
||||||
get { return Colors.White; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 10; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,58 +15,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => "DropLevel";
|
||||||
{
|
public override int MaximumAllowed => 2;
|
||||||
get { return "DropLevel"; }
|
public override string DisplayHeading => "Drop Level";
|
||||||
}
|
public override string SummaryText => "Drop Level " + FilterPredicate;
|
||||||
|
public override Color SummaryBackgroundColor => Colors.DodgerBlue;
|
||||||
public override int MaximumAllowed
|
public override Color SummaryTextColor => Colors.White;
|
||||||
{
|
public override int SortOrder => 2;
|
||||||
get { return 2; }
|
public override int Minimum => 0;
|
||||||
}
|
public override int Maximum => 100;
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Drop Level";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText
|
|
||||||
{
|
|
||||||
get { return "Drop Level " + FilterPredicate; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor
|
|
||||||
{
|
|
||||||
get { return Colors.DodgerBlue; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryTextColor
|
|
||||||
{
|
|
||||||
get { return Colors.White; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 2; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Minimum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Maximum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,43 +13,11 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => "SetFontSize";
|
||||||
{
|
public override int MaximumAllowed => 1;
|
||||||
get { return "SetFontSize"; }
|
public override string DisplayHeading => "Font Size";
|
||||||
}
|
public override int SortOrder => 15;
|
||||||
|
public override int Minimum => 11;
|
||||||
public override int MaximumAllowed
|
public override int Maximum => 45;
|
||||||
{
|
|
||||||
get { return 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Font Size";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 15; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Minimum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 11;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Maximum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 45;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,55 +15,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => "Height";
|
||||||
{
|
public override int MaximumAllowed => 2;
|
||||||
get { return "Height"; }
|
public override string DisplayHeading => "Height";
|
||||||
}
|
public override string SummaryText => "Height " + FilterPredicate;
|
||||||
|
public override Color SummaryBackgroundColor => Colors.LightBlue;
|
||||||
public override int MaximumAllowed
|
public override Color SummaryTextColor => Colors.Black;
|
||||||
{
|
public override int SortOrder => 8;
|
||||||
get { return 2; }
|
public override int Minimum => 0;
|
||||||
}
|
public override int Maximum => 6;
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get { return "Height"; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText
|
|
||||||
{
|
|
||||||
get { return "Height " + FilterPredicate; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor
|
|
||||||
{
|
|
||||||
get { return Colors.LightBlue; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryTextColor
|
|
||||||
{
|
|
||||||
get { return Colors.Black; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 8; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Minimum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Maximum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,58 +14,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => "ItemLevel";
|
||||||
{
|
public override int MaximumAllowed => 2;
|
||||||
get { return "ItemLevel"; }
|
public override string DisplayHeading => "Item Level";
|
||||||
}
|
public override string SummaryText => "Item Level " + FilterPredicate;
|
||||||
|
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
|
||||||
public override int MaximumAllowed
|
public override Color SummaryTextColor => Colors.White;
|
||||||
{
|
public override int SortOrder => 1;
|
||||||
get { return 2; }
|
public override int Minimum => 0;
|
||||||
}
|
public override int Maximum => 100;
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Item Level";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText
|
|
||||||
{
|
|
||||||
get { return "Item Level " + FilterPredicate; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor
|
|
||||||
{
|
|
||||||
get { return Colors.DarkSlateGray; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryTextColor
|
|
||||||
{
|
|
||||||
get { return Colors.White; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Minimum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Maximum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,58 +15,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => "LinkedSockets";
|
||||||
{
|
public override int MaximumAllowed => 2;
|
||||||
get { return "LinkedSockets"; }
|
public override string DisplayHeading => "Linked Sockets";
|
||||||
}
|
public override string SummaryText => "Linked Sockets " + FilterPredicate;
|
||||||
|
public override Color SummaryBackgroundColor => Colors.Gold;
|
||||||
public override int MaximumAllowed
|
public override Color SummaryTextColor => Colors.Black;
|
||||||
{
|
public override int SortOrder => 6;
|
||||||
get { return 2; }
|
public override int Minimum => 0;
|
||||||
}
|
public override int Maximum => 6;
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Linked Sockets";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText
|
|
||||||
{
|
|
||||||
get { return "Linked Sockets " + FilterPredicate; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor
|
|
||||||
{
|
|
||||||
get { return Colors.Gold; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryTextColor
|
|
||||||
{
|
|
||||||
get { return Colors.Black; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 6; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Minimum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Maximum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,58 +15,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => "Quality";
|
||||||
{
|
public override int MaximumAllowed => 2;
|
||||||
get { return "Quality"; }
|
public override string DisplayHeading => "Quality";
|
||||||
}
|
public override string SummaryText => "Quality " + FilterPredicate;
|
||||||
|
public override Color SummaryBackgroundColor => Colors.DarkOrange;
|
||||||
public override int MaximumAllowed
|
public override Color SummaryTextColor => Colors.White;
|
||||||
{
|
public override int SortOrder => 3;
|
||||||
get { return 2; }
|
public override int Minimum => 0;
|
||||||
}
|
public override int Maximum => 20;
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Quality";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText
|
|
||||||
{
|
|
||||||
get { return "Quality " + FilterPredicate; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor
|
|
||||||
{
|
|
||||||
get { return Colors.DarkOrange; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryTextColor
|
|
||||||
{
|
|
||||||
get { return Colors.White; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 3; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Minimum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Maximum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 20;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,74 +16,22 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public RarityBlockItem(FilterPredicateOperator predicateOperator, ItemRarity predicateOperand)
|
||||||
|
: base(predicateOperator, (int)predicateOperand)
|
||||||
{
|
{
|
||||||
get { return "Rarity"; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string OutputText
|
public override string PrefixText => "Rarity";
|
||||||
{
|
public override string OutputText => PrefixText + " " + FilterPredicate.PredicateOperator
|
||||||
get
|
.GetAttributeDescription() + " " + ((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
|
||||||
{
|
public override int MaximumAllowed => 2;
|
||||||
return PrefixText + " " + FilterPredicate.PredicateOperator
|
public override string DisplayHeading => "Item Rarity";
|
||||||
.GetAttributeDescription() +
|
public override string SummaryText => "Rarity " + FilterPredicate.PredicateOperator.GetAttributeDescription() + " " +
|
||||||
" " +
|
|
||||||
((ItemRarity) FilterPredicate.PredicateOperand)
|
|
||||||
.GetAttributeDescription();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int MaximumAllowed
|
|
||||||
{
|
|
||||||
get { return 2; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Item Rarity";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Rarity " + FilterPredicate.PredicateOperator.GetAttributeDescription() + " " +
|
|
||||||
((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
|
((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
|
||||||
}
|
public override Color SummaryBackgroundColor => Colors.LightCoral;
|
||||||
}
|
public override Color SummaryTextColor => Colors.White;
|
||||||
|
public override int SortOrder => 4;
|
||||||
public override Color SummaryBackgroundColor
|
public override int Minimum => 0;
|
||||||
{
|
public override int Maximum => (int)ItemRarity.Unique;
|
||||||
get { return Colors.LightCoral; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryTextColor
|
|
||||||
{
|
|
||||||
get { return Colors.White; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 4; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Minimum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Maximum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return (int)ItemRarity.Unique;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +1,22 @@
|
|||||||
using System.Linq;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||||
|
using Filtration.ObjectModel.Enums;
|
||||||
|
|
||||||
namespace Filtration.ObjectModel.BlockItemTypes
|
namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
{
|
{
|
||||||
public class SocketGroupBlockItem : StringListBlockItem
|
public class SocketGroupBlockItem : StringListBlockItem
|
||||||
{
|
{
|
||||||
public override string PrefixText
|
public SocketGroupBlockItem()
|
||||||
{
|
{
|
||||||
get { return "SocketGroup"; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int MaximumAllowed
|
|
||||||
{
|
|
||||||
get { return 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Socket Group";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string PrefixText => "SocketGroup";
|
||||||
|
public override int MaximumAllowed => 1;
|
||||||
|
public override string DisplayHeading => "Socket Group";
|
||||||
public override string SummaryText
|
public override string SummaryText
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -33,19 +26,46 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor
|
public IEnumerable<SocketGroup> SocketGroups
|
||||||
{
|
{
|
||||||
get { return Colors.GhostWhite; }
|
get
|
||||||
|
{
|
||||||
|
return
|
||||||
|
Items.Select(socketGroup => socketGroup.Select(socketChar => new Socket(StringToSocketColor(socketChar))).ToList())
|
||||||
|
.Select(socketList => new SocketGroup(socketList, true))
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Color SummaryTextColor
|
public override Color SummaryBackgroundColor => Colors.GhostWhite;
|
||||||
{
|
public override Color SummaryTextColor => Colors.Black;
|
||||||
get { return Colors.Black; }
|
public override int SortOrder => 9;
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
private SocketColor StringToSocketColor(char socketColorString)
|
||||||
{
|
{
|
||||||
get { return 9; }
|
switch (socketColorString)
|
||||||
|
{
|
||||||
|
case 'R':
|
||||||
|
{
|
||||||
|
return SocketColor.Red;
|
||||||
|
}
|
||||||
|
case 'G':
|
||||||
|
{
|
||||||
|
return SocketColor.Green;
|
||||||
|
}
|
||||||
|
case 'B':
|
||||||
|
{
|
||||||
|
return SocketColor.Blue;
|
||||||
|
}
|
||||||
|
case 'W':
|
||||||
|
{
|
||||||
|
return SocketColor.White;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Invalid socket color");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,58 +15,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => "Sockets";
|
||||||
{
|
public override int MaximumAllowed => 2;
|
||||||
get { return "Sockets"; }
|
public override string DisplayHeading => "Sockets";
|
||||||
}
|
public override string SummaryText => "Sockets " + FilterPredicate;
|
||||||
|
public override Color SummaryBackgroundColor => Colors.LightGray;
|
||||||
public override int MaximumAllowed
|
public override Color SummaryTextColor => Colors.Black;
|
||||||
{
|
public override int SortOrder => 5;
|
||||||
get { return 2; }
|
public override int Minimum => 0;
|
||||||
}
|
public override int Maximum => 6;
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Sockets";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText
|
|
||||||
{
|
|
||||||
get { return "Sockets " + FilterPredicate; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor
|
|
||||||
{
|
|
||||||
get { return Colors.LightGray; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryTextColor
|
|
||||||
{
|
|
||||||
get { return Colors.Black; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 5; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Minimum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Maximum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,27 +14,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => "PlayAlertSound";
|
||||||
{
|
public override int MaximumAllowed => 1;
|
||||||
get { return "PlayAlertSound"; }
|
public override string DisplayHeading => "Play Alert Sound";
|
||||||
}
|
public override int SortOrder => 16;
|
||||||
|
|
||||||
public override int MaximumAllowed
|
|
||||||
{
|
|
||||||
get { return 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Play Alert Sound";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 16; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,27 +13,9 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => "SetTextColor";
|
||||||
{
|
public override int MaximumAllowed => 1;
|
||||||
get { return "SetTextColor"; }
|
public override string DisplayHeading => "Text Color";
|
||||||
}
|
public override int SortOrder => 12;
|
||||||
|
|
||||||
public override int MaximumAllowed
|
|
||||||
{
|
|
||||||
get { return 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Text Color";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 12; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,58 +15,14 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string PrefixText
|
public override string PrefixText => "Width";
|
||||||
{
|
public override int MaximumAllowed => 2;
|
||||||
get { return "Width"; }
|
public override string DisplayHeading => "Width";
|
||||||
}
|
public override string SummaryText => "Width " + FilterPredicate;
|
||||||
|
public override Color SummaryBackgroundColor => Colors.MediumPurple;
|
||||||
public override int MaximumAllowed
|
public override Color SummaryTextColor => Colors.White;
|
||||||
{
|
public override int SortOrder => 7;
|
||||||
get { return 2; }
|
public override int Minimum => 0;
|
||||||
}
|
public override int Maximum => 2;
|
||||||
|
|
||||||
public override string DisplayHeading
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "Width";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SummaryText
|
|
||||||
{
|
|
||||||
get { return "Width " + FilterPredicate; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor
|
|
||||||
{
|
|
||||||
get { return Colors.MediumPurple; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Color SummaryTextColor
|
|
||||||
{
|
|
||||||
get { return Colors.White; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int SortOrder
|
|
||||||
{
|
|
||||||
get { return 7; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Minimum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Maximum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ namespace Filtration.ObjectModel.Enums
|
|||||||
{
|
{
|
||||||
[Description("=")]
|
[Description("=")]
|
||||||
Equal,
|
Equal,
|
||||||
[Description("!=")]
|
|
||||||
NotEqual,
|
|
||||||
[Description("<")]
|
[Description("<")]
|
||||||
LessThan,
|
LessThan,
|
||||||
[Description("<=")]
|
[Description("<=")]
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ namespace Filtration.ObjectModel.Enums
|
|||||||
{
|
{
|
||||||
public enum ItemRarity
|
public enum ItemRarity
|
||||||
{
|
{
|
||||||
|
[Description("Not Set")]
|
||||||
|
NotSet,
|
||||||
[Description("Normal")]
|
[Description("Normal")]
|
||||||
Normal,
|
Normal,
|
||||||
[Description("Magic")]
|
[Description("Magic")]
|
||||||
|
|||||||
36
Filtration.ObjectModel/Enums/PathOfExileNamedColor.cs
Normal file
36
Filtration.ObjectModel/Enums/PathOfExileNamedColor.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
namespace Filtration.ObjectModel.Enums
|
||||||
|
{
|
||||||
|
public enum PathOfExileNamedColor
|
||||||
|
{
|
||||||
|
Default,
|
||||||
|
ValueDefault,
|
||||||
|
Pink,
|
||||||
|
DodgerBlue,
|
||||||
|
Fire,
|
||||||
|
Cold,
|
||||||
|
Lightning,
|
||||||
|
Chaos,
|
||||||
|
Augmented,
|
||||||
|
Crafted,
|
||||||
|
Unmet,
|
||||||
|
UniqueItem,
|
||||||
|
RareItem,
|
||||||
|
MagicItem,
|
||||||
|
WhiteItem,
|
||||||
|
GemItem,
|
||||||
|
CurrencyItem,
|
||||||
|
QuestItem,
|
||||||
|
NemesisMod,
|
||||||
|
NemesisModOutline,
|
||||||
|
Title,
|
||||||
|
Corrupted,
|
||||||
|
Favour,
|
||||||
|
SupporterPackNewItem,
|
||||||
|
SupporterPackItem,
|
||||||
|
BloodlineMod,
|
||||||
|
BloodlineModOutline,
|
||||||
|
TormentMod,
|
||||||
|
TormentModOutline,
|
||||||
|
CantTradeorModify
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
using System.ComponentModel;
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace Filtration.ObjectModel.Enums
|
namespace Filtration.ObjectModel.Enums
|
||||||
{
|
{
|
||||||
|
[Serializable]
|
||||||
public enum SocketColor
|
public enum SocketColor
|
||||||
{
|
{
|
||||||
|
Yellow,
|
||||||
[Description("R")]
|
[Description("R")]
|
||||||
Red,
|
Red,
|
||||||
[Description("G")]
|
[Description("G")]
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace Filtration.ObjectModel.Extensions
|
|||||||
var type = enumVal.GetType();
|
var type = enumVal.GetType();
|
||||||
var memInfo = type.GetMember(enumVal.ToString());
|
var memInfo = type.GetMember(enumVal.ToString());
|
||||||
var attributes = memInfo[0].GetCustomAttributes(typeof(T), false);
|
var attributes = memInfo[0].GetCustomAttributes(typeof(T), false);
|
||||||
return (attributes.Length > 0) ? (T)attributes[0] : null;
|
return attributes.Length > 0 ? (T)attributes[0] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetAttributeDescription(this Enum enumValue)
|
public static string GetAttributeDescription(this Enum enumValue)
|
||||||
|
|||||||
39
Filtration.ObjectModel/Extensions/ItemRarityExtensions.cs
Normal file
39
Filtration.ObjectModel/Extensions/ItemRarityExtensions.cs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using Filtration.ObjectModel.Enums;
|
||||||
|
|
||||||
|
namespace Filtration.ObjectModel.Extensions
|
||||||
|
{
|
||||||
|
public static class ItemRarityExtensions
|
||||||
|
{
|
||||||
|
public static Color DefaultRarityTextColor(this ItemRarity itemRarity)
|
||||||
|
{
|
||||||
|
switch (itemRarity)
|
||||||
|
{
|
||||||
|
case ItemRarity.Magic:
|
||||||
|
{
|
||||||
|
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.MagicItem];
|
||||||
|
}
|
||||||
|
case ItemRarity.Normal:
|
||||||
|
{
|
||||||
|
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.WhiteItem];
|
||||||
|
}
|
||||||
|
case ItemRarity.Rare:
|
||||||
|
{
|
||||||
|
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.RareItem];
|
||||||
|
}
|
||||||
|
case ItemRarity.Unique:
|
||||||
|
{
|
||||||
|
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.UniqueItem];
|
||||||
|
}
|
||||||
|
case ItemRarity.NotSet:
|
||||||
|
{
|
||||||
|
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.QuestItem];
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(itemRarity), itemRarity, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user