Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7a40c8c6d | ||
|
|
dde9f65ea6 | ||
|
|
ae6e8c5211 | ||
|
|
67685d9eac | ||
|
|
af08cdfed6 | ||
|
|
0b791f5747 | ||
|
|
43bc1410ae | ||
|
|
b3520246b9 | ||
|
|
6d1c51361b | ||
|
|
360b1c8144 | ||
|
|
80b8318574 | ||
|
|
85f47ce654 | ||
|
|
c88c401ca8 | ||
|
|
45ab1a57e3 |
@@ -46,12 +46,12 @@
|
|||||||
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FluentAssertions, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
<Reference Include="FluentAssertions, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.dll</HintPath>
|
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FluentAssertions.Core, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
<Reference Include="FluentAssertions.Core, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.Core.dll</HintPath>
|
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ namespace Filtration.ItemFilterPreview.Tests.Services
|
|||||||
{
|
{
|
||||||
class serializationtest
|
class serializationtest
|
||||||
{
|
{
|
||||||
|
[Ignore("")]
|
||||||
[Test]
|
[Test]
|
||||||
public void test_serialization()
|
public void test_serialization()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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.3" targetFramework="net461" />
|
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
|
||||||
<package id="FluentAssertions" version="4.13.0" targetFramework="net461" />
|
<package id="FluentAssertions" version="4.13.1" targetFramework="net461" />
|
||||||
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
||||||
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
||||||
<package id="YamlDotNet" version="3.9.0" targetFramework="net461" />
|
<package id="YamlDotNet" version="3.9.0" targetFramework="net461" />
|
||||||
|
|||||||
@@ -15,7 +15,12 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
|||||||
: base(predicateOperator, predicateOperand)
|
: base(predicateOperator, predicateOperand)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RarityBlockItem(FilterPredicateOperator predicateOperator, ItemRarity predicateOperand)
|
||||||
|
: base(predicateOperator, (int)predicateOperand)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public override string PrefixText => "Rarity";
|
public override string PrefixText => "Rarity";
|
||||||
public override string OutputText => PrefixText + " " + FilterPredicate.PredicateOperator
|
public override string OutputText => PrefixText + " " + FilterPredicate.PredicateOperator
|
||||||
.GetAttributeDescription() + " " + ((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
|
.GetAttributeDescription() + " " + ((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ namespace Filtration.Parser.Interface.Services
|
|||||||
IItemFilterBlock TranslateStringToItemFilterBlock(string inputString,
|
IItemFilterBlock TranslateStringToItemFilterBlock(string inputString,
|
||||||
ThemeComponentCollection masterComponentCollection);
|
ThemeComponentCollection masterComponentCollection);
|
||||||
string TranslateItemFilterBlockToString(IItemFilterBlock block);
|
string TranslateItemFilterBlockToString(IItemFilterBlock block);
|
||||||
void ReplaceColorBlockItemsFromString(ObservableCollection<IItemFilterBlockItem> blockItems, string inputString);
|
void ReplaceAudioVisualBlockItemsFromString(ObservableCollection<IItemFilterBlockItem> blockItems, string inputString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,12 +40,12 @@
|
|||||||
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FluentAssertions, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
<Reference Include="FluentAssertions, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.dll</HintPath>
|
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FluentAssertions.Core, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
<Reference Include="FluentAssertions.Core, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.Core.dll</HintPath>
|
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||||
|
|||||||
@@ -1472,7 +1472,7 @@ namespace Filtration.Parser.Tests.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ReplaceColorBlockItemsFromString_SingleLine_ReplacesColorBlock()
|
public void ReplaceAudioVisualBlockItemsFromString_SingleLine_ReplacesColorBlock()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var testInputString = "SetTextColor 240 200 150 # Rarest Currency";
|
var testInputString = "SetTextColor 240 200 150 # Rarest Currency";
|
||||||
@@ -1482,7 +1482,7 @@ namespace Filtration.Parser.Tests.Services
|
|||||||
testInputBlockItems.Add(testInputBlockItem);
|
testInputBlockItems.Add(testInputBlockItem);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
|
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
|
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
|
||||||
@@ -1492,7 +1492,28 @@ namespace Filtration.Parser.Tests.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ReplaceColorBlockItemsFromString_SingleLine_ReplacesColorBlockBugTest()
|
public void ReplaceAudioVisualBlockItemsFromString_SingleLine_ReplacesSoundBlockItem()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var testInputString = "PlayAlertSound 7 280";
|
||||||
|
|
||||||
|
var testInputBlockItems = new ObservableCollection<IItemFilterBlockItem>();
|
||||||
|
var testInputBlockItem = new SoundBlockItem(12,30);
|
||||||
|
testInputBlockItems.Add(testInputBlockItem);
|
||||||
|
|
||||||
|
// Act
|
||||||
|
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
var soundBlockItem = testInputBlockItems.First(b => b is SoundBlockItem) as SoundBlockItem;
|
||||||
|
Assert.IsNotNull(soundBlockItem);
|
||||||
|
Assert.AreNotSame(testInputBlockItem, soundBlockItem);
|
||||||
|
Assert.AreEqual(7, soundBlockItem.Value);
|
||||||
|
Assert.AreEqual(280, soundBlockItem.SecondValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ReplaceAudioVisualBlockItemsFromString_SingleLine_ReplacesColorBlockBugTest()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var testInputString = "SetBackgroundColor 70 0 0 255";
|
var testInputString = "SetBackgroundColor 70 0 0 255";
|
||||||
@@ -1502,7 +1523,7 @@ namespace Filtration.Parser.Tests.Services
|
|||||||
testInputBlockItems.Add(testInputBlockItem);
|
testInputBlockItems.Add(testInputBlockItem);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
|
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
var backgroundColorBlockItem = testInputBlockItems.First(b => b is BackgroundColorBlockItem) as BackgroundColorBlockItem;
|
var backgroundColorBlockItem = testInputBlockItems.First(b => b is BackgroundColorBlockItem) as BackgroundColorBlockItem;
|
||||||
@@ -1513,7 +1534,7 @@ namespace Filtration.Parser.Tests.Services
|
|||||||
|
|
||||||
[Ignore("Not currently possible - will not be necessary once commanding (to enable undo history) is implemented anyway")]
|
[Ignore("Not currently possible - will not be necessary once commanding (to enable undo history) is implemented anyway")]
|
||||||
[Test]
|
[Test]
|
||||||
public void ReplaceColorBlockItemsFromString_MalformedLine_DoesNothing()
|
public void ReplaceAudioVisualBlockItemsFromString_MalformedLine_DoesNothing()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var testInputString = "SetTextCsaolor 240 200 150 # Rarest Currency";
|
var testInputString = "SetTextCsaolor 240 200 150 # Rarest Currency";
|
||||||
@@ -1523,7 +1544,7 @@ namespace Filtration.Parser.Tests.Services
|
|||||||
testInputBlockItems.Add(testInputBlockItem);
|
testInputBlockItems.Add(testInputBlockItem);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
|
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
|
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
|
||||||
@@ -1532,23 +1553,27 @@ namespace Filtration.Parser.Tests.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ReplaceColorBlockItemsFromString_MultipleLines_ExistingBlockItems()
|
public void ReplaceAudioVisualBlockItemsFromString_MultipleLines_ExistingBlockItems()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var testInputString = "SetTextColor 240 200 150 # Rarest Currency" + Environment.NewLine +
|
var testInputString = "SetTextColor 240 200 150 # Rarest Currency" + Environment.NewLine +
|
||||||
"SetBackgroundColor 0 0 0 # Rarest Currency Background" + Environment.NewLine +
|
"SetBackgroundColor 0 0 0 # Rarest Currency Background" + Environment.NewLine +
|
||||||
"SetBorderColor 255 255 255 # Rarest Currency Border";
|
"SetBorderColor 255 255 255 # Rarest Currency Border" + Environment.NewLine +
|
||||||
|
"PlayAlertSound 7 280";
|
||||||
|
|
||||||
var testInputBlockItems = new ObservableCollection<IItemFilterBlockItem>();
|
var testInputBlockItems = new ObservableCollection<IItemFilterBlockItem>();
|
||||||
var testInputTextColorBlockItem = new TextColorBlockItem(Colors.Red);
|
var testInputTextColorBlockItem = new TextColorBlockItem(Colors.Red);
|
||||||
var testInputBackgroundColorBlockItem = new BackgroundColorBlockItem(Colors.Blue);
|
var testInputBackgroundColorBlockItem = new BackgroundColorBlockItem(Colors.Blue);
|
||||||
var testInpuBorderColorBlockItem = new BorderColorBlockItem(Colors.Yellow);
|
var testInputBorderColorBlockItem = new BorderColorBlockItem(Colors.Yellow);
|
||||||
|
var testInputSoundBlockItem = new SoundBlockItem(1, 1);
|
||||||
|
|
||||||
testInputBlockItems.Add(testInputTextColorBlockItem);
|
testInputBlockItems.Add(testInputTextColorBlockItem);
|
||||||
testInputBlockItems.Add(testInputBackgroundColorBlockItem);
|
testInputBlockItems.Add(testInputBackgroundColorBlockItem);
|
||||||
testInputBlockItems.Add(testInpuBorderColorBlockItem);
|
testInputBlockItems.Add(testInputBorderColorBlockItem);
|
||||||
|
testInputBlockItems.Add(testInputSoundBlockItem);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
|
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
|
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
|
||||||
@@ -1563,23 +1588,29 @@ namespace Filtration.Parser.Tests.Services
|
|||||||
|
|
||||||
var borderColorBlockItem = testInputBlockItems.First(b => b is BorderColorBlockItem) as BorderColorBlockItem;
|
var borderColorBlockItem = testInputBlockItems.First(b => b is BorderColorBlockItem) as BorderColorBlockItem;
|
||||||
Assert.IsNotNull(borderColorBlockItem);
|
Assert.IsNotNull(borderColorBlockItem);
|
||||||
Assert.AreNotSame(testInpuBorderColorBlockItem, borderColorBlockItem);
|
Assert.AreNotSame(testInputBorderColorBlockItem, borderColorBlockItem);
|
||||||
Assert.AreEqual(new Color { A = 255, R = 255, G = 255, B = 255 }, borderColorBlockItem.Color);
|
Assert.AreEqual(new Color { A = 255, R = 255, G = 255, B = 255 }, borderColorBlockItem.Color);
|
||||||
|
|
||||||
|
var soundBlockItem = testInputBlockItems.First(b => b is SoundBlockItem) as SoundBlockItem;
|
||||||
|
Assert.IsNotNull(soundBlockItem);
|
||||||
|
Assert.AreNotSame(testInputSoundBlockItem, soundBlockItem);
|
||||||
|
Assert.AreEqual(7, soundBlockItem.Value);
|
||||||
|
Assert.AreEqual(280, soundBlockItem.SecondValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ReplaceColorBlockItemsFromString_MultipleLines_NoExistingBlockItems()
|
public void ReplaceAudioVisualBlockItemsFromString_MultipleLines_NoExistingBlockItems()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var testInputString = "SetTextColor 240 200 150 # Rarest Currency" + Environment.NewLine +
|
var testInputString = "SetTextColor 240 200 150 # Rarest Currency" + Environment.NewLine +
|
||||||
"SetBackgroundColor 0 0 0 # Rarest Currency Background" + Environment.NewLine +
|
"SetBackgroundColor 0 0 0 # Rarest Currency Background" + Environment.NewLine +
|
||||||
"SetBorderColor 255 255 255 # Rarest Currency Border";
|
"SetBorderColor 255 255 255 # Rarest Currency Border" + Environment.NewLine +
|
||||||
|
"PlayAlertSound 7 280";
|
||||||
|
|
||||||
var testInputBlockItems = new ObservableCollection<IItemFilterBlockItem>();
|
var testInputBlockItems = new ObservableCollection<IItemFilterBlockItem>();
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
|
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
|
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
|
||||||
@@ -1593,10 +1624,15 @@ namespace Filtration.Parser.Tests.Services
|
|||||||
var borderColorBlockItem = testInputBlockItems.First(b => b is BorderColorBlockItem) as BorderColorBlockItem;
|
var borderColorBlockItem = testInputBlockItems.First(b => b is BorderColorBlockItem) as BorderColorBlockItem;
|
||||||
Assert.IsNotNull(borderColorBlockItem);
|
Assert.IsNotNull(borderColorBlockItem);
|
||||||
Assert.AreEqual(new Color { A = 255, R = 255, G = 255, B = 255 }, borderColorBlockItem.Color);
|
Assert.AreEqual(new Color { A = 255, R = 255, G = 255, B = 255 }, borderColorBlockItem.Color);
|
||||||
|
|
||||||
|
var soundBlockItem = testInputBlockItems.First(b => b is SoundBlockItem) as SoundBlockItem;
|
||||||
|
Assert.IsNotNull(soundBlockItem);
|
||||||
|
Assert.AreEqual(7, soundBlockItem.Value);
|
||||||
|
Assert.AreEqual(280, soundBlockItem.SecondValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ReplaceColorBlockItemsFromString_MultipleLines_SomeExistingBlockItems()
|
public void ReplaceAudioVisualBlockItemsFromString_MultipleLines_SomeExistingBlockItems()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var testInputString = "SetTextColor 240 200 150 # Rarest Currency" + Environment.NewLine +
|
var testInputString = "SetTextColor 240 200 150 # Rarest Currency" + Environment.NewLine +
|
||||||
@@ -1611,7 +1647,7 @@ namespace Filtration.Parser.Tests.Services
|
|||||||
testInputBlockItems.Add(testInpuBorderColorBlockItem);
|
testInputBlockItems.Add(testInpuBorderColorBlockItem);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
|
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
|
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
|
||||||
@@ -1627,7 +1663,7 @@ namespace Filtration.Parser.Tests.Services
|
|||||||
|
|
||||||
[Ignore("ThemeComponentBuilder deprecated")]
|
[Ignore("ThemeComponentBuilder deprecated")]
|
||||||
[Test]
|
[Test]
|
||||||
public void ReplaceColorBlockItemsFromString_ThemeComponentBuilderNotInitialised_DoesNotCallAddComponent()
|
public void ReplaceAudioVisualBlockItemsFromString_ThemeComponentBuilderNotInitialised_DoesNotCallAddComponent()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var testInputString = "SetTextColor 240 200 150 # Rarest Currency";
|
var testInputString = "SetTextColor 240 200 150 # Rarest Currency";
|
||||||
@@ -1637,7 +1673,7 @@ namespace Filtration.Parser.Tests.Services
|
|||||||
testInputBlockItems.Add(testInputBlockItem);
|
testInputBlockItems.Add(testInputBlockItem);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
|
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
|
|
||||||
|
|||||||
@@ -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.3" targetFramework="net461" />
|
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
|
||||||
<package id="FluentAssertions" version="4.13.0" targetFramework="net461" />
|
<package id="FluentAssertions" version="4.13.1" targetFramework="net461" />
|
||||||
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
||||||
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -318,7 +318,7 @@ namespace Filtration.Parser.Services
|
|||||||
return blockItem;
|
return blockItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReplaceColorBlockItemsFromString(ObservableCollection<IItemFilterBlockItem> blockItems, string inputString)
|
public void ReplaceAudioVisualBlockItemsFromString(ObservableCollection<IItemFilterBlockItem> blockItems, string inputString)
|
||||||
{
|
{
|
||||||
// Reverse iterate to remove existing IAudioVisualBlockItems
|
// Reverse iterate to remove existing IAudioVisualBlockItems
|
||||||
for (var idx = blockItems.Count - 1; idx >= 0; idx--)
|
for (var idx = blockItems.Count - 1; idx >= 0; idx--)
|
||||||
@@ -335,6 +335,13 @@ namespace Filtration.Parser.Services
|
|||||||
|
|
||||||
switch (matches.Value)
|
switch (matches.Value)
|
||||||
{
|
{
|
||||||
|
case "PlayAlertSound":
|
||||||
|
{
|
||||||
|
var match = Regex.Match(line, @"\s+(\d+) (\d+)");
|
||||||
|
if (!match.Success) break;
|
||||||
|
blockItems.Add(new SoundBlockItem(Convert.ToInt16(match.Groups[1].Value), Convert.ToInt16(match.Groups[2].Value)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "SetTextColor":
|
case "SetTextColor":
|
||||||
{
|
{
|
||||||
blockItems.Add(GetColorBlockItemFromString<TextColorBlockItem>(line));
|
blockItems.Add(GetColorBlockItemFromString<TextColorBlockItem>(line));
|
||||||
|
|||||||
@@ -35,12 +35,12 @@
|
|||||||
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FluentAssertions, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
<Reference Include="FluentAssertions, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.dll</HintPath>
|
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FluentAssertions.Core, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
<Reference Include="FluentAssertions.Core, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.Core.dll</HintPath>
|
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||||
|
|||||||
@@ -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.3" targetFramework="net461" />
|
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
|
||||||
<package id="FluentAssertions" version="4.13.0" targetFramework="net461" />
|
<package id="FluentAssertions" version="4.13.1" targetFramework="net461" />
|
||||||
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
<package id="Moq" version="4.5.21" targetFramework="net461" />
|
||||||
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
<package id="NUnit" version="3.4.1" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
BIN
Filtration.db
BIN
Filtration.db
Binary file not shown.
@@ -1,18 +1,16 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using Castle.Facilities.TypedFactory;
|
using Castle.Facilities.TypedFactory;
|
||||||
using Castle.MicroKernel.ModelBuilder.Inspectors;
|
using Castle.MicroKernel.ModelBuilder.Inspectors;
|
||||||
using Castle.MicroKernel.Registration;
|
|
||||||
using Castle.Windsor;
|
using Castle.Windsor;
|
||||||
using Castle.Windsor.Installer;
|
using Castle.Windsor.Installer;
|
||||||
using Filtration.ObjectModel;
|
using Filtration.ObjectModel;
|
||||||
using Filtration.ObjectModel.ThemeEditor;
|
using Filtration.ObjectModel.ThemeEditor;
|
||||||
using Filtration.Properties;
|
using Filtration.Properties;
|
||||||
|
using Filtration.Services;
|
||||||
using Filtration.ThemeEditor.ViewModels;
|
using Filtration.ThemeEditor.ViewModels;
|
||||||
using Filtration.ViewModels;
|
using Filtration.ViewModels;
|
||||||
using Filtration.Views;
|
using Filtration.Views;
|
||||||
@@ -71,8 +69,11 @@ namespace Filtration
|
|||||||
|
|
||||||
var mainWindow = _container.Resolve<IMainWindow>();
|
var mainWindow = _container.Resolve<IMainWindow>();
|
||||||
mainWindow.Show();
|
mainWindow.Show();
|
||||||
}
|
|
||||||
|
|
||||||
|
var updateCheckService = _container.Resolve<IUpdateCheckService>();
|
||||||
|
updateCheckService.CheckForUpdates();
|
||||||
|
}
|
||||||
|
|
||||||
private static void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
private static void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
Logger.Fatal(e.Exception);
|
Logger.Fatal(e.Exception);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ using System.Windows;
|
|||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("XVar Industries Inc.")]
|
[assembly: AssemblyCompany("XVar Industries Inc.")]
|
||||||
[assembly: AssemblyProduct("Filtration")]
|
[assembly: AssemblyProduct("Filtration")]
|
||||||
[assembly: AssemblyCopyright("Copyright © Ben Wallis 2015")]
|
[assembly: AssemblyCopyright("Copyright © Ben Wallis 2016")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ using System.Windows;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.12")]
|
[assembly: AssemblyVersion("0.14")]
|
||||||
|
|
||||||
[assembly: InternalsVisibleTo("Filtration.Tests")]
|
[assembly: InternalsVisibleTo("Filtration.Tests")]
|
||||||
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]
|
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]
|
||||||
|
|||||||
@@ -34,10 +34,28 @@ namespace Filtration.Services
|
|||||||
var itemBaseTypesPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Filtration\ItemBaseTypes.txt";
|
var itemBaseTypesPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Filtration\ItemBaseTypes.txt";
|
||||||
var itemClassesPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Filtration\ItemClasses.txt";
|
var itemClassesPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Filtration\ItemClasses.txt";
|
||||||
|
|
||||||
var itemBaseTypes = _fileSystemService.ReadFileAsString(itemBaseTypesPath);
|
string itemBaseTypes;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
itemBaseTypes = _fileSystemService.ReadFileAsString(itemBaseTypesPath);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
itemBaseTypes = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
ItemBaseTypes = new LineReader(() => new StringReader(itemBaseTypes)).ToList();
|
ItemBaseTypes = new LineReader(() => new StringReader(itemBaseTypes)).ToList();
|
||||||
|
|
||||||
var itemClasses = _fileSystemService.ReadFileAsString(itemClassesPath);
|
string itemClasses;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
itemClasses = _fileSystemService.ReadFileAsString(itemClassesPath);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
itemClasses = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
ItemClasses = new LineReader(() => new StringReader(itemClasses)).ToList();
|
ItemClasses = new LineReader(() => new StringReader(itemClasses)).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,15 @@ using System.Windows;
|
|||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using Filtration.Models;
|
using Filtration.Models;
|
||||||
using Filtration.Properties;
|
using Filtration.Properties;
|
||||||
|
using Filtration.ViewModels;
|
||||||
|
using Filtration.Views;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
|
||||||
namespace Filtration.Services
|
namespace Filtration.Services
|
||||||
{
|
{
|
||||||
internal interface IUpdateCheckService
|
internal interface IUpdateCheckService
|
||||||
{
|
{
|
||||||
UpdateData CheckForUpdates();
|
void CheckForUpdates();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class UpdateCheckService : IUpdateCheckService
|
internal class UpdateCheckService : IUpdateCheckService
|
||||||
@@ -20,13 +22,16 @@ namespace Filtration.Services
|
|||||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
private readonly IHTTPService _httpService;
|
private readonly IHTTPService _httpService;
|
||||||
|
private readonly IUpdateAvailableViewModel _updateAvailableViewModel;
|
||||||
public UpdateCheckService(IHTTPService httpService)
|
|
||||||
|
public UpdateCheckService(IHTTPService httpService,
|
||||||
|
IUpdateAvailableViewModel updateAvailableViewModel)
|
||||||
{
|
{
|
||||||
_httpService = httpService;
|
_httpService = httpService;
|
||||||
|
_updateAvailableViewModel = updateAvailableViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UpdateData CheckForUpdates()
|
public void CheckForUpdates()
|
||||||
{
|
{
|
||||||
var assemblyVersion = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
|
var assemblyVersion = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
|
||||||
|
|
||||||
@@ -45,7 +50,6 @@ namespace Filtration.Services
|
|||||||
Settings.Default.Save();
|
Settings.Default.Save();
|
||||||
|
|
||||||
updateData.UpdateAvailable = true;
|
updateData.UpdateAvailable = true;
|
||||||
return updateData;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,9 +76,14 @@ namespace Filtration.Services
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateData.UpdateAvailable = false;
|
if (updateData.UpdateAvailable)
|
||||||
return updateData;
|
{
|
||||||
|
var updateAvailableView = new UpdateAvailableView { DataContext = _updateAvailableViewModel };
|
||||||
|
_updateAvailableViewModel.Initialise(updateData);
|
||||||
|
_updateAvailableViewModel.OnRequestClose += (s, e) => updateAvailableView.Close();
|
||||||
|
updateAvailableView.ShowDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -82,8 +91,6 @@ namespace Filtration.Services
|
|||||||
// We don't care if the update check fails, because it could fail for multiple reasons
|
// We don't care if the update check fails, because it could fail for multiple reasons
|
||||||
// including the user blocking Filtration in their firewall.
|
// including the user blocking Filtration in their firewall.
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool LatestVersionIsNewerThanSuppressedVersion(UpdateData updateData)
|
private static bool LatestVersionIsNewerThanSuppressedVersion(UpdateData updateData)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ namespace Filtration.ViewModels
|
|||||||
bool IsExpanded { get; set; }
|
bool IsExpanded { get; set; }
|
||||||
IItemFilterBlock Block { get; }
|
IItemFilterBlock Block { get; }
|
||||||
bool BlockEnabled { get; set; }
|
bool BlockEnabled { get; set; }
|
||||||
|
string BlockDescription { get; set; }
|
||||||
void RefreshBlockPreview();
|
void RefreshBlockPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,10 +360,10 @@ namespace Filtration.ViewModels
|
|||||||
IsDirty = true;
|
IsDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sender is IAudioVisualBlockItem)
|
//if (sender is IAudioVisualBlockItem)
|
||||||
{
|
//{
|
||||||
RefreshBlockPreview();
|
RefreshBlockPreview();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RefreshBlockPreview()
|
public void RefreshBlockPreview()
|
||||||
|
|||||||
@@ -605,7 +605,7 @@ namespace Filtration.ViewModels
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_blockTranslator.ReplaceColorBlockItemsFromString(targetBlockViewModel.Block.BlockItems, clipboardText);
|
_blockTranslator.ReplaceAudioVisualBlockItemsFromString(targetBlockViewModel.Block.BlockItems, clipboardText);
|
||||||
targetBlockViewModel.RefreshBlockPreview();
|
targetBlockViewModel.RefreshBlockPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,13 +10,10 @@ using System.Windows.Forms;
|
|||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using Filtration.Common.Services;
|
using Filtration.Common.Services;
|
||||||
using Filtration.Common.ViewModels;
|
|
||||||
using Filtration.Interface;
|
using Filtration.Interface;
|
||||||
using Filtration.Models;
|
|
||||||
using Filtration.ObjectModel.Enums;
|
using Filtration.ObjectModel.Enums;
|
||||||
using Filtration.ObjectModel.ThemeEditor;
|
using Filtration.ObjectModel.ThemeEditor;
|
||||||
using Filtration.Parser.Interface.Services;
|
using Filtration.Parser.Interface.Services;
|
||||||
using Filtration.Properties;
|
|
||||||
using Filtration.Repositories;
|
using Filtration.Repositories;
|
||||||
using Filtration.Services;
|
using Filtration.Services;
|
||||||
using Filtration.ThemeEditor.Messages;
|
using Filtration.ThemeEditor.Messages;
|
||||||
@@ -50,8 +47,6 @@ namespace Filtration.ViewModels
|
|||||||
private readonly IAvalonDockWorkspaceViewModel _avalonDockWorkspaceViewModel;
|
private readonly IAvalonDockWorkspaceViewModel _avalonDockWorkspaceViewModel;
|
||||||
private readonly IThemeProvider _themeProvider;
|
private readonly IThemeProvider _themeProvider;
|
||||||
private readonly IThemeService _themeService;
|
private readonly IThemeService _themeService;
|
||||||
private readonly IUpdateCheckService _updateCheckService;
|
|
||||||
private readonly IUpdateAvailableViewModel _updateAvailableViewModel;
|
|
||||||
private readonly IMessageBoxService _messageBoxService;
|
private readonly IMessageBoxService _messageBoxService;
|
||||||
private readonly IClipboardService _clipboardService;
|
private readonly IClipboardService _clipboardService;
|
||||||
private bool _showLoadingBanner;
|
private bool _showLoadingBanner;
|
||||||
@@ -63,8 +58,6 @@ namespace Filtration.ViewModels
|
|||||||
ISettingsPageViewModel settingsPageViewModel,
|
ISettingsPageViewModel settingsPageViewModel,
|
||||||
IThemeProvider themeProvider,
|
IThemeProvider themeProvider,
|
||||||
IThemeService themeService,
|
IThemeService themeService,
|
||||||
IUpdateCheckService updateCheckService,
|
|
||||||
IUpdateAvailableViewModel updateAvailableViewModel,
|
|
||||||
IMessageBoxService messageBoxService,
|
IMessageBoxService messageBoxService,
|
||||||
IClipboardService clipboardService)
|
IClipboardService clipboardService)
|
||||||
{
|
{
|
||||||
@@ -75,8 +68,6 @@ namespace Filtration.ViewModels
|
|||||||
SettingsPageViewModel = settingsPageViewModel;
|
SettingsPageViewModel = settingsPageViewModel;
|
||||||
_themeProvider = themeProvider;
|
_themeProvider = themeProvider;
|
||||||
_themeService = themeService;
|
_themeService = themeService;
|
||||||
_updateCheckService = updateCheckService;
|
|
||||||
_updateAvailableViewModel = updateAvailableViewModel;
|
|
||||||
_messageBoxService = messageBoxService;
|
_messageBoxService = messageBoxService;
|
||||||
_clipboardService = clipboardService;
|
_clipboardService = clipboardService;
|
||||||
|
|
||||||
@@ -102,10 +93,8 @@ namespace Filtration.ViewModels
|
|||||||
AddBlockCommand = new RelayCommand(OnAddBlockCommand, () => ActiveDocumentIsScript);
|
AddBlockCommand = new RelayCommand(OnAddBlockCommand, () => ActiveDocumentIsScript);
|
||||||
AddSectionCommand = new RelayCommand(OnAddSectionCommand, () => ActiveDocumentIsScript);
|
AddSectionCommand = new RelayCommand(OnAddSectionCommand, () => ActiveDocumentIsScript);
|
||||||
DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, () => ActiveDocumentIsScript && ActiveScriptHasSelectedBlock);
|
DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, () => ActiveDocumentIsScript && ActiveScriptHasSelectedBlock);
|
||||||
DisableBlockCommand = new RelayCommand(OnDisableBlockCommand,
|
DisableBlockCommand = new RelayCommand(OnDisableBlockCommand, () => ActiveDocumentIsScript && ActiveScriptHasSelectedEnabledBlock);
|
||||||
() => ActiveDocumentIsScript && ActiveScriptHasSelectedEnabledBlock);
|
EnableBlockCommand = new RelayCommand(OnEnableBlockCommand, () => ActiveDocumentIsScript && ActiveScriptHasSelectedDisabledBlock);
|
||||||
EnableBlockCommand = new RelayCommand(OnEnableBlockCommand,
|
|
||||||
() => ActiveDocumentIsScript && ActiveScriptHasSelectedDisabledBlock);
|
|
||||||
OpenAboutWindowCommand = new RelayCommand(OnOpenAboutWindowCommand);
|
OpenAboutWindowCommand = new RelayCommand(OnOpenAboutWindowCommand);
|
||||||
ReplaceColorsCommand = new RelayCommand(OnReplaceColorsCommand, () => ActiveDocumentIsScript);
|
ReplaceColorsCommand = new RelayCommand(OnReplaceColorsCommand, () => ActiveDocumentIsScript);
|
||||||
|
|
||||||
@@ -116,10 +105,7 @@ namespace Filtration.ViewModels
|
|||||||
AddTextColorThemeComponentCommand = new RelayCommand(OnAddTextColorThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
|
AddTextColorThemeComponentCommand = new RelayCommand(OnAddTextColorThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
|
||||||
AddBackgroundColorThemeComponentCommand = new RelayCommand(OnAddBackgroundColorThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
|
AddBackgroundColorThemeComponentCommand = new RelayCommand(OnAddBackgroundColorThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
|
||||||
AddBorderColorThemeComponentCommand = new RelayCommand(OnAddBorderColorThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
|
AddBorderColorThemeComponentCommand = new RelayCommand(OnAddBorderColorThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
|
||||||
DeleteThemeComponentCommand = new RelayCommand(OnDeleteThemeComponentCommand,
|
DeleteThemeComponentCommand = new RelayCommand(OnDeleteThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable && _avalonDockWorkspaceViewModel.ActiveThemeViewModel.SelectedThemeComponent != null);
|
||||||
() =>
|
|
||||||
ActiveDocumentIsTheme && ActiveThemeIsEditable &&
|
|
||||||
_avalonDockWorkspaceViewModel.ActiveThemeViewModel.SelectedThemeComponent != null);
|
|
||||||
|
|
||||||
ExpandAllBlocksCommand = new RelayCommand(OnExpandAllBlocksCommand, () => ActiveDocumentIsScript);
|
ExpandAllBlocksCommand = new RelayCommand(OnExpandAllBlocksCommand, () => ActiveDocumentIsScript);
|
||||||
CollapseAllBlocksCommand = new RelayCommand(OnCollapseAllBlocksCommand, () => ActiveDocumentIsScript);
|
CollapseAllBlocksCommand = new RelayCommand(OnCollapseAllBlocksCommand, () => ActiveDocumentIsScript);
|
||||||
@@ -189,8 +175,6 @@ namespace Filtration.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
CheckForUpdates();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public RelayCommand OpenScriptCommand { get; }
|
public RelayCommand OpenScriptCommand { get; }
|
||||||
@@ -232,19 +216,6 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
public RelayCommand<bool> ToggleShowAdvancedCommand { get; }
|
public RelayCommand<bool> ToggleShowAdvancedCommand { get; }
|
||||||
public RelayCommand ClearFiltersCommand { get; }
|
public RelayCommand ClearFiltersCommand { get; }
|
||||||
|
|
||||||
private void CheckForUpdates()
|
|
||||||
{
|
|
||||||
var updateData = _updateCheckService.CheckForUpdates();
|
|
||||||
|
|
||||||
if (updateData != null && updateData.UpdateAvailable)
|
|
||||||
{
|
|
||||||
var updateAvailableView = new UpdateAvailableView { DataContext = _updateAvailableViewModel };
|
|
||||||
_updateAvailableViewModel.Initialise(updateData);
|
|
||||||
_updateAvailableViewModel.OnRequestClose += (s, e) => updateAvailableView.Close();
|
|
||||||
updateAvailableView.ShowDialog();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ImageSource Icon { get; private set; }
|
public ImageSource Icon { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -75,8 +75,7 @@
|
|||||||
<MenuItem Header="Paste Block Style" Command="{Binding PasteBlockStyleCommand}" Icon="{StaticResource PasteIcon}" />
|
<MenuItem Header="Paste Block Style" Command="{Binding PasteBlockStyleCommand}" Icon="{StaticResource PasteIcon}" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Add Block" Command="{Binding Data.AddBlockCommand, Source={StaticResource Proxy}}" Icon="{StaticResource AddBlockIcon}" />
|
<MenuItem Header="Add Block" Command="{Binding Data.AddBlockCommand, Source={StaticResource Proxy}}" Icon="{StaticResource AddBlockIcon}" />
|
||||||
<MenuItem Header="Add Section" Command="{Binding Data.AddSectionCommand, Source={StaticResource Proxy}}" Icon="{StaticResource AddSectionIcon}">
|
<MenuItem Header="Add Section" Command="{Binding Data.AddSectionCommand, Source={StaticResource Proxy}}" Icon="{StaticResource AddSectionIcon}" />
|
||||||
</MenuItem>
|
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem Header="Delete Block" Command="{Binding Data.DeleteBlockCommand, Source={StaticResource Proxy}}" Icon="{StaticResource DeleteIcon}" />
|
<MenuItem Header="Delete Block" Command="{Binding Data.DeleteBlockCommand, Source={StaticResource Proxy}}" Icon="{StaticResource DeleteIcon}" />
|
||||||
<Separator />
|
<Separator />
|
||||||
@@ -264,7 +263,7 @@
|
|||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Margin="0,0,3,0">
|
<TextBlock Margin="0,0,3,0">
|
||||||
<Hyperlink Command="{Binding ElementName=TopLevelGrid, Path=DataContext.AddBlockCommand}" CommandParameter="{Binding}">
|
<Hyperlink Command="{Binding ElementName=TopLevelGrid, Path=DataContext.AddFilterBlockItemCommand}" CommandParameter="{Binding}">
|
||||||
<TextBlock>+</TextBlock><TextBlock Text="{Binding Path=., Converter={StaticResource BlockItemTypeToStringConverter}}" />
|
<TextBlock>+</TextBlock><TextBlock Text="{Binding Path=., Converter={StaticResource BlockItemTypeToStringConverter}}" />
|
||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|||||||
@@ -16,6 +16,24 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
<Grid.ContextMenu>
|
||||||
|
<ContextMenu>
|
||||||
|
<ContextMenu.Items>
|
||||||
|
<MenuItem Header="Copy Block" Command="{Binding CopyBlockCommand}" Icon="{StaticResource CopyIcon}" />
|
||||||
|
<MenuItem Header="Paste Block" Command="{Binding PasteBlockCommand}" Icon="{StaticResource PasteIcon}" />
|
||||||
|
<Separator />
|
||||||
|
<MenuItem Header="Add Block" Command="{Binding AddBlockCommand}" Icon="{StaticResource AddBlockIcon}" />
|
||||||
|
<MenuItem Header="Add Section" Command="{Binding AddSectionCommand}" Icon="{StaticResource AddSectionIcon}" />
|
||||||
|
<Separator />
|
||||||
|
<MenuItem Header="Delete Section" Command="{Binding DeleteBlockCommand}" Icon="{StaticResource DeleteIcon}" />
|
||||||
|
<Separator />
|
||||||
|
<MenuItem Header="Move Section To Top" Command="{Binding MoveBlockToTopCommand}" Icon="{StaticResource MoveToTopIcon}" />
|
||||||
|
<MenuItem Header="Move Section Up" Command="{Binding MoveBlockUpCommand}" Icon="{StaticResource MoveUpIcon}" />
|
||||||
|
<MenuItem Header="Move Section Down" Command="{Binding MoveBlockDownCommand}" Icon="{StaticResource MoveDownIcon}" />
|
||||||
|
<MenuItem Header="Move Section To Bottom" Command="{Binding MoveBlockToBottomCommand}" Icon="{StaticResource MoveToBottomIcon}" />
|
||||||
|
</ContextMenu.Items>
|
||||||
|
</ContextMenu>
|
||||||
|
</Grid.ContextMenu>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
</ListBox.Resources>
|
</ListBox.Resources>
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Block.Description, Converter={StaticResource HashSignRemovalConverter}}" ToolTip="{Binding Block.Description}" />
|
<TextBlock Text="{Binding BlockDescription, Converter={StaticResource HashSignRemovalConverter}}" ToolTip="{Binding BlockDescription}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
|
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
|
||||||
Title="Filtration - New Version Available!" Height="300" Width="500"
|
Title="Filtration - New Version Available!" Height="300" Width="500" Icon="../Resources/filtration.ico"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DataContext="{d:DesignInstance Type=viewModels:UpdateAvailableViewModel}">
|
d:DataContext="{d:DesignInstance Type=viewModels:UpdateAvailableViewModel}">
|
||||||
<Grid Margin="10">
|
<Grid Margin="10">
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
Filtration is an editor for Path of Exile item filter scripts.
|
Filtration is an editor for Path of Exile item filter scripts.
|
||||||
|
|
||||||
## Current Release (Released 2015-07-31)
|
## Current Release (Released 2016-08-30)
|
||||||
<b>Installer (6.37mb)</b> <a href="https://github.com/ben-wallis/Filtration/releases/download/0.11/filtration_0.11_setup.exe">filtration_0.11_setup.exe</a>
|
<b>Installer (7.44mb)</b> <a href="https://github.com/ben-wallis/Filtration/releases/download/0.13/filtration_0.13_setup.exe">filtration_0.13_setup.exe</a>
|
||||||
|
|
||||||
<b>Zip File (7.97mb)</b> <a href="https://github.com/ben-wallis/Filtration/releases/download/0.11/filtration_0.11.zip">filtration_0.11.zip</a>
|
<b>Zip File (9.75mb)</b> <a href="https://github.com/ben-wallis/Filtration/releases/download/0.13/filtration_0.13.zip">filtration_0.13.zip</a>
|
||||||
|
|
||||||
## System Requirements
|
## System Requirements
|
||||||
Filtration requires .NET Framework 4.5.1 installed.
|
Filtration requires .NET Framework 4.6.1 installed.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user