Compare commits
9 Commits
1.1.0-beta
...
1.1.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30e76e333c | ||
|
|
f840fb69ad | ||
|
|
ae98c2d5de | ||
|
|
ba6d50cf45 | ||
|
|
6838cb12a8 | ||
|
|
fd2023598b | ||
|
|
e3b1a5dba7 | ||
|
|
25c25c2a1d | ||
|
|
e5386132c3 |
@@ -9,6 +9,10 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
{
|
{
|
||||||
private Color _color;
|
private Color _color;
|
||||||
|
|
||||||
|
private ColorThemeComponent()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public ColorThemeComponent(ThemeComponentType componentType, string componentName, Color componentColor)
|
public ColorThemeComponent(ThemeComponentType componentType, string componentName, Color componentColor)
|
||||||
{
|
{
|
||||||
if (componentName == null || componentColor == null)
|
if (componentName == null || componentColor == null)
|
||||||
@@ -23,7 +27,7 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
|
|
||||||
public Color Color
|
public Color Color
|
||||||
{
|
{
|
||||||
get { return _color; }
|
get => _color;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_color = value;
|
_color = value;
|
||||||
|
|||||||
@@ -9,22 +9,21 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
private EffectColor _effectColor;
|
private EffectColor _effectColor;
|
||||||
private bool _temporary;
|
private bool _temporary;
|
||||||
|
|
||||||
|
private EffectColorThemeComponent()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public EffectColorThemeComponent(ThemeComponentType componentType, string componentName, EffectColor componentEffectColor, bool componentTemporary)
|
public EffectColorThemeComponent(ThemeComponentType componentType, string componentName, EffectColor componentEffectColor, bool componentTemporary)
|
||||||
{
|
{
|
||||||
if (componentName == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentException("Null parameters not allowed in EffectColorThemeComponent constructor");
|
|
||||||
}
|
|
||||||
|
|
||||||
ComponentType = componentType;
|
ComponentType = componentType;
|
||||||
ComponentName = componentName;
|
ComponentName = componentName ?? throw new ArgumentException("Null parameters not allowed in EffectColorThemeComponent constructor");
|
||||||
EffectColor = componentEffectColor;
|
EffectColor = componentEffectColor;
|
||||||
Temporary = componentTemporary;
|
Temporary = componentTemporary;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EffectColor EffectColor
|
public EffectColor EffectColor
|
||||||
{
|
{
|
||||||
get { return _effectColor; }
|
get => _effectColor;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_effectColor = value;
|
_effectColor = value;
|
||||||
@@ -35,7 +34,7 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
|
|
||||||
public bool Temporary
|
public bool Temporary
|
||||||
{
|
{
|
||||||
get { return _temporary; }
|
get => _temporary;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_temporary = value;
|
_temporary = value;
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
private IconColor _iconColor;
|
private IconColor _iconColor;
|
||||||
private IconShape _iconShape;
|
private IconShape _iconShape;
|
||||||
|
|
||||||
|
private IconThemeComponent()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public IconThemeComponent(ThemeComponentType componentType, string componentName, IconSize componentIconSize, IconColor componentIconColor, IconShape componentIconShape)
|
public IconThemeComponent(ThemeComponentType componentType, string componentName, IconSize componentIconSize, IconColor componentIconColor, IconShape componentIconShape)
|
||||||
{
|
{
|
||||||
if (componentName == null)
|
if (componentName == null)
|
||||||
@@ -26,7 +30,7 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
|
|
||||||
public IconSize IconSize
|
public IconSize IconSize
|
||||||
{
|
{
|
||||||
get { return _iconSize; }
|
get => _iconSize;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_iconSize = value;
|
_iconSize = value;
|
||||||
@@ -37,7 +41,7 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
|
|
||||||
public IconColor IconColor
|
public IconColor IconColor
|
||||||
{
|
{
|
||||||
get { return _iconColor; }
|
get => _iconColor;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_iconColor = value;
|
_iconColor = value;
|
||||||
@@ -48,7 +52,7 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
|
|
||||||
public IconShape IconShape
|
public IconShape IconShape
|
||||||
{
|
{
|
||||||
get { return _iconShape; }
|
get => _iconShape;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_iconShape = value;
|
_iconShape = value;
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
{
|
{
|
||||||
private int _value;
|
private int _value;
|
||||||
|
|
||||||
|
private IntegerThemeComponent()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public IntegerThemeComponent(ThemeComponentType componentType, string componentName, int componentValue)
|
public IntegerThemeComponent(ThemeComponentType componentType, string componentName, int componentValue)
|
||||||
{
|
{
|
||||||
if (componentName == null)
|
if (componentName == null)
|
||||||
@@ -23,7 +27,7 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
|
|
||||||
public int Value
|
public int Value
|
||||||
{
|
{
|
||||||
get { return _value; }
|
get => _value;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_value = value;
|
_value = value;
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
private string _value;
|
private string _value;
|
||||||
private int _secondValue;
|
private int _secondValue;
|
||||||
|
|
||||||
|
private StrIntThemeComponent()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public StrIntThemeComponent(ThemeComponentType componentType, string componentName, string componentValue, int componentSecondValue)
|
public StrIntThemeComponent(ThemeComponentType componentType, string componentName, string componentValue, int componentSecondValue)
|
||||||
{
|
{
|
||||||
if (componentName == null || componentValue == null)
|
if (componentName == null || componentValue == null)
|
||||||
@@ -24,7 +28,7 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
|
|
||||||
public string Value
|
public string Value
|
||||||
{
|
{
|
||||||
get { return _value; }
|
get => _value;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_value = value;
|
_value = value;
|
||||||
@@ -35,7 +39,7 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
|
|
||||||
public int SecondValue
|
public int SecondValue
|
||||||
{
|
{
|
||||||
get { return _secondValue; }
|
get => _secondValue;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_secondValue = value;
|
_secondValue = value;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Xml.Serialization;
|
||||||
using Filtration.ObjectModel.Enums;
|
using Filtration.ObjectModel.Enums;
|
||||||
using GalaSoft.MvvmLight.Command;
|
using GalaSoft.MvvmLight.Command;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
@@ -13,6 +14,10 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
private string _value;
|
private string _value;
|
||||||
public static ObservableCollection<string> _customSoundsAvailable;
|
public static ObservableCollection<string> _customSoundsAvailable;
|
||||||
|
|
||||||
|
private StringThemeComponent()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public StringThemeComponent(ThemeComponentType componentType, string componentName, string componentValue)
|
public StringThemeComponent(ThemeComponentType componentType, string componentName, string componentValue)
|
||||||
{
|
{
|
||||||
if (componentName == null || componentValue == null)
|
if (componentName == null || componentValue == null)
|
||||||
@@ -61,13 +66,14 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
CustomSoundFileDialogCommand = new RelayCommand(OnCustomSoundFileDialog);
|
CustomSoundFileDialogCommand = new RelayCommand(OnCustomSoundFileDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[XmlIgnore]
|
||||||
public RelayCommand CustomSoundFileDialogCommand { get; set; }
|
public RelayCommand CustomSoundFileDialogCommand { get; set; }
|
||||||
|
|
||||||
public ObservableCollection<string> CustomSoundsAvailable => _customSoundsAvailable;
|
public ObservableCollection<string> CustomSoundsAvailable => _customSoundsAvailable;
|
||||||
|
|
||||||
public string Value
|
public string Value
|
||||||
{
|
{
|
||||||
get { return _value; }
|
get => _value;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_value = value;
|
_value = value;
|
||||||
@@ -78,12 +84,11 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
|
|
||||||
private void OnCustomSoundFileDialog()
|
private void OnCustomSoundFileDialog()
|
||||||
{
|
{
|
||||||
OpenFileDialog fileDialog = new OpenFileDialog();
|
OpenFileDialog fileDialog = new OpenFileDialog {DefaultExt = ".mp3"};
|
||||||
fileDialog.DefaultExt = ".mp3";
|
var poePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\My Games\Path of Exile\";
|
||||||
var poePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).ToString() + @"\My Games\Path of Exile\";
|
|
||||||
fileDialog.InitialDirectory = poePath;
|
fileDialog.InitialDirectory = poePath;
|
||||||
|
|
||||||
Nullable<bool> result = fileDialog.ShowDialog();
|
bool? result = fileDialog.ShowDialog();
|
||||||
if (result == true)
|
if (result == true)
|
||||||
{
|
{
|
||||||
var fileName = fileDialog.FileName;
|
var fileName = fileDialog.FileName;
|
||||||
|
|||||||
@@ -7,13 +7,17 @@ using Filtration.ObjectModel.Enums;
|
|||||||
namespace Filtration.ObjectModel.ThemeEditor
|
namespace Filtration.ObjectModel.ThemeEditor
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
|
[XmlInclude(typeof(ColorThemeComponent))]
|
||||||
|
[XmlInclude(typeof(EffectColorThemeComponent))]
|
||||||
|
[XmlInclude(typeof(IconThemeComponent))]
|
||||||
|
[XmlInclude(typeof(IntegerThemeComponent))]
|
||||||
|
[XmlInclude(typeof(StringThemeComponent))]
|
||||||
|
[XmlInclude(typeof(StrIntThemeComponent))]
|
||||||
public class Theme
|
public class Theme
|
||||||
{
|
{
|
||||||
private readonly ThemeComponentCollection _components;
|
|
||||||
|
|
||||||
public Theme()
|
public Theme()
|
||||||
{
|
{
|
||||||
_components = new ThemeComponentCollection { IsMasterCollection = false};
|
Components = new ThemeComponentCollection { IsMasterCollection = false};
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
@@ -21,28 +25,28 @@ namespace Filtration.ObjectModel.ThemeEditor
|
|||||||
[XmlIgnore]
|
[XmlIgnore]
|
||||||
public string FilePath { get; set; }
|
public string FilePath { get; set; }
|
||||||
|
|
||||||
public ThemeComponentCollection Components => _components;
|
public ThemeComponentCollection Components { get; set; }
|
||||||
|
|
||||||
public bool ComponentExists(ThemeComponentType componentType, string componentName)
|
public bool ComponentExists(ThemeComponentType componentType, string componentName)
|
||||||
{
|
{
|
||||||
var componentCount =
|
var componentCount =
|
||||||
_components.Count(c => c.ComponentName == componentName && c.ComponentType == componentType);
|
Components.Count(c => c.ComponentName == componentName && c.ComponentType == componentType);
|
||||||
return componentCount > 0;
|
return componentCount > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddComponent(ThemeComponentType componentType, string componentName, Color componentColor)
|
public void AddComponent(ThemeComponentType componentType, string componentName, Color componentColor)
|
||||||
{
|
{
|
||||||
_components.Add(new ColorThemeComponent(componentType, componentName, componentColor));
|
Components.Add(new ColorThemeComponent(componentType, componentName, componentColor));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddComponent(ThemeComponentType componentType, string componentName, int componentValue)
|
public void AddComponent(ThemeComponentType componentType, string componentName, int componentValue)
|
||||||
{
|
{
|
||||||
_components.Add(new IntegerThemeComponent(componentType, componentName, componentValue));
|
Components.Add(new IntegerThemeComponent(componentType, componentName, componentValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddComponent(ThemeComponentType componentType, string componentName, string componentValue, int componentSecondValue)
|
public void AddComponent(ThemeComponentType componentType, string componentName, string componentValue, int componentSecondValue)
|
||||||
{
|
{
|
||||||
_components.Add(new StrIntThemeComponent(componentType, componentName, componentValue, componentSecondValue));
|
Components.Add(new StrIntThemeComponent(componentType, componentName, componentValue, componentSecondValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,9 +55,12 @@
|
|||||||
<setting name="WindowHeight" serializeAs="String">
|
<setting name="WindowHeight" serializeAs="String">
|
||||||
<value>800</value>
|
<value>800</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="LastActiveDocument" serializeAs="String">
|
<setting name="LastOpenScripts" serializeAs="String">
|
||||||
<value />
|
<value />
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="BlocksExpandedOnOpen" serializeAs="String">
|
||||||
|
<value>True</value>
|
||||||
|
</setting>
|
||||||
</Filtration.Properties.Settings>
|
</Filtration.Properties.Settings>
|
||||||
</userSettings>
|
</userSettings>
|
||||||
<runtime>
|
<runtime>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Filtration
|
|||||||
cfg.CreateMap<StringThemeComponent, StringThemeComponentViewModel>().ReverseMap();
|
cfg.CreateMap<StringThemeComponent, StringThemeComponentViewModel>().ReverseMap();
|
||||||
cfg.CreateMap<IconThemeComponent, IconThemeComponentViewModel>().ReverseMap();
|
cfg.CreateMap<IconThemeComponent, IconThemeComponentViewModel>().ReverseMap();
|
||||||
cfg.CreateMap<EffectColorThemeComponent, EffectColorThemeComponentViewModel>().ReverseMap();
|
cfg.CreateMap<EffectColorThemeComponent, EffectColorThemeComponentViewModel>().ReverseMap();
|
||||||
cfg.CreateMap<IThemeEditorViewModel, Theme>();
|
cfg.CreateMap<ThemeEditorViewModel, Theme>();
|
||||||
});
|
});
|
||||||
|
|
||||||
Mapper.AssertConfigurationIsValid();
|
Mapper.AssertConfigurationIsValid();
|
||||||
|
|||||||
@@ -76,6 +76,9 @@
|
|||||||
<Reference Include="DeltaCompressionDotNet.PatchApi, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3e8888ee913ed789, processorArchitecture=MSIL">
|
<Reference Include="DeltaCompressionDotNet.PatchApi, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3e8888ee913ed789, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll</HintPath>
|
<HintPath>..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="DynamicData, Version=6.7.0.2529, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\DynamicData.6.7.0.2529\lib\net46\DynamicData.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Fluent, Version=6.1.0.326, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Fluent, Version=6.1.0.326, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Fluent.Ribbon.6.1.0.326\lib\net45\Fluent.dll</HintPath>
|
<HintPath>..\packages\Fluent.Ribbon.6.1.0.326\lib\net45\Fluent.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -114,7 +117,7 @@
|
|||||||
<HintPath>..\packages\NLog.4.5.11\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.4.5.11\lib\net45\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\squirrel.windows.1.8.0\lib\Net45\NuGet.Squirrel.dll</HintPath>
|
<HintPath>..\packages\squirrel.windows.1.9.0\lib\Net45\NuGet.Squirrel.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SharpCompress, Version=0.17.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
|
<Reference Include="SharpCompress, Version=0.17.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\SharpCompress.0.17.1\lib\net45\SharpCompress.dll</HintPath>
|
<HintPath>..\packages\SharpCompress.0.17.1\lib\net45\SharpCompress.dll</HintPath>
|
||||||
@@ -122,14 +125,17 @@
|
|||||||
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Splat.1.6.2\lib\Net45\Splat.dll</HintPath>
|
<HintPath>..\packages\Splat.1.6.2\lib\Net45\Splat.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Squirrel, Version=1.8.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Squirrel, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\squirrel.windows.1.8.0\lib\Net45\Squirrel.dll</HintPath>
|
<HintPath>..\packages\squirrel.windows.1.9.0\lib\Net45\Squirrel.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.IO.Compression" />
|
<Reference Include="System.IO.Compression" />
|
||||||
|
<Reference Include="System.Reactive, Version=4.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Reactive.4.0.0\lib\net46\System.Reactive.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Runtime.Remoting" />
|
<Reference Include="System.Runtime.Remoting" />
|
||||||
<Reference Include="System.Runtime.Serialization" />
|
<Reference Include="System.Runtime.Serialization" />
|
||||||
<Reference Include="System.ServiceModel" />
|
<Reference Include="System.ServiceModel" />
|
||||||
@@ -138,6 +144,7 @@
|
|||||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
|
<Reference Include="System.Windows" />
|
||||||
<Reference Include="System.Windows.Controls.Input.Toolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="System.Windows.Controls.Input.Toolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\packages\WPFToolkit.3.5.50211.1\lib\System.Windows.Controls.Input.Toolkit.dll</HintPath>
|
<HintPath>..\packages\WPFToolkit.3.5.50211.1\lib\System.Windows.Controls.Input.Toolkit.dll</HintPath>
|
||||||
@@ -217,6 +224,7 @@
|
|||||||
<Compile Include="Services\HTTPService.cs" />
|
<Compile Include="Services\HTTPService.cs" />
|
||||||
<Compile Include="Services\ItemFilterPersistenceService.cs" />
|
<Compile Include="Services\ItemFilterPersistenceService.cs" />
|
||||||
<Compile Include="Services\ItemFilterScriptDirectoryService.cs" />
|
<Compile Include="Services\ItemFilterScriptDirectoryService.cs" />
|
||||||
|
<Compile Include="Services\ScriptLoadingService.cs" />
|
||||||
<Compile Include="Services\SettingsService.cs" />
|
<Compile Include="Services\SettingsService.cs" />
|
||||||
<Compile Include="Services\StaticDataService.cs" />
|
<Compile Include="Services\StaticDataService.cs" />
|
||||||
<Compile Include="Services\UpdateService.cs" />
|
<Compile Include="Services\UpdateService.cs" />
|
||||||
@@ -230,12 +238,16 @@
|
|||||||
<Compile Include="UserControls\EditableListBoxControl.xaml.cs">
|
<Compile Include="UserControls\EditableListBoxControl.xaml.cs">
|
||||||
<DependentUpon>EditableListBoxControl.xaml</DependentUpon>
|
<DependentUpon>EditableListBoxControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="UserControls\EnableDisableToggleButton.xaml.cs">
|
||||||
|
<DependentUpon>EnableDisableToggleButton.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="UserControls\ItemPreviewControl.xaml.cs">
|
<Compile Include="UserControls\ItemPreviewControl.xaml.cs">
|
||||||
<DependentUpon>ItemPreviewControl.xaml</DependentUpon>
|
<DependentUpon>ItemPreviewControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="UserControls\ThemeComponentSelectionControl.xaml.cs">
|
<Compile Include="UserControls\ThemeComponentSelectionControl.xaml.cs">
|
||||||
<DependentUpon>ThemeComponentSelectionControl.xaml</DependentUpon>
|
<DependentUpon>ThemeComponentSelectionControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="ViewModels\DesignTime\DesignTimeItemFilterBlockViewModel.cs" />
|
||||||
<Compile Include="ViewModels\DesignTime\DesignTimeSettingsPageViewModel.cs" />
|
<Compile Include="ViewModels\DesignTime\DesignTimeSettingsPageViewModel.cs" />
|
||||||
<Compile Include="Views\AttachedProperties\SelectedItemsAttachedProperty.cs" />
|
<Compile Include="Views\AttachedProperties\SelectedItemsAttachedProperty.cs" />
|
||||||
<Compile Include="Utility\RoutedCommandHandler.cs" />
|
<Compile Include="Utility\RoutedCommandHandler.cs" />
|
||||||
@@ -274,6 +286,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="UserControls\EnableDisableToggleButton.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="UserControls\ThemeComponentSelectionControl.xaml">
|
<Page Include="UserControls\ThemeComponentSelectionControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -9,7 +9,18 @@
|
|||||||
<description>A Path of Exile loot filter script editor</description>
|
<description>A Path of Exile loot filter script editor</description>
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<copyright>Copyright 2018</copyright>
|
<copyright>Copyright 2018</copyright>
|
||||||
<releaseNotes>* Fixed crash on exit</releaseNotes>
|
<releaseNotes>* All open filter scripts are now remembered on exit and reopened when the application is started rather than just the last opened one (#95)
|
||||||
|
* Filter sections are once again now expanded by default when scripts are opened, unless the new "Auto-expand all sections when opening scripts" setting is disabled
|
||||||
|
* A new Clear Styles button has been added which removes all styles from the selected block (#96)
|
||||||
|
* The Enable/Disable Block toggle button is now visible on both the Regular Block Items and Appearance Block Items views
|
||||||
|
* When there are too many block items to fit horizontally in a block a horizontal scrollbar will now appear
|
||||||
|
* Fixed the application freezing for a long period of time when Ctrl+A (Select All) is performed
|
||||||
|
* Fixed the Switch to Appearance/Regular Block Items text overlapping block items
|
||||||
|
* Fixed theme saving (blank theme files were being saved) (#83)
|
||||||
|
* Fixed checkboxes in Block Group Browser (#97)
|
||||||
|
* Fixed the Select Path of Exile data directory dialog appearing after every upgrade (#94)
|
||||||
|
* Fixed an issue where custom sounds were only populated from the default Path of Exile data directory rather than the configured directory
|
||||||
|
* Clean installs no longer prompt to select the Path of Exile data directory if the default directory exists</releaseNotes>
|
||||||
<dependencies />
|
<dependencies />
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ using System.Runtime.CompilerServices;
|
|||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
[assembly: AssemblyVersion("1.1.0")]
|
[assembly: AssemblyVersion("1.1.0")]
|
||||||
[assembly: AssemblyInformationalVersion("1.1.0-beta1")]
|
[assembly: AssemblyInformationalVersion("1.1.0-beta3")]
|
||||||
|
|
||||||
[assembly: InternalsVisibleTo("Filtration.Tests")]
|
[assembly: InternalsVisibleTo("Filtration.Tests")]
|
||||||
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]
|
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]
|
||||||
|
|||||||
14
Filtration/Properties/Settings.Designer.cs
generated
14
Filtration/Properties/Settings.Designer.cs
generated
@@ -12,7 +12,7 @@ namespace Filtration.Properties {
|
|||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
@@ -229,5 +229,17 @@ namespace Filtration.Properties {
|
|||||||
this["LastOpenScripts"] = value;
|
this["LastOpenScripts"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
|
public bool BlocksExpandedOnOpen {
|
||||||
|
get {
|
||||||
|
return ((bool)(this["BlocksExpandedOnOpen"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["BlocksExpandedOnOpen"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,8 +53,11 @@
|
|||||||
<Setting Name="WindowHeight" Type="System.Int32" Scope="User">
|
<Setting Name="WindowHeight" Type="System.Int32" Scope="User">
|
||||||
<Value Profile="(Default)">800</Value>
|
<Value Profile="(Default)">800</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="LastActiveDocument" Type="System.String" Scope="User">
|
<Setting Name="LastOpenScripts" Type="System.String" Scope="User">
|
||||||
<Value Profile="(Default)" />
|
<Value Profile="(Default)" />
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="BlocksExpandedOnOpen" Type="System.Boolean" Scope="User">
|
||||||
|
<Value Profile="(Default)">True</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using Filtration.Properties;
|
||||||
using Filtration.Views;
|
using Filtration.Views;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
|
||||||
@@ -17,16 +18,19 @@ namespace Filtration.Services
|
|||||||
|
|
||||||
private readonly IItemFilterScriptDirectoryService _itemFilterScriptDirectoryService;
|
private readonly IItemFilterScriptDirectoryService _itemFilterScriptDirectoryService;
|
||||||
private readonly IMainWindow _mainWindow;
|
private readonly IMainWindow _mainWindow;
|
||||||
|
private readonly IScriptLoadingService _scriptLoadingService;
|
||||||
private readonly ISettingsService _settingsService;
|
private readonly ISettingsService _settingsService;
|
||||||
private readonly IUpdateService _updateService;
|
private readonly IUpdateService _updateService;
|
||||||
|
|
||||||
public Bootstrapper(IItemFilterScriptDirectoryService itemFilterScriptDirectoryService,
|
public Bootstrapper(IItemFilterScriptDirectoryService itemFilterScriptDirectoryService,
|
||||||
IMainWindow mainWindow,
|
IMainWindow mainWindow,
|
||||||
|
IScriptLoadingService scriptLoadingService,
|
||||||
ISettingsService settingsService,
|
ISettingsService settingsService,
|
||||||
IUpdateService updateService)
|
IUpdateService updateService)
|
||||||
{
|
{
|
||||||
_itemFilterScriptDirectoryService = itemFilterScriptDirectoryService;
|
_itemFilterScriptDirectoryService = itemFilterScriptDirectoryService;
|
||||||
_mainWindow = mainWindow;
|
_mainWindow = mainWindow;
|
||||||
|
_scriptLoadingService = scriptLoadingService;
|
||||||
_settingsService = settingsService;
|
_settingsService = settingsService;
|
||||||
_updateService = updateService;
|
_updateService = updateService;
|
||||||
}
|
}
|
||||||
@@ -44,6 +48,12 @@ namespace Filtration.Services
|
|||||||
|
|
||||||
_mainWindow.Show();
|
_mainWindow.Show();
|
||||||
|
|
||||||
|
// If there were scripts open the last time the application was closed, reopen them
|
||||||
|
if (!string.IsNullOrWhiteSpace(Settings.Default.LastOpenScripts))
|
||||||
|
{
|
||||||
|
await _scriptLoadingService.LoadScriptsAsync(Settings.Default.LastOpenScripts.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries));
|
||||||
|
}
|
||||||
|
|
||||||
await _updateService.CheckForUpdatesAsync();
|
await _updateService.CheckForUpdatesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
98
Filtration/Services/ScriptLoadingService.cs
Normal file
98
Filtration/Services/ScriptLoadingService.cs
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using Filtration.Common.Services;
|
||||||
|
using Filtration.Repositories;
|
||||||
|
using Filtration.ThemeEditor.Providers;
|
||||||
|
using Filtration.ThemeEditor.ViewModels;
|
||||||
|
using Filtration.ViewModels;
|
||||||
|
using GalaSoft.MvvmLight.Messaging;
|
||||||
|
using NLog;
|
||||||
|
|
||||||
|
namespace Filtration.Services
|
||||||
|
{
|
||||||
|
internal interface IScriptLoadingService
|
||||||
|
{
|
||||||
|
Task LoadScriptAsync(string scriptFilename);
|
||||||
|
Task LoadScriptsAsync(string[] files);
|
||||||
|
Task LoadThemeAsync(string themeFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal sealed class ScriptLoadingService : IScriptLoadingService
|
||||||
|
{
|
||||||
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
private readonly IAvalonDockWorkspaceViewModel _avalonDockWorkspaceViewModel;
|
||||||
|
private readonly IMessageBoxService _messageBoxService;
|
||||||
|
private readonly IThemeProvider _themeProvider;
|
||||||
|
private readonly IItemFilterScriptRepository _itemFilterScriptRepository;
|
||||||
|
|
||||||
|
public ScriptLoadingService(IAvalonDockWorkspaceViewModel avalonDockWorkspaceViewModel,
|
||||||
|
IItemFilterScriptRepository itemFilterScriptRepository,
|
||||||
|
IMessageBoxService messageBoxService,
|
||||||
|
IThemeProvider themeProvider)
|
||||||
|
{
|
||||||
|
_avalonDockWorkspaceViewModel = avalonDockWorkspaceViewModel;
|
||||||
|
_messageBoxService = messageBoxService;
|
||||||
|
_themeProvider = themeProvider;
|
||||||
|
_itemFilterScriptRepository = itemFilterScriptRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task LoadScriptsAsync(string[] files)
|
||||||
|
{
|
||||||
|
foreach (var file in files)
|
||||||
|
{
|
||||||
|
if (File.Exists(file))
|
||||||
|
{
|
||||||
|
await LoadScriptAsync(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task LoadScriptAsync(string scriptFilename)
|
||||||
|
{
|
||||||
|
IItemFilterScriptViewModel loadedViewModel;
|
||||||
|
|
||||||
|
Messenger.Default.Send(new NotificationMessage("ShowLoadingBanner"));
|
||||||
|
try
|
||||||
|
{
|
||||||
|
loadedViewModel = await _itemFilterScriptRepository.LoadScriptFromFileAsync(scriptFilename);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Error(e);
|
||||||
|
_messageBoxService.Show("Script Load Error", "Error loading filter script - " + e.Message,
|
||||||
|
MessageBoxButton.OK,
|
||||||
|
MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Messenger.Default.Send(new NotificationMessage("HideLoadingBanner"));
|
||||||
|
}
|
||||||
|
|
||||||
|
_avalonDockWorkspaceViewModel.AddDocument(loadedViewModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task LoadThemeAsync(string themeFilename)
|
||||||
|
{
|
||||||
|
IThemeEditorViewModel loadedViewModel;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
loadedViewModel = await _themeProvider.LoadThemeFromFile(themeFilename);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Error(e);
|
||||||
|
_messageBoxService.Show("Theme Load Error", "Error loading filter theme - " + e.Message,
|
||||||
|
MessageBoxButton.OK,
|
||||||
|
MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_avalonDockWorkspaceViewModel.AddDocument(loadedViewModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
30
Filtration/UserControls/EnableDisableToggleButton.xaml
Normal file
30
Filtration/UserControls/EnableDisableToggleButton.xaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<UserControl x:Class="Filtration.UserControls.EnableDisableToggleButton"
|
||||||
|
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"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
|
<ToggleButton Style="{StaticResource ChromelessToggleButton}"
|
||||||
|
IsChecked="{Binding BlockEnabled}"
|
||||||
|
Margin="0,0,5,0"
|
||||||
|
ToolTip="Enable/Disable Block"
|
||||||
|
Cursor="Hand"
|
||||||
|
Width="25"
|
||||||
|
Height="25">
|
||||||
|
<Image RenderOptions.BitmapScalingMode="HighQuality">
|
||||||
|
<Image.Style>
|
||||||
|
<Style TargetType="{x:Type Image}">
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding BlockEnabled}" Value="true">
|
||||||
|
<Setter Property="Source" Value="/Filtration;component/Resources/Icons/standby_enabled_icon.png"/>
|
||||||
|
</DataTrigger>
|
||||||
|
<DataTrigger Binding="{Binding BlockEnabled}" Value="false">
|
||||||
|
<Setter Property="Source" Value="/Filtration;component/Resources/Icons/standby_disabled_icon.png"/>
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Image.Style>
|
||||||
|
</Image>
|
||||||
|
</ToggleButton>
|
||||||
|
</UserControl>
|
||||||
28
Filtration/UserControls/EnableDisableToggleButton.xaml.cs
Normal file
28
Filtration/UserControls/EnableDisableToggleButton.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.UserControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for EnableDisableToggleButton.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class EnableDisableToggleButton : UserControl
|
||||||
|
{
|
||||||
|
public EnableDisableToggleButton()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,158 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using Filtration.ObjectModel;
|
||||||
|
using Filtration.ObjectModel.BlockItemTypes;
|
||||||
|
using Filtration.ObjectModel.Commands;
|
||||||
|
using Filtration.ObjectModel.Enums;
|
||||||
|
using GalaSoft.MvvmLight.CommandWpf;
|
||||||
|
using Xceed.Wpf.Toolkit;
|
||||||
|
|
||||||
|
namespace Filtration.ViewModels.DesignTime
|
||||||
|
{
|
||||||
|
internal class FakeCommandManager : ICommandManagerInternal {
|
||||||
|
public void ExecuteCommand(ICommand command)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Undo(int undoLevels = 1)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Redo(int redoLevels = 1)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetScript(IItemFilterScriptInternal layout)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class DesignTimeItemFilterBlockViewModel : IItemFilterBlockViewModel
|
||||||
|
{
|
||||||
|
private ItemFilterBlock itemFilterBlock;
|
||||||
|
|
||||||
|
public DesignTimeItemFilterBlockViewModel()
|
||||||
|
{
|
||||||
|
itemFilterBlock = new ItemFilterBlock(new ItemFilterScript(new FakeCommandManager()))
|
||||||
|
{
|
||||||
|
Action = BlockAction.Show,
|
||||||
|
Enabled = true
|
||||||
|
};
|
||||||
|
|
||||||
|
itemFilterBlock.BlockItems.Add(new RarityBlockItem(FilterPredicateOperator.Equal, ItemRarity.Rare));
|
||||||
|
itemFilterBlock.BlockItems.Add(new DropLevelBlockItem(FilterPredicateOperator.GreaterThan, 23));
|
||||||
|
itemFilterBlock.BlockItems.Add(new BaseTypeBlockItem());
|
||||||
|
itemFilterBlock.BlockItems.Add(new BaseTypeBlockItem());
|
||||||
|
itemFilterBlock.BlockItems.Add(new BaseTypeBlockItem());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Initialise(IItemFilterBlockBase itemFilterBlock, IItemFilterScriptViewModel itemFilterScriptViewModel)
|
||||||
|
{
|
||||||
|
//throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IItemFilterBlockBase BaseBlock { get; }
|
||||||
|
public bool IsDirty { get; set; }
|
||||||
|
public bool IsVisible { get; set; }
|
||||||
|
public event EventHandler BlockBecameDirty;
|
||||||
|
|
||||||
|
public bool IsExpanded
|
||||||
|
{
|
||||||
|
get => true;
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
|
||||||
|
public IItemFilterBlock Block => itemFilterBlock;
|
||||||
|
|
||||||
|
public bool BlockEnabled
|
||||||
|
{
|
||||||
|
get => true;
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string BlockDescription { get; set; }
|
||||||
|
public RelayCommand CopyBlockStyleCommand { get; }
|
||||||
|
public RelayCommand PasteBlockStyleCommand { get; }
|
||||||
|
public RelayCommand ToggleBlockActionCommand { get; }
|
||||||
|
public RelayCommand ReplaceColorsCommand { get; }
|
||||||
|
public RelayCommand<Type> AddFilterBlockItemCommand { get; }
|
||||||
|
public RelayCommand<IItemFilterBlockItem> RemoveFilterBlockItemCommand { get; }
|
||||||
|
public RelayCommand PlaySoundCommand { get; }
|
||||||
|
public RelayCommand PlayPositionalSoundCommand { get; }
|
||||||
|
public RelayCommand SwitchBlockItemsViewCommand { get; }
|
||||||
|
public RelayCommand CustomSoundFileDialogCommand { get; }
|
||||||
|
public RelayCommand PlayCustomSoundCommand { get; }
|
||||||
|
public RelayCommand AddBlockGroupCommand { get; }
|
||||||
|
public RelayCommand DeleteBlockGroupCommand { get; }
|
||||||
|
public ObservableCollection<ItemFilterBlockGroup> BlockGroups { get; }
|
||||||
|
public ObservableCollection<string> BlockGroupSuggestions { get; }
|
||||||
|
public string BlockGroupSearch { get; set; }
|
||||||
|
public ObservableCollection<IItemFilterBlockItem> BlockItems => Block.BlockItems;
|
||||||
|
|
||||||
|
public IEnumerable<IItemFilterBlockItem> SummaryBlockItems
|
||||||
|
{
|
||||||
|
get { return Block.BlockItems.Where(b => !(b is IAudioVisualBlockItem)); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<IItemFilterBlockItem> RegularBlockItems
|
||||||
|
{
|
||||||
|
get { return Block.BlockItems.Where(b => !(b is IAudioVisualBlockItem)); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<IItemFilterBlockItem> AudioVisualBlockItems { get; }
|
||||||
|
public bool AdvancedBlockGroup { get; }
|
||||||
|
public bool AudioVisualBlockItemsGridVisible { get; set; }
|
||||||
|
public bool DisplaySettingsPopupOpen { get; set; }
|
||||||
|
public IEnumerable<string> AutoCompleteItemClasses { get; }
|
||||||
|
public IEnumerable<string> AutoCompleteItemBaseTypes { get; }
|
||||||
|
public IEnumerable<string> AutocompleteItemMods { get; }
|
||||||
|
public List<Type> BlockItemTypesAvailable => new List<Type>
|
||||||
|
{
|
||||||
|
typeof (ItemLevelBlockItem),
|
||||||
|
typeof (DropLevelBlockItem),
|
||||||
|
typeof (QualityBlockItem),
|
||||||
|
typeof (RarityBlockItem),
|
||||||
|
typeof (SocketsBlockItem),
|
||||||
|
typeof (LinkedSocketsBlockItem),
|
||||||
|
typeof (WidthBlockItem),
|
||||||
|
typeof (HeightBlockItem),
|
||||||
|
typeof (SocketGroupBlockItem),
|
||||||
|
typeof (ClassBlockItem),
|
||||||
|
typeof (BaseTypeBlockItem),
|
||||||
|
typeof (IdentifiedBlockItem),
|
||||||
|
typeof (CorruptedBlockItem),
|
||||||
|
typeof (ElderItemBlockItem),
|
||||||
|
typeof (ShaperItemBlockItem),
|
||||||
|
typeof (MapTierBlockItem),
|
||||||
|
typeof (ShapedMapBlockItem),
|
||||||
|
typeof (ElderMapBlockItem),
|
||||||
|
typeof (GemLevelBlockItem),
|
||||||
|
typeof (StackSizeBlockItem),
|
||||||
|
typeof (HasExplicitModBlockItem)
|
||||||
|
};
|
||||||
|
public List<Type> AudioVisualBlockItemTypesAvailable { get; }
|
||||||
|
public ObservableCollection<ColorItem> AvailableColors { get; }
|
||||||
|
public Color DisplayTextColor => Colors.Red;
|
||||||
|
public Color DisplayBackgroundColor => Colors.White;
|
||||||
|
public Color DisplayBorderColor => Colors.GreenYellow;
|
||||||
|
public double DisplayFontSize => 20;
|
||||||
|
public int DisplayIconSize { get; }
|
||||||
|
public int DisplayIconColor { get; }
|
||||||
|
public int DisplayIconShape { get; }
|
||||||
|
public Color DisplayEffectColor { get; }
|
||||||
|
public bool HasSound { get; }
|
||||||
|
public bool HasPositionalSound { get; }
|
||||||
|
public bool HasCustomSound { get; }
|
||||||
|
public bool HasAudioVisualBlockItems { get; }
|
||||||
|
public void RefreshBlockPreview()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,8 @@ namespace Filtration.ViewModels.DesignTime
|
|||||||
set { }
|
set { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool BlocksExpandedOnOpen { get; set; }
|
||||||
|
|
||||||
public bool ExtraLineBetweenBlocks
|
public bool ExtraLineBetweenBlocks
|
||||||
{
|
{
|
||||||
get => true;
|
get => true;
|
||||||
|
|||||||
@@ -25,6 +25,47 @@ namespace Filtration.ViewModels
|
|||||||
IItemFilterBlock Block { get; }
|
IItemFilterBlock Block { get; }
|
||||||
bool BlockEnabled { get; set; }
|
bool BlockEnabled { get; set; }
|
||||||
string BlockDescription { get; set; }
|
string BlockDescription { get; set; }
|
||||||
|
RelayCommand CopyBlockStyleCommand { get; }
|
||||||
|
RelayCommand PasteBlockStyleCommand { get; }
|
||||||
|
RelayCommand ToggleBlockActionCommand { get; }
|
||||||
|
RelayCommand ReplaceColorsCommand { get; }
|
||||||
|
RelayCommand<Type> AddFilterBlockItemCommand { get; }
|
||||||
|
RelayCommand<IItemFilterBlockItem> RemoveFilterBlockItemCommand { get; }
|
||||||
|
RelayCommand PlaySoundCommand { get; }
|
||||||
|
RelayCommand PlayPositionalSoundCommand { get; }
|
||||||
|
RelayCommand SwitchBlockItemsViewCommand { get; }
|
||||||
|
RelayCommand CustomSoundFileDialogCommand { get; }
|
||||||
|
RelayCommand PlayCustomSoundCommand { get; }
|
||||||
|
RelayCommand AddBlockGroupCommand { get; }
|
||||||
|
RelayCommand DeleteBlockGroupCommand { get; }
|
||||||
|
ObservableCollection<ItemFilterBlockGroup> BlockGroups { get; }
|
||||||
|
ObservableCollection<string> BlockGroupSuggestions { get; }
|
||||||
|
string BlockGroupSearch { get; set; }
|
||||||
|
ObservableCollection<IItemFilterBlockItem> BlockItems { get; }
|
||||||
|
IEnumerable<IItemFilterBlockItem> SummaryBlockItems { get; }
|
||||||
|
IEnumerable<IItemFilterBlockItem> RegularBlockItems { get; }
|
||||||
|
IEnumerable<IItemFilterBlockItem> AudioVisualBlockItems { get; }
|
||||||
|
bool AdvancedBlockGroup { get; }
|
||||||
|
bool AudioVisualBlockItemsGridVisible { get; set; }
|
||||||
|
bool DisplaySettingsPopupOpen { get; set; }
|
||||||
|
IEnumerable<string> AutoCompleteItemClasses { get; }
|
||||||
|
IEnumerable<string> AutoCompleteItemBaseTypes { get; }
|
||||||
|
IEnumerable<string> AutocompleteItemMods { get; }
|
||||||
|
List<Type> BlockItemTypesAvailable { get; }
|
||||||
|
List<Type> AudioVisualBlockItemTypesAvailable { get; }
|
||||||
|
ObservableCollection<ColorItem> AvailableColors { get; }
|
||||||
|
Color DisplayTextColor { get; }
|
||||||
|
Color DisplayBackgroundColor { get; }
|
||||||
|
Color DisplayBorderColor { get; }
|
||||||
|
double DisplayFontSize { get; }
|
||||||
|
int DisplayIconSize { get; }
|
||||||
|
int DisplayIconColor { get; }
|
||||||
|
int DisplayIconShape { get; }
|
||||||
|
Color DisplayEffectColor { get; }
|
||||||
|
bool HasSound { get; }
|
||||||
|
bool HasPositionalSound { get; }
|
||||||
|
bool HasCustomSound { get; }
|
||||||
|
bool HasAudioVisualBlockItems { get; }
|
||||||
void RefreshBlockPreview();
|
void RefreshBlockPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace Filtration.ViewModels
|
|||||||
{
|
{
|
||||||
internal interface IItemFilterBlockViewModelBase
|
internal interface IItemFilterBlockViewModelBase
|
||||||
{
|
{
|
||||||
void Initialise(IItemFilterBlockBase itemfilterBlock, IItemFilterScriptViewModel itemFilterScriptViewModel);
|
void Initialise(IItemFilterBlockBase itemFilterBlock, IItemFilterScriptViewModel itemFilterScriptViewModel);
|
||||||
IItemFilterBlockBase BaseBlock { get; }
|
IItemFilterBlockBase BaseBlock { get; }
|
||||||
bool IsDirty { get; set; }
|
bool IsDirty { get; set; }
|
||||||
bool IsVisible { get; set; }
|
bool IsVisible { get; set; }
|
||||||
@@ -25,9 +25,9 @@ namespace Filtration.ViewModels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public virtual void Initialise(IItemFilterBlockBase itemfilterBlock, IItemFilterScriptViewModel itemFilterScriptViewModel)
|
public virtual void Initialise(IItemFilterBlockBase itemFilterBlock, IItemFilterScriptViewModel itemFilterScriptViewModel)
|
||||||
{
|
{
|
||||||
BaseBlock = itemfilterBlock;
|
BaseBlock = itemFilterBlock;
|
||||||
_parentScriptViewModel = itemFilterScriptViewModel;
|
_parentScriptViewModel = itemFilterScriptViewModel;
|
||||||
|
|
||||||
CopyBlockCommand = new RelayCommand(OnCopyBlockCommand);
|
CopyBlockCommand = new RelayCommand(OnCopyBlockCommand);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ namespace Filtration.ViewModels
|
|||||||
string Comment { get; }
|
string Comment { get; }
|
||||||
bool IsExpanded { get; set; }
|
bool IsExpanded { get; set; }
|
||||||
bool HasVisibleChild { get; }
|
bool HasVisibleChild { get; }
|
||||||
|
int ChildCount { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class ItemFilterCommentBlockViewModel : ItemFilterBlockViewModelBase, IItemFilterCommentBlockViewModel
|
internal class ItemFilterCommentBlockViewModel : ItemFilterBlockViewModelBase, IItemFilterCommentBlockViewModel
|
||||||
@@ -28,13 +29,13 @@ namespace Filtration.ViewModels
|
|||||||
ToggleSectionCommand = new RelayCommand(OnToggleSectionCommand);
|
ToggleSectionCommand = new RelayCommand(OnToggleSectionCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Initialise(IItemFilterBlockBase itemfilterBlock, IItemFilterScriptViewModel itemFilterScriptViewModel)
|
public override void Initialise(IItemFilterBlockBase itemFilterBlock, IItemFilterScriptViewModel itemFilterScriptViewModel)
|
||||||
{
|
{
|
||||||
_parentScriptViewModel = itemFilterScriptViewModel;
|
_parentScriptViewModel = itemFilterScriptViewModel;
|
||||||
ItemFilterCommentBlock = itemfilterBlock as IItemFilterCommentBlock;
|
ItemFilterCommentBlock = itemFilterBlock as IItemFilterCommentBlock;
|
||||||
BaseBlock = ItemFilterCommentBlock;
|
BaseBlock = ItemFilterCommentBlock;
|
||||||
|
|
||||||
base.Initialise(itemfilterBlock, itemFilterScriptViewModel);
|
base.Initialise(itemFilterBlock, itemFilterScriptViewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RelayCommand ToggleSectionCommand { get; }
|
public RelayCommand ToggleSectionCommand { get; }
|
||||||
@@ -43,10 +44,7 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
public string Comment
|
public string Comment
|
||||||
{
|
{
|
||||||
get
|
get => ItemFilterCommentBlock.Comment;
|
||||||
{
|
|
||||||
return ItemFilterCommentBlock.Comment;
|
|
||||||
}
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (ItemFilterCommentBlock.Comment != value)
|
if (ItemFilterCommentBlock.Comment != value)
|
||||||
|
|||||||
@@ -6,11 +6,13 @@ using System.ComponentModel;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reactive.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
|
using DynamicData.Binding;
|
||||||
using Filtration.Common.Services;
|
using Filtration.Common.Services;
|
||||||
using Filtration.Common.ViewModels;
|
using Filtration.Common.ViewModels;
|
||||||
using Filtration.Interface;
|
using Filtration.Interface;
|
||||||
@@ -63,7 +65,7 @@ namespace Filtration.ViewModels
|
|||||||
RelayCommand MoveBlockUpCommand { get; }
|
RelayCommand MoveBlockUpCommand { get; }
|
||||||
RelayCommand MoveBlockDownCommand { get; }
|
RelayCommand MoveBlockDownCommand { get; }
|
||||||
RelayCommand MoveBlockToTopCommand { get; }
|
RelayCommand MoveBlockToTopCommand { get; }
|
||||||
RelayCommand MoveBlockToBottomCommand { get;}
|
RelayCommand MoveBlockToBottomCommand { get; }
|
||||||
RelayCommand CopyBlockCommand { get; }
|
RelayCommand CopyBlockCommand { get; }
|
||||||
RelayCommand PasteBlockCommand { get; }
|
RelayCommand PasteBlockCommand { get; }
|
||||||
RelayCommand CopyBlockStyleCommand { get; }
|
RelayCommand CopyBlockStyleCommand { get; }
|
||||||
@@ -105,17 +107,14 @@ namespace Filtration.ViewModels
|
|||||||
private readonly IItemFilterPersistenceService _persistenceService;
|
private readonly IItemFilterPersistenceService _persistenceService;
|
||||||
private readonly IMessageBoxService _messageBoxService;
|
private readonly IMessageBoxService _messageBoxService;
|
||||||
private readonly IClipboardService _clipboardService;
|
private readonly IClipboardService _clipboardService;
|
||||||
private readonly IBlockGroupHierarchyBuilder _blockGroupHierarchyBuilder;
|
|
||||||
|
|
||||||
private bool _isDirty;
|
private bool _isDirty;
|
||||||
private readonly ObservableCollection<IItemFilterBlockViewModelBase> _selectedBlockViewModels;
|
|
||||||
private IItemFilterCommentBlockViewModel _sectionBrowserSelectedBlockViewModel;
|
private IItemFilterCommentBlockViewModel _sectionBrowserSelectedBlockViewModel;
|
||||||
private readonly ObservableCollection<IItemFilterBlockViewModelBase> _itemFilterBlockViewModels;
|
|
||||||
private Predicate<IItemFilterBlockViewModel> _blockFilterPredicate;
|
private Predicate<IItemFilterBlockViewModel> _blockFilterPredicate;
|
||||||
private ICommandManager _scriptCommandManager;
|
private ICommandManager _scriptCommandManager;
|
||||||
|
|
||||||
|
private List<IDisposable> _subscriptions;
|
||||||
private ObservableCollection<string> _customSoundsAvailable;
|
private ObservableCollection<string> _customSoundsAvailable;
|
||||||
private ListCollectionView _viewItemFilterBlockViewModels;
|
|
||||||
private readonly List<IItemFilterBlockViewModelBase> _lastAddedBlocks;
|
private readonly List<IItemFilterBlockViewModelBase> _lastAddedBlocks;
|
||||||
|
|
||||||
public ItemFilterScriptViewModel(IItemFilterBlockBaseViewModelFactory itemFilterBlockBaseViewModelFactory,
|
public ItemFilterScriptViewModel(IItemFilterBlockBaseViewModelFactory itemFilterBlockBaseViewModelFactory,
|
||||||
@@ -124,8 +123,7 @@ namespace Filtration.ViewModels
|
|||||||
IAvalonDockWorkspaceViewModel avalonDockWorkspaceViewModel,
|
IAvalonDockWorkspaceViewModel avalonDockWorkspaceViewModel,
|
||||||
IItemFilterPersistenceService persistenceService,
|
IItemFilterPersistenceService persistenceService,
|
||||||
IMessageBoxService messageBoxService,
|
IMessageBoxService messageBoxService,
|
||||||
IClipboardService clipboardService,
|
IClipboardService clipboardService)
|
||||||
IBlockGroupHierarchyBuilder blockGroupHierarchyBuilder)
|
|
||||||
{
|
{
|
||||||
_itemFilterBlockBaseViewModelFactory = itemFilterBlockBaseViewModelFactory;
|
_itemFilterBlockBaseViewModelFactory = itemFilterBlockBaseViewModelFactory;
|
||||||
_blockTranslator = blockTranslator;
|
_blockTranslator = blockTranslator;
|
||||||
@@ -135,15 +133,20 @@ namespace Filtration.ViewModels
|
|||||||
_persistenceService = persistenceService;
|
_persistenceService = persistenceService;
|
||||||
_messageBoxService = messageBoxService;
|
_messageBoxService = messageBoxService;
|
||||||
_clipboardService = clipboardService;
|
_clipboardService = clipboardService;
|
||||||
_blockGroupHierarchyBuilder = blockGroupHierarchyBuilder;
|
_subscriptions = new List<IDisposable>();
|
||||||
_itemFilterBlockViewModels = new ObservableCollection<IItemFilterBlockViewModelBase>();
|
ItemFilterBlockViewModels = new ObservableCollection<IItemFilterBlockViewModelBase>();
|
||||||
_selectedBlockViewModels = new ObservableCollection<IItemFilterBlockViewModelBase>();
|
SelectedBlockViewModels = new ObservableCollection<IItemFilterBlockViewModelBase>();
|
||||||
_selectedBlockViewModels.CollectionChanged += (s, e) =>
|
|
||||||
{
|
_subscriptions.Add(
|
||||||
RaisePropertyChanged(nameof(SelectedBlockViewModels));
|
SelectedBlockViewModels.ToObservableChangeSet()
|
||||||
RaisePropertyChanged(nameof(LastSelectedBlockViewModel));
|
.Throttle(TimeSpan.FromMilliseconds(30))
|
||||||
Messenger.Default.Send(new NotificationMessage("LastSelectedBlockChanged"));
|
.Subscribe(x => {
|
||||||
};
|
RaisePropertyChanged(nameof(SelectedBlockViewModels));
|
||||||
|
RaisePropertyChanged(nameof(LastSelectedBlockViewModel));
|
||||||
|
Messenger.Default.Send(new NotificationMessage("LastSelectedBlockChanged"));
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
_lastAddedBlocks = new List<IItemFilterBlockViewModelBase>();
|
_lastAddedBlocks = new List<IItemFilterBlockViewModelBase>();
|
||||||
_showAdvanced = Settings.Default.ShowAdvanced;
|
_showAdvanced = Settings.Default.ShowAdvanced;
|
||||||
|
|
||||||
@@ -154,9 +157,9 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
ToggleShowAdvancedCommand = new RelayCommand<bool>(OnToggleShowAdvancedCommand);
|
ToggleShowAdvancedCommand = new RelayCommand<bool>(OnToggleShowAdvancedCommand);
|
||||||
ClearFilterCommand = new RelayCommand(OnClearFilterCommand, () => BlockFilterPredicate != null);
|
ClearFilterCommand = new RelayCommand(OnClearFilterCommand, () => BlockFilterPredicate != null);
|
||||||
ClearStylesCommand = new RelayCommand(OnClearStylesCommand, () => SelectedBlockViewModels.OfType<IItemFilterBlockViewModel>().Count() > 0);
|
ClearStylesCommand = new RelayCommand(OnClearStylesCommand, () => SelectedBlockViewModels.OfType<IItemFilterBlockViewModel>().Any());
|
||||||
CloseCommand = new RelayCommand(async () => await OnCloseCommand());
|
CloseCommand = new RelayCommand(async () => await OnCloseCommand());
|
||||||
DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, () => CanModifySelectedBlocks());
|
DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, CanModifySelectedBlocks);
|
||||||
MoveBlockToTopCommand = new RelayCommand(OnMoveBlockToTopCommand, () => SelectedBlockViewModels.Count > 0 && CanModifySelectedBlocks());
|
MoveBlockToTopCommand = new RelayCommand(OnMoveBlockToTopCommand, () => SelectedBlockViewModels.Count > 0 && CanModifySelectedBlocks());
|
||||||
MoveBlockToBottomCommand = new RelayCommand(OnMoveBlockToBottomCommand, () => SelectedBlockViewModels.Count > 0 && CanModifySelectedBlocks());
|
MoveBlockToBottomCommand = new RelayCommand(OnMoveBlockToBottomCommand, () => SelectedBlockViewModels.Count > 0 && CanModifySelectedBlocks());
|
||||||
MoveBlockUpCommand = new RelayCommand(OnMoveBlockUpCommand, () => SelectedBlockViewModels.Count == 1 && ViewItemFilterBlockViewModels.IndexOf(LastSelectedBlockViewModel) > 0);
|
MoveBlockUpCommand = new RelayCommand(OnMoveBlockUpCommand, () => SelectedBlockViewModels.Count == 1 && ViewItemFilterBlockViewModels.IndexOf(LastSelectedBlockViewModel) > 0);
|
||||||
@@ -191,6 +194,8 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
Script = itemFilterScript;
|
Script = itemFilterScript;
|
||||||
_scriptCommandManager = Script.CommandManager;
|
_scriptCommandManager = Script.CommandManager;
|
||||||
|
InitialiseCustomSounds();
|
||||||
|
|
||||||
AddItemFilterBlockViewModels(Script.ItemFilterBlocks, -1);
|
AddItemFilterBlockViewModels(Script.ItemFilterBlocks, -1);
|
||||||
|
|
||||||
UpdateChildCount();
|
UpdateChildCount();
|
||||||
@@ -207,7 +212,28 @@ namespace Filtration.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Script.ItemFilterBlocks.CollectionChanged += ItemFilterBlocksOnCollectionChanged;
|
||||||
|
|
||||||
|
_filenameIsFake = newScript;
|
||||||
|
|
||||||
|
if (newScript)
|
||||||
|
{
|
||||||
|
Script.FilePath = "Untitled.filter";
|
||||||
|
}
|
||||||
|
|
||||||
|
Title = Filename;
|
||||||
|
ContentId = "ScriptContentId";
|
||||||
|
|
||||||
|
if (!Settings.Default.BlocksExpandedOnOpen)
|
||||||
|
{
|
||||||
|
CollapseAllSections();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitialiseCustomSounds()
|
||||||
|
{
|
||||||
_customSoundsAvailable = new ObservableCollection<string>();
|
_customSoundsAvailable = new ObservableCollection<string>();
|
||||||
|
_customSoundsAvailable.CollectionChanged += CustomSoundsAvailableOnCollectionChanged;
|
||||||
|
|
||||||
var poeFolderFiles = Directory.GetFiles(_persistenceService.ItemFilterScriptDirectory + "\\").Where(
|
var poeFolderFiles = Directory.GetFiles(_persistenceService.ItemFilterScriptDirectory + "\\").Where(
|
||||||
s => s.EndsWith(".mp3")
|
s => s.EndsWith(".mp3")
|
||||||
@@ -223,21 +249,6 @@ namespace Filtration.ViewModels
|
|||||||
{
|
{
|
||||||
_customSoundsAvailable.Add(file.Replace(_persistenceService.ItemFilterScriptDirectory + "\\", ""));
|
_customSoundsAvailable.Add(file.Replace(_persistenceService.ItemFilterScriptDirectory + "\\", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
Script.ItemFilterBlocks.CollectionChanged += ItemFilterBlocksOnCollectionChanged;
|
|
||||||
_customSoundsAvailable.CollectionChanged += CustomSoundsAvailableOnCollectionChanged;
|
|
||||||
|
|
||||||
_filenameIsFake = newScript;
|
|
||||||
|
|
||||||
if (newScript)
|
|
||||||
{
|
|
||||||
Script.FilePath = "Untitled.filter";
|
|
||||||
}
|
|
||||||
|
|
||||||
Title = Filename;
|
|
||||||
ContentId = "ScriptContentId";
|
|
||||||
|
|
||||||
CollapseAllSections();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ItemFilterBlocksOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs)
|
private void ItemFilterBlocksOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs)
|
||||||
@@ -245,20 +256,20 @@ namespace Filtration.ViewModels
|
|||||||
switch (notifyCollectionChangedEventArgs.Action)
|
switch (notifyCollectionChangedEventArgs.Action)
|
||||||
{
|
{
|
||||||
case NotifyCollectionChangedAction.Add:
|
case NotifyCollectionChangedAction.Add:
|
||||||
{
|
{
|
||||||
AddItemFilterBlockViewModels(notifyCollectionChangedEventArgs.NewItems.Cast<IItemFilterBlockBase>(), notifyCollectionChangedEventArgs.NewStartingIndex);
|
AddItemFilterBlockViewModels(notifyCollectionChangedEventArgs.NewItems.Cast<IItemFilterBlockBase>(), notifyCollectionChangedEventArgs.NewStartingIndex);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NotifyCollectionChangedAction.Remove:
|
case NotifyCollectionChangedAction.Remove:
|
||||||
{
|
{
|
||||||
RemoveItemFilterBlockviewModels(notifyCollectionChangedEventArgs.OldItems.Cast<IItemFilterBlockBase>());
|
RemoveItemFilterBlockViewModels(notifyCollectionChangedEventArgs.OldItems.Cast<IItemFilterBlockBase>());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
Debugger.Break(); // Unhandled NotifyCollectionChangedAction
|
Debugger.Break(); // Unhandled NotifyCollectionChangedAction
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateChildCount();
|
UpdateChildCount();
|
||||||
@@ -289,8 +300,7 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
_lastAddedBlocks.Add(vm);
|
_lastAddedBlocks.Add(vm);
|
||||||
|
|
||||||
var itemBlock = itemFilterBlock as IItemFilterBlock;
|
if (itemFilterBlock is IItemFilterBlock itemBlock)
|
||||||
if (itemBlock != null)
|
|
||||||
{
|
{
|
||||||
foreach (var customSoundBlockItem in itemBlock.BlockItems.OfType<CustomSoundBlockItem>())
|
foreach (var customSoundBlockItem in itemBlock.BlockItems.OfType<CustomSoundBlockItem>())
|
||||||
{
|
{
|
||||||
@@ -303,7 +313,7 @@ namespace Filtration.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RemoveItemFilterBlockviewModels(IEnumerable<IItemFilterBlockBase> itemFilterBlocks)
|
private void RemoveItemFilterBlockViewModels(IEnumerable<IItemFilterBlockBase> itemFilterBlocks)
|
||||||
{
|
{
|
||||||
foreach (var itemFilterBlock in itemFilterBlocks)
|
foreach (var itemFilterBlock in itemFilterBlocks)
|
||||||
{
|
{
|
||||||
@@ -319,7 +329,7 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
private void UpdateFilteredBlockList()
|
private void UpdateFilteredBlockList()
|
||||||
{
|
{
|
||||||
ICollectionView filteredBlocks = CollectionViewSource.GetDefaultView(_itemFilterBlockViewModels);
|
ICollectionView filteredBlocks = CollectionViewSource.GetDefaultView(ItemFilterBlockViewModels);
|
||||||
filteredBlocks.Filter = BlockFilter;
|
filteredBlocks.Filter = BlockFilter;
|
||||||
|
|
||||||
ItemFilterCommentBlockViewModel previousSection = new ItemFilterCommentBlockViewModel();
|
ItemFilterCommentBlockViewModel previousSection = new ItemFilterCommentBlockViewModel();
|
||||||
@@ -329,16 +339,16 @@ namespace Filtration.ViewModels
|
|||||||
{
|
{
|
||||||
previousSection.VisibleChildCount++;
|
previousSection.VisibleChildCount++;
|
||||||
}
|
}
|
||||||
else if (block is ItemFilterCommentBlockViewModel)
|
else if (block is ItemFilterCommentBlockViewModel model)
|
||||||
{
|
{
|
||||||
previousSection = block as ItemFilterCommentBlockViewModel;
|
previousSection = model;
|
||||||
previousSection.VisibleChildCount = 0;
|
previousSection.VisibleChildCount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_viewItemFilterBlockViewModels = (ListCollectionView)CollectionViewSource.GetDefaultView(
|
ViewItemFilterBlockViewModels = (ListCollectionView)CollectionViewSource.GetDefaultView(
|
||||||
filteredBlocks.Cast<IItemFilterBlockViewModelBase>().ToList());
|
filteredBlocks.Cast<IItemFilterBlockViewModelBase>().ToList());
|
||||||
_viewItemFilterBlockViewModels.Filter = BlockVisibilityFilter;
|
ViewItemFilterBlockViewModels.Filter = BlockVisibilityFilter;
|
||||||
|
|
||||||
Messenger.Default.Send(new NotificationMessage("SectionsChanged"));
|
Messenger.Default.Send(new NotificationMessage("SectionsChanged"));
|
||||||
SelectedBlockViewModels.Clear();
|
SelectedBlockViewModels.Clear();
|
||||||
@@ -355,24 +365,24 @@ namespace Filtration.ViewModels
|
|||||||
previousSection.ChildCount++;
|
previousSection.ChildCount++;
|
||||||
block.IsVisible = previousSection.IsExpanded;
|
block.IsVisible = previousSection.IsExpanded;
|
||||||
}
|
}
|
||||||
else if (block is ItemFilterCommentBlockViewModel)
|
else if (block is ItemFilterCommentBlockViewModel model)
|
||||||
{
|
{
|
||||||
previousSection = block as ItemFilterCommentBlockViewModel;
|
previousSection = model;
|
||||||
previousSection.ChildCount = 0;
|
previousSection.ChildCount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<IItemFilterBlockViewModelBase> getChildren(IItemFilterCommentBlockViewModel targetBlockViewModel)
|
private List<IItemFilterBlockViewModelBase> GetChildren(IItemFilterCommentBlockViewModel targetBlockViewModel)
|
||||||
{
|
{
|
||||||
return ItemFilterBlockViewModels.ToList().GetRange(ItemFilterBlockViewModels.IndexOf(targetBlockViewModel) + 1,
|
return ItemFilterBlockViewModels.ToList().GetRange(ItemFilterBlockViewModels.IndexOf(targetBlockViewModel) + 1,
|
||||||
(targetBlockViewModel as ItemFilterCommentBlockViewModel).ChildCount);
|
targetBlockViewModel.ChildCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<int> getChildrenIndexes(IItemFilterCommentBlockViewModel targetBlockViewModel)
|
private List<int> GetChildrenIndexes(IItemFilterCommentBlockViewModel targetBlockViewModel)
|
||||||
{
|
{
|
||||||
return Enumerable.Range(ItemFilterBlockViewModels.IndexOf(targetBlockViewModel) + 1,
|
return Enumerable.Range(ItemFilterBlockViewModels.IndexOf(targetBlockViewModel) + 1,
|
||||||
(targetBlockViewModel as ItemFilterCommentBlockViewModel).ChildCount).ToList();
|
targetBlockViewModel.ChildCount).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ValidateSelectedBlocks()
|
private void ValidateSelectedBlocks()
|
||||||
@@ -427,25 +437,16 @@ namespace Filtration.ViewModels
|
|||||||
public ObservableCollection<string> CustomSoundsAvailable
|
public ObservableCollection<string> CustomSoundsAvailable
|
||||||
{
|
{
|
||||||
get => _customSoundsAvailable;
|
get => _customSoundsAvailable;
|
||||||
set
|
private set
|
||||||
{
|
{
|
||||||
_customSoundsAvailable = value;
|
_customSoundsAvailable = value;
|
||||||
RaisePropertyChanged();
|
RaisePropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ListCollectionView ViewItemFilterBlockViewModels
|
public ListCollectionView ViewItemFilterBlockViewModels { get; private set; }
|
||||||
{
|
|
||||||
get => _viewItemFilterBlockViewModels;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ObservableCollection<IItemFilterBlockViewModelBase> ItemFilterBlockViewModels
|
public ObservableCollection<IItemFilterBlockViewModelBase> ItemFilterBlockViewModels { get; }
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _itemFilterBlockViewModels;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool BlockFilter(object item)
|
private bool BlockFilter(object item)
|
||||||
{
|
{
|
||||||
@@ -550,7 +551,7 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
public bool HasSelectedCommentBlock()
|
public bool HasSelectedCommentBlock()
|
||||||
{
|
{
|
||||||
return SelectedBlockViewModels.OfType<IItemFilterCommentBlockViewModel>().Count() > 0;
|
return SelectedBlockViewModels.OfType<IItemFilterCommentBlockViewModel>().Any();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanModifySelectedBlocks()
|
public bool CanModifySelectedBlocks()
|
||||||
@@ -581,18 +582,9 @@ namespace Filtration.ViewModels
|
|||||||
return itemFilterCommentBlock.ChildCount == itemFilterCommentBlock.VisibleChildCount;
|
return itemFilterCommentBlock.ChildCount == itemFilterCommentBlock.VisibleChildCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObservableCollection<IItemFilterBlockViewModelBase> SelectedBlockViewModels
|
public ObservableCollection<IItemFilterBlockViewModelBase> SelectedBlockViewModels { get; }
|
||||||
{
|
|
||||||
get => _selectedBlockViewModels;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IItemFilterBlockViewModelBase LastSelectedBlockViewModel
|
public IItemFilterBlockViewModelBase LastSelectedBlockViewModel => SelectedBlockViewModels.Count > 0 ? SelectedBlockViewModels.Last() : null;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return SelectedBlockViewModels.Count > 0 ? SelectedBlockViewModels.Last() : null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public IItemFilterCommentBlockViewModel CommentBlockBrowserBrowserSelectedBlockViewModel
|
public IItemFilterCommentBlockViewModel CommentBlockBrowserBrowserSelectedBlockViewModel
|
||||||
{
|
{
|
||||||
@@ -812,26 +804,33 @@ namespace Filtration.ViewModels
|
|||||||
switch (result)
|
switch (result)
|
||||||
{
|
{
|
||||||
case MessageBoxResult.Yes:
|
case MessageBoxResult.Yes:
|
||||||
{
|
{
|
||||||
await SaveAsync();
|
await SaveAsync();
|
||||||
CloseScript();
|
CloseScript();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MessageBoxResult.No:
|
case MessageBoxResult.No:
|
||||||
{
|
{
|
||||||
CloseScript();
|
CloseScript();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MessageBoxResult.Cancel:
|
case MessageBoxResult.Cancel:
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CloseScript()
|
private void CloseScript()
|
||||||
{
|
{
|
||||||
|
foreach (var disposable in Enumerable.Reverse(_subscriptions))
|
||||||
|
{
|
||||||
|
disposable.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
_subscriptions.Clear();
|
||||||
|
|
||||||
var openMasterThemForScript =
|
var openMasterThemForScript =
|
||||||
_avalonDockWorkspaceViewModel.OpenMasterThemeForScript(this);
|
_avalonDockWorkspaceViewModel.OpenMasterThemeForScript(this);
|
||||||
if (openMasterThemForScript != null)
|
if (openMasterThemForScript != null)
|
||||||
@@ -877,9 +876,9 @@ namespace Filtration.ViewModels
|
|||||||
foreach (var block in SelectedBlockViewModels.OfType<IItemFilterBlockViewModelBase>())
|
foreach (var block in SelectedBlockViewModels.OfType<IItemFilterBlockViewModelBase>())
|
||||||
{
|
{
|
||||||
blocksToCopy.Add(block);
|
blocksToCopy.Add(block);
|
||||||
if (block is IItemFilterCommentBlockViewModel && !(block as IItemFilterCommentBlockViewModel).IsExpanded)
|
if (block is IItemFilterCommentBlockViewModel model && !model.IsExpanded)
|
||||||
{
|
{
|
||||||
blocksToCopy.AddRange(getChildren(block as IItemFilterCommentBlockViewModel));
|
blocksToCopy.AddRange(GetChildren(model));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -896,14 +895,14 @@ namespace Filtration.ViewModels
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var blocksToCopy = new List<IItemFilterBlockViewModelBase> { targetBlockViewModelBase };
|
var blocksToCopy = new List<IItemFilterBlockViewModelBase> { targetBlockViewModelBase };
|
||||||
blocksToCopy.AddRange(getChildren(targetBlockViewModelBase as IItemFilterCommentBlockViewModel));
|
blocksToCopy.AddRange(GetChildren((IItemFilterCommentBlockViewModel)targetBlockViewModelBase));
|
||||||
CopyBlocks(blocksToCopy);
|
CopyBlocks(blocksToCopy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CopyBlocks(IEnumerable<IItemFilterBlockViewModelBase> targetBlockViewModels)
|
public void CopyBlocks(IEnumerable<IItemFilterBlockViewModelBase> targetBlockViewModels)
|
||||||
{
|
{
|
||||||
if (targetBlockViewModels.Count() < 1)
|
if (!targetBlockViewModels.Any())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -926,8 +925,7 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
private void OnCopyBlockStyleCommand()
|
private void OnCopyBlockStyleCommand()
|
||||||
{
|
{
|
||||||
var selectedBlockViewModel = LastSelectedBlockViewModel as IItemFilterBlockViewModel;
|
if (LastSelectedBlockViewModel is IItemFilterBlockViewModel selectedBlockViewModel)
|
||||||
if (selectedBlockViewModel != null)
|
|
||||||
{
|
{
|
||||||
CopyBlockStyle(selectedBlockViewModel);
|
CopyBlockStyle(selectedBlockViewModel);
|
||||||
}
|
}
|
||||||
@@ -958,8 +956,7 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
private void OnPasteBlockStyleCommand()
|
private void OnPasteBlockStyleCommand()
|
||||||
{
|
{
|
||||||
var selectedBlockViewModel = LastSelectedBlockViewModel as IItemFilterBlockViewModel;
|
if (LastSelectedBlockViewModel is IItemFilterBlockViewModel selectedBlockViewModel)
|
||||||
if (selectedBlockViewModel != null)
|
|
||||||
{
|
{
|
||||||
PasteBlockStyle(selectedBlockViewModel);
|
PasteBlockStyle(selectedBlockViewModel);
|
||||||
}
|
}
|
||||||
@@ -988,7 +985,7 @@ namespace Filtration.ViewModels
|
|||||||
if (commentBlock != null && !commentBlock.IsExpanded)
|
if (commentBlock != null && !commentBlock.IsExpanded)
|
||||||
{
|
{
|
||||||
targetBlockViewModelBase = ItemFilterBlockViewModels[ItemFilterBlockViewModels.IndexOf(targetBlockViewModelBase) +
|
targetBlockViewModelBase = ItemFilterBlockViewModels[ItemFilterBlockViewModels.IndexOf(targetBlockViewModelBase) +
|
||||||
(commentBlock as ItemFilterCommentBlockViewModel).ChildCount];
|
commentBlock.ChildCount];
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -1046,12 +1043,12 @@ namespace Filtration.ViewModels
|
|||||||
var indexToMove = ItemFilterBlockViewModels.IndexOf(
|
var indexToMove = ItemFilterBlockViewModels.IndexOf(
|
||||||
ViewItemFilterBlockViewModels.GetItemAt(blockIndex - 1) as IItemFilterBlockViewModelBase);
|
ViewItemFilterBlockViewModels.GetItemAt(blockIndex - 1) as IItemFilterBlockViewModelBase);
|
||||||
|
|
||||||
if (targetBlockViewModelBase is IItemFilterCommentBlockViewModel &&
|
if (targetBlockViewModelBase is IItemFilterCommentBlockViewModel model &&
|
||||||
!(targetBlockViewModelBase as IItemFilterCommentBlockViewModel).IsExpanded)
|
!model.IsExpanded)
|
||||||
{
|
{
|
||||||
ExecuteCommandAndSelectAdded(new MoveBlocksToIndexCommand(Script,
|
ExecuteCommandAndSelectAdded(new MoveBlocksToIndexCommand(Script,
|
||||||
Enumerable.Range(ItemFilterBlockViewModels.IndexOf(targetBlockViewModelBase),
|
Enumerable.Range(ItemFilterBlockViewModels.IndexOf(model),
|
||||||
(targetBlockViewModelBase as ItemFilterCommentBlockViewModel).ChildCount + 1).ToList(), indexToMove));
|
model.ChildCount + 1).ToList(), indexToMove));
|
||||||
if (_lastAddedBlocks.Count > 0)
|
if (_lastAddedBlocks.Count > 0)
|
||||||
{
|
{
|
||||||
ToggleSection(_lastAddedBlocks[0] as IItemFilterCommentBlockViewModel);
|
ToggleSection(_lastAddedBlocks[0] as IItemFilterCommentBlockViewModel);
|
||||||
@@ -1067,8 +1064,8 @@ namespace Filtration.ViewModels
|
|||||||
ExecuteCommandAndSelectAdded(new MoveBlocksToIndexCommand(Script, targetBlockViewModelBase.BaseBlock, indexToMove));
|
ExecuteCommandAndSelectAdded(new MoveBlocksToIndexCommand(Script, targetBlockViewModelBase.BaseBlock, indexToMove));
|
||||||
}
|
}
|
||||||
|
|
||||||
SetDirtyFlag();
|
SetDirtyFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnMoveBlockDownCommand()
|
private void OnMoveBlockDownCommand()
|
||||||
{
|
{
|
||||||
@@ -1088,13 +1085,13 @@ namespace Filtration.ViewModels
|
|||||||
indexToMove += (belowBlock as ItemFilterCommentBlockViewModel).ChildCount;
|
indexToMove += (belowBlock as ItemFilterCommentBlockViewModel).ChildCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetBlockViewModelBase is IItemFilterCommentBlockViewModel &&
|
if (targetBlockViewModelBase is IItemFilterCommentBlockViewModel model &&
|
||||||
!(targetBlockViewModelBase as IItemFilterCommentBlockViewModel).IsExpanded)
|
!model.IsExpanded)
|
||||||
{
|
{
|
||||||
indexToMove -= (targetBlockViewModelBase as ItemFilterCommentBlockViewModel).ChildCount;
|
indexToMove -= model.ChildCount;
|
||||||
ExecuteCommandAndSelectAdded(new MoveBlocksToIndexCommand(Script,
|
ExecuteCommandAndSelectAdded(new MoveBlocksToIndexCommand(Script,
|
||||||
Enumerable.Range(ItemFilterBlockViewModels.IndexOf(targetBlockViewModelBase),
|
Enumerable.Range(ItemFilterBlockViewModels.IndexOf(model),
|
||||||
(targetBlockViewModelBase as ItemFilterCommentBlockViewModel).ChildCount + 1).ToList(), indexToMove));
|
model.ChildCount + 1).ToList(), indexToMove));
|
||||||
if (_lastAddedBlocks.Count > 0)
|
if (_lastAddedBlocks.Count > 0)
|
||||||
{
|
{
|
||||||
ToggleSection(_lastAddedBlocks[0] as IItemFilterCommentBlockViewModel);
|
ToggleSection(_lastAddedBlocks[0] as IItemFilterCommentBlockViewModel);
|
||||||
@@ -1119,15 +1116,14 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
public void AddBlock(IItemFilterBlockViewModelBase targetBlockViewModelBase)
|
public void AddBlock(IItemFilterBlockViewModelBase targetBlockViewModelBase)
|
||||||
{
|
{
|
||||||
if (targetBlockViewModelBase is IItemFilterCommentBlockViewModel && !(targetBlockViewModelBase as IItemFilterCommentBlockViewModel).IsExpanded)
|
if (targetBlockViewModelBase is IItemFilterCommentBlockViewModel model && !model.IsExpanded)
|
||||||
{
|
{
|
||||||
ToggleSection(targetBlockViewModelBase as IItemFilterCommentBlockViewModel);
|
ToggleSection(model);
|
||||||
targetBlockViewModelBase = ItemFilterBlockViewModels[ItemFilterBlockViewModels.IndexOf(targetBlockViewModelBase) +
|
targetBlockViewModelBase = ItemFilterBlockViewModels[ItemFilterBlockViewModels.IndexOf(targetBlockViewModelBase) + model.ChildCount];
|
||||||
(targetBlockViewModelBase as ItemFilterCommentBlockViewModel).ChildCount];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ExecuteCommandAndSelectAdded(new AddBlockCommand(Script, targetBlockViewModelBase?.BaseBlock));
|
ExecuteCommandAndSelectAdded(new AddBlockCommand(Script, targetBlockViewModelBase?.BaseBlock));
|
||||||
SetDirtyFlag();
|
SetDirtyFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnAddCommentBlockCommand()
|
private void OnAddCommentBlockCommand()
|
||||||
@@ -1155,7 +1151,7 @@ namespace Filtration.ViewModels
|
|||||||
blocksToDelete.Add(block);
|
blocksToDelete.Add(block);
|
||||||
if (block is IItemFilterCommentBlockViewModel && !(block as IItemFilterCommentBlockViewModel).IsExpanded)
|
if (block is IItemFilterCommentBlockViewModel && !(block as IItemFilterCommentBlockViewModel).IsExpanded)
|
||||||
{
|
{
|
||||||
blocksToDelete.AddRange(getChildren(block as IItemFilterCommentBlockViewModel));
|
blocksToDelete.AddRange(GetChildren(block as IItemFilterCommentBlockViewModel));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1212,7 +1208,7 @@ namespace Filtration.ViewModels
|
|||||||
_scriptCommandManager.ExecuteCommand(new MoveBlocksToBottomCommand(Script, targetBlockViewModelBase.BaseBlock));
|
_scriptCommandManager.ExecuteCommand(new MoveBlocksToBottomCommand(Script, targetBlockViewModelBase.BaseBlock));
|
||||||
}
|
}
|
||||||
|
|
||||||
SetDirtyFlag();
|
SetDirtyFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveBlocksToBottom(IEnumerable<IItemFilterBlockViewModelBase> targetCommentBlockViewModels)
|
public void MoveBlocksToBottom(IEnumerable<IItemFilterBlockViewModelBase> targetCommentBlockViewModels)
|
||||||
@@ -1223,7 +1219,7 @@ namespace Filtration.ViewModels
|
|||||||
sourceIndexes.Add(ItemFilterBlockViewModels.IndexOf(block));
|
sourceIndexes.Add(ItemFilterBlockViewModels.IndexOf(block));
|
||||||
if (block is IItemFilterCommentBlockViewModel && !(block as IItemFilterCommentBlockViewModel).IsExpanded)
|
if (block is IItemFilterCommentBlockViewModel && !(block as IItemFilterCommentBlockViewModel).IsExpanded)
|
||||||
{
|
{
|
||||||
sourceIndexes.AddRange(getChildrenIndexes(block as IItemFilterCommentBlockViewModel));
|
sourceIndexes.AddRange(GetChildrenIndexes(block as IItemFilterCommentBlockViewModel));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1246,11 +1242,11 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
public void MoveBlockToTop(IItemFilterBlockViewModelBase targetBlockViewModelBase)
|
public void MoveBlockToTop(IItemFilterBlockViewModelBase targetBlockViewModelBase)
|
||||||
{
|
{
|
||||||
if (targetBlockViewModelBase is IItemFilterCommentBlockViewModel && !(targetBlockViewModelBase as IItemFilterCommentBlockViewModel).IsExpanded)
|
if (targetBlockViewModelBase is IItemFilterCommentBlockViewModel model && !model.IsExpanded)
|
||||||
{
|
{
|
||||||
ExecuteCommandAndSelectAdded(new MoveBlocksToTopCommand(Script,
|
ExecuteCommandAndSelectAdded(new MoveBlocksToTopCommand(Script,
|
||||||
Enumerable.Range(ItemFilterBlockViewModels.IndexOf(targetBlockViewModelBase),
|
Enumerable.Range(ItemFilterBlockViewModels.IndexOf(model),
|
||||||
(targetBlockViewModelBase as ItemFilterCommentBlockViewModel).ChildCount + 1).ToList()));
|
model.ChildCount + 1).ToList()));
|
||||||
if (_lastAddedBlocks.Count > 0)
|
if (_lastAddedBlocks.Count > 0)
|
||||||
{
|
{
|
||||||
ToggleSection(_lastAddedBlocks[0] as IItemFilterCommentBlockViewModel);
|
ToggleSection(_lastAddedBlocks[0] as IItemFilterCommentBlockViewModel);
|
||||||
@@ -1270,23 +1266,23 @@ namespace Filtration.ViewModels
|
|||||||
foreach (var block in targetCommentBlockViewModels)
|
foreach (var block in targetCommentBlockViewModels)
|
||||||
{
|
{
|
||||||
sourceIndexes.Add(ItemFilterBlockViewModels.IndexOf(block));
|
sourceIndexes.Add(ItemFilterBlockViewModels.IndexOf(block));
|
||||||
if (block is IItemFilterCommentBlockViewModel && !(block as IItemFilterCommentBlockViewModel).IsExpanded)
|
if (block is IItemFilterCommentBlockViewModel model && !model.IsExpanded)
|
||||||
{
|
{
|
||||||
sourceIndexes.AddRange(getChildrenIndexes(block as IItemFilterCommentBlockViewModel));
|
sourceIndexes.AddRange(GetChildrenIndexes(model));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ExecuteCommandAndSelectAdded(new MoveBlocksToTopCommand(Script, sourceIndexes));
|
ExecuteCommandAndSelectAdded(new MoveBlocksToTopCommand(Script, sourceIndexes));
|
||||||
for (var i = 0; i < sourceIndexes.Count; i++)
|
for (var i = 0; i < sourceIndexes.Count; i++)
|
||||||
{
|
{
|
||||||
if (ItemFilterBlockViewModels[i] as IItemFilterCommentBlockViewModel != null)
|
if (ItemFilterBlockViewModels[i] is IItemFilterCommentBlockViewModel model)
|
||||||
{
|
{
|
||||||
ToggleSection(ItemFilterBlockViewModels[i] as IItemFilterCommentBlockViewModel);
|
ToggleSection(model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetDirtyFlag();
|
SetDirtyFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnBlockBecameDirty(object sender, EventArgs e)
|
private void OnBlockBecameDirty(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -1313,11 +1309,11 @@ namespace Filtration.ViewModels
|
|||||||
{
|
{
|
||||||
foreach (var block in SelectedBlockViewModels)
|
foreach (var block in SelectedBlockViewModels)
|
||||||
{
|
{
|
||||||
if (block is IItemFilterCommentBlockViewModel)
|
if (block is IItemFilterCommentBlockViewModel model)
|
||||||
{
|
{
|
||||||
if (!(block as IItemFilterCommentBlockViewModel).IsExpanded)
|
if (!model.IsExpanded)
|
||||||
{
|
{
|
||||||
foreach (var child in getChildren(block as IItemFilterCommentBlockViewModel))
|
foreach (var child in GetChildren(model))
|
||||||
{
|
{
|
||||||
((IItemFilterBlockViewModel)child).BlockEnabled = false;
|
((IItemFilterBlockViewModel)child).BlockEnabled = false;
|
||||||
}
|
}
|
||||||
@@ -1334,11 +1330,11 @@ namespace Filtration.ViewModels
|
|||||||
{
|
{
|
||||||
foreach (var block in SelectedBlockViewModels)
|
foreach (var block in SelectedBlockViewModels)
|
||||||
{
|
{
|
||||||
if (block is IItemFilterCommentBlockViewModel)
|
if (block is IItemFilterCommentBlockViewModel model)
|
||||||
{
|
{
|
||||||
if (!(block as IItemFilterCommentBlockViewModel).IsExpanded)
|
if (!model.IsExpanded)
|
||||||
{
|
{
|
||||||
foreach (var child in getChildren(block as IItemFilterCommentBlockViewModel))
|
foreach (var child in GetChildren(model))
|
||||||
{
|
{
|
||||||
((IItemFilterBlockViewModel)child).BlockEnabled = true;
|
((IItemFilterBlockViewModel)child).BlockEnabled = true;
|
||||||
}
|
}
|
||||||
@@ -1355,7 +1351,7 @@ namespace Filtration.ViewModels
|
|||||||
{
|
{
|
||||||
foreach (var block in SelectedBlockViewModels.OfType<IItemFilterCommentBlockViewModel>())
|
foreach (var block in SelectedBlockViewModels.OfType<IItemFilterCommentBlockViewModel>())
|
||||||
{
|
{
|
||||||
foreach (var child in getChildren(block as IItemFilterCommentBlockViewModel))
|
foreach (var child in GetChildren(block))
|
||||||
{
|
{
|
||||||
((IItemFilterBlockViewModel)child).BlockEnabled = false;
|
((IItemFilterBlockViewModel)child).BlockEnabled = false;
|
||||||
}
|
}
|
||||||
@@ -1366,7 +1362,7 @@ namespace Filtration.ViewModels
|
|||||||
{
|
{
|
||||||
foreach (var block in SelectedBlockViewModels.OfType<IItemFilterCommentBlockViewModel>())
|
foreach (var block in SelectedBlockViewModels.OfType<IItemFilterCommentBlockViewModel>())
|
||||||
{
|
{
|
||||||
foreach (var child in getChildren(block as IItemFilterCommentBlockViewModel))
|
foreach (var child in GetChildren(block))
|
||||||
{
|
{
|
||||||
((IItemFilterBlockViewModel)child).BlockEnabled = true;
|
((IItemFilterBlockViewModel)child).BlockEnabled = true;
|
||||||
}
|
}
|
||||||
@@ -1399,7 +1395,7 @@ namespace Filtration.ViewModels
|
|||||||
{
|
{
|
||||||
var newState = !targetCommentBlockViewModelBase.IsExpanded;
|
var newState = !targetCommentBlockViewModelBase.IsExpanded;
|
||||||
targetCommentBlockViewModelBase.IsExpanded = newState;
|
targetCommentBlockViewModelBase.IsExpanded = newState;
|
||||||
foreach (var child in getChildren(targetCommentBlockViewModelBase))
|
foreach (var child in GetChildren(targetCommentBlockViewModelBase))
|
||||||
{
|
{
|
||||||
child.IsVisible = newState;
|
child.IsVisible = newState;
|
||||||
}
|
}
|
||||||
@@ -1414,15 +1410,11 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
private void CollapseAllSections()
|
private void CollapseAllSections()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < ItemFilterBlockViewModels.Count; i++)
|
foreach (var model in ItemFilterBlockViewModels.OfType<IItemFilterCommentBlockViewModel>())
|
||||||
{
|
{
|
||||||
var block = ItemFilterBlockViewModels[i] as IItemFilterCommentBlockViewModel;
|
if (model.IsExpanded)
|
||||||
if (block != null)
|
|
||||||
{
|
{
|
||||||
if(block.IsExpanded)
|
ToggleSection(model, true);
|
||||||
{
|
|
||||||
ToggleSection(block, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1433,12 +1425,11 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
private void ExpandAllSections()
|
private void ExpandAllSections()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < ItemFilterBlockViewModels.Count; i++)
|
foreach (var model in ItemFilterBlockViewModels.OfType<IItemFilterCommentBlockViewModel>())
|
||||||
{
|
{
|
||||||
var block = ItemFilterBlockViewModels[i] as IItemFilterCommentBlockViewModel;
|
if (!model.IsExpanded)
|
||||||
if (block != null && !block.IsExpanded)
|
|
||||||
{
|
{
|
||||||
ToggleSection(block, true);
|
ToggleSection(model, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ namespace Filtration.ViewModels
|
|||||||
private readonly IItemFilterScriptTranslator _itemFilterScriptTranslator;
|
private readonly IItemFilterScriptTranslator _itemFilterScriptTranslator;
|
||||||
private readonly IReplaceColorsViewModel _replaceColorsViewModel;
|
private readonly IReplaceColorsViewModel _replaceColorsViewModel;
|
||||||
private readonly IAvalonDockWorkspaceViewModel _avalonDockWorkspaceViewModel;
|
private readonly IAvalonDockWorkspaceViewModel _avalonDockWorkspaceViewModel;
|
||||||
|
private readonly IScriptLoadingService _scriptLoadingService;
|
||||||
private readonly IThemeProvider _themeProvider;
|
private readonly IThemeProvider _themeProvider;
|
||||||
private readonly IThemeService _themeService;
|
private readonly IThemeService _themeService;
|
||||||
private readonly IMessageBoxService _messageBoxService;
|
private readonly IMessageBoxService _messageBoxService;
|
||||||
@@ -63,6 +64,7 @@ namespace Filtration.ViewModels
|
|||||||
IItemFilterScriptTranslator itemFilterScriptTranslator,
|
IItemFilterScriptTranslator itemFilterScriptTranslator,
|
||||||
IReplaceColorsViewModel replaceColorsViewModel,
|
IReplaceColorsViewModel replaceColorsViewModel,
|
||||||
IAvalonDockWorkspaceViewModel avalonDockWorkspaceViewModel,
|
IAvalonDockWorkspaceViewModel avalonDockWorkspaceViewModel,
|
||||||
|
IScriptLoadingService scriptLoadingService,
|
||||||
ISettingsPageViewModel settingsPageViewModel,
|
ISettingsPageViewModel settingsPageViewModel,
|
||||||
IThemeProvider themeProvider,
|
IThemeProvider themeProvider,
|
||||||
IThemeService themeService,
|
IThemeService themeService,
|
||||||
@@ -75,6 +77,7 @@ namespace Filtration.ViewModels
|
|||||||
_itemFilterScriptTranslator = itemFilterScriptTranslator;
|
_itemFilterScriptTranslator = itemFilterScriptTranslator;
|
||||||
_replaceColorsViewModel = replaceColorsViewModel;
|
_replaceColorsViewModel = replaceColorsViewModel;
|
||||||
_avalonDockWorkspaceViewModel = avalonDockWorkspaceViewModel;
|
_avalonDockWorkspaceViewModel = avalonDockWorkspaceViewModel;
|
||||||
|
_scriptLoadingService = scriptLoadingService;
|
||||||
SettingsPageViewModel = settingsPageViewModel;
|
SettingsPageViewModel = settingsPageViewModel;
|
||||||
_themeProvider = themeProvider;
|
_themeProvider = themeProvider;
|
||||||
_themeService = themeService;
|
_themeService = themeService;
|
||||||
@@ -204,10 +207,6 @@ namespace Filtration.ViewModels
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(Settings.Default.LastOpenScripts))
|
|
||||||
{
|
|
||||||
LoadScriptsAsync(Settings.Default.LastOpenScripts.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public RelayCommand OpenScriptCommand { get; }
|
public RelayCommand OpenScriptCommand { get; }
|
||||||
@@ -369,12 +368,12 @@ namespace Filtration.ViewModels
|
|||||||
{
|
{
|
||||||
case ".FILTER":
|
case ".FILTER":
|
||||||
{
|
{
|
||||||
await LoadScriptAsync(filename);
|
await _scriptLoadingService.LoadScriptAsync(filename);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ".FILTERTHEME":
|
case ".FILTERTHEME":
|
||||||
{
|
{
|
||||||
await LoadThemeAsync(filename);
|
await _scriptLoadingService.LoadThemeAsync(filename);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -431,43 +430,7 @@ namespace Filtration.ViewModels
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await LoadScriptAsync(filePath); // TODO: fix crash
|
await _scriptLoadingService.LoadScriptAsync(filePath);
|
||||||
}
|
|
||||||
|
|
||||||
private async Task LoadScriptsAsync(string[] files)
|
|
||||||
{
|
|
||||||
foreach (var file in files)
|
|
||||||
{
|
|
||||||
if (File.Exists(file))
|
|
||||||
{
|
|
||||||
await LoadScriptAsync(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task LoadScriptAsync(string scriptFilename)
|
|
||||||
{
|
|
||||||
IItemFilterScriptViewModel loadedViewModel;
|
|
||||||
|
|
||||||
Messenger.Default.Send(new NotificationMessage("ShowLoadingBanner"));
|
|
||||||
try
|
|
||||||
{
|
|
||||||
loadedViewModel = await _itemFilterScriptRepository.LoadScriptFromFileAsync(scriptFilename);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Logger.Error(e);
|
|
||||||
_messageBoxService.Show("Script Load Error", "Error loading filter script - " + e.Message,
|
|
||||||
MessageBoxButton.OK,
|
|
||||||
MessageBoxImage.Error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Messenger.Default.Send(new NotificationMessage("HideLoadingBanner"));
|
|
||||||
}
|
|
||||||
|
|
||||||
_avalonDockWorkspaceViewModel.AddDocument(loadedViewModel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnOpenThemeCommandAsync()
|
private async Task OnOpenThemeCommandAsync()
|
||||||
@@ -478,27 +441,7 @@ namespace Filtration.ViewModels
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await LoadThemeAsync(filePath);
|
await _scriptLoadingService.LoadThemeAsync(filePath);
|
||||||
}
|
|
||||||
|
|
||||||
private async Task LoadThemeAsync(string themeFilename)
|
|
||||||
{
|
|
||||||
IThemeEditorViewModel loadedViewModel;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
loadedViewModel = await _themeProvider.LoadThemeFromFile(themeFilename);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Logger.Error(e);
|
|
||||||
_messageBoxService.Show("Theme Load Error", "Error loading filter theme - " + e.Message,
|
|
||||||
MessageBoxButton.OK,
|
|
||||||
MessageBoxImage.Error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_avalonDockWorkspaceViewModel.AddDocument(loadedViewModel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnApplyThemeToScriptCommandAsync()
|
private async Task OnApplyThemeToScriptCommandAsync()
|
||||||
|
|||||||
@@ -10,8 +10,9 @@ namespace Filtration.ViewModels
|
|||||||
RelayCommand SetItemFilterScriptDirectoryCommand { get; }
|
RelayCommand SetItemFilterScriptDirectoryCommand { get; }
|
||||||
|
|
||||||
string DefaultFilterDirectory { get; }
|
string DefaultFilterDirectory { get; }
|
||||||
bool ExtraLineBetweenBlocks { get; set; }
|
bool BlocksExpandedOnOpen { get; set; }
|
||||||
bool DownloadPrereleaseUpdates { get; set; }
|
bool DownloadPrereleaseUpdates { get; set; }
|
||||||
|
bool ExtraLineBetweenBlocks { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class SettingsPageViewModel : ViewModelBase, ISettingsPageViewModel
|
internal class SettingsPageViewModel : ViewModelBase, ISettingsPageViewModel
|
||||||
@@ -28,10 +29,10 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
public string DefaultFilterDirectory => Settings.Default.DefaultFilterDirectory;
|
public string DefaultFilterDirectory => Settings.Default.DefaultFilterDirectory;
|
||||||
|
|
||||||
public bool ExtraLineBetweenBlocks
|
public bool BlocksExpandedOnOpen
|
||||||
{
|
{
|
||||||
get => Settings.Default.ExtraLineBetweenBlocks;
|
get => Settings.Default.BlocksExpandedOnOpen;
|
||||||
set => Settings.Default.ExtraLineBetweenBlocks = value;
|
set => Settings.Default.BlocksExpandedOnOpen = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DownloadPrereleaseUpdates
|
public bool DownloadPrereleaseUpdates
|
||||||
@@ -40,6 +41,12 @@ namespace Filtration.ViewModels
|
|||||||
set => Settings.Default.DownloadPrereleaseUpdates = value;
|
set => Settings.Default.DownloadPrereleaseUpdates = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool ExtraLineBetweenBlocks
|
||||||
|
{
|
||||||
|
get => Settings.Default.ExtraLineBetweenBlocks;
|
||||||
|
set => Settings.Default.ExtraLineBetweenBlocks = value;
|
||||||
|
}
|
||||||
|
|
||||||
private void OnSetItemFilterScriptDirectoryCommand()
|
private void OnSetItemFilterScriptDirectoryCommand()
|
||||||
{
|
{
|
||||||
_itemFilterScriptDirectoryService.SetItemFilterScriptDirectory();
|
_itemFilterScriptDirectoryService.SetItemFilterScriptDirectory();
|
||||||
|
|||||||
@@ -3,43 +3,39 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
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:userControls="clr-namespace:Filtration.UserControls"
|
xmlns:userControls="clr-namespace:Filtration.UserControls"
|
||||||
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
|
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
|
||||||
xmlns:views="clr-namespace:Filtration.Views"
|
xmlns:views="clr-namespace:Filtration.Views"
|
||||||
xmlns:converters="clr-namespace:Filtration.Converters"
|
xmlns:converters="clr-namespace:Filtration.Converters"
|
||||||
xmlns:blockItemBaseTypes="clr-namespace:Filtration.ObjectModel.BlockItemBaseTypes;assembly=Filtration.ObjectModel"
|
xmlns:blockItemBaseTypes="clr-namespace:Filtration.ObjectModel.BlockItemBaseTypes;assembly=Filtration.ObjectModel"
|
||||||
xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
|
xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
|
||||||
|
xmlns:designTime="clr-namespace:Filtration.ViewModels.DesignTime"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DataContext="{d:DesignInstance Type=viewModels:ItemFilterBlockViewModel}"
|
d:DataContext="{d:DesignInstance Type=designTime:DesignTimeItemFilterBlockViewModel, IsDesignTimeCreatable=True}"
|
||||||
d:DesignHeight="200" d:DesignWidth="800">
|
d:DesignHeight="400" d:DesignWidth="817">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<views:BindingProxy x:Key="Proxy" Data="{Binding}" />
|
||||||
<ResourceDictionary>
|
<converters:BlockGroupAdvancedFillColorConverter x:Key="BlockGroupAdvancedFillColorConverter" />
|
||||||
<views:BindingProxy x:Key="Proxy" Data="{Binding}" />
|
<converters:MinimapIconToCroppedBitmapConverter x:Key="MinimapIconToCroppedBitmapConverter"/>
|
||||||
<converters:BlockGroupAdvancedFillColorConverter x:Key="BlockGroupAdvancedFillColorConverter" />
|
<Style TargetType="{x:Type ContentPresenter}" x:Key="BlockItemFadeInStyle">
|
||||||
<converters:MinimapIconToCroppedBitmapConverter x:Key="MinimapIconToCroppedBitmapConverter"/>
|
<Setter Property="LayoutTransform">
|
||||||
<Style TargetType="{x:Type ContentPresenter}" x:Key="BlockItemFadeInStyle">
|
<Setter.Value>
|
||||||
<Setter Property="LayoutTransform">
|
<ScaleTransform x:Name="transform" />
|
||||||
<Setter.Value>
|
</Setter.Value>
|
||||||
<ScaleTransform x:Name="transform" />
|
</Setter>
|
||||||
</Setter.Value>
|
<Style.Triggers>
|
||||||
</Setter>
|
<EventTrigger RoutedEvent="Loaded">
|
||||||
<Style.Triggers>
|
<EventTrigger.Actions>
|
||||||
<EventTrigger RoutedEvent="Loaded">
|
<BeginStoryboard>
|
||||||
<EventTrigger.Actions>
|
<Storyboard>
|
||||||
<BeginStoryboard>
|
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.5" />
|
||||||
<Storyboard>
|
</Storyboard>
|
||||||
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.5" />
|
</BeginStoryboard>
|
||||||
</Storyboard>
|
</EventTrigger.Actions>
|
||||||
</BeginStoryboard>
|
</EventTrigger>
|
||||||
</EventTrigger.Actions>
|
</Style.Triggers>
|
||||||
</EventTrigger>
|
</Style>
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</ResourceDictionary>
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid x:Name="TopLevelGrid">
|
<Grid x:Name="TopLevelGrid">
|
||||||
@@ -99,7 +95,7 @@
|
|||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<!-- BlockItems Summary Panel -->
|
<!-- BlockItems Summary Panel -->
|
||||||
<StackPanel Grid.Row="0" Grid.Column="0" VerticalAlignment="Center">
|
<StackPanel Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="0,5">
|
||||||
<StackPanel.Resources>
|
<StackPanel.Resources>
|
||||||
<CollectionViewSource Source="{Binding SummaryBlockItems}" x:Key="SummaryBlockItemsCollectionViewSource">
|
<CollectionViewSource Source="{Binding SummaryBlockItems}" x:Key="SummaryBlockItemsCollectionViewSource">
|
||||||
<CollectionViewSource.SortDescriptions>
|
<CollectionViewSource.SortDescriptions>
|
||||||
@@ -121,9 +117,9 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate DataType="{x:Type blockItemBaseTypes:ActionBlockItem}">
|
<DataTemplate DataType="{x:Type blockItemBaseTypes:ActionBlockItem}">
|
||||||
<Button Command="{Binding ElementName=TopLevelGrid, Path=DataContext.ToggleBlockActionCommand}" Style="{StaticResource ChromelessButton}">
|
<Button Command="{Binding ElementName=TopLevelGrid, Path=DataContext.ToggleBlockActionCommand}" Style="{StaticResource ChromelessButton}">
|
||||||
<Border BorderBrush="Black" CornerRadius="4" Margin="0,2,2,2" BorderThickness="1" Background="{Binding SummaryBackgroundColor, Converter={StaticResource ColorToSolidColorBrushConverter}}">
|
<Border BorderBrush="Black" CornerRadius="4" Margin="0,2,2,2" BorderThickness="1" Background="{Binding SummaryBackgroundColor, Converter={StaticResource ColorToSolidColorBrushConverter}}">
|
||||||
<TextBlock Text="{Binding SummaryText}" Margin="5,1,5,1" Foreground="{Binding SummaryTextColor, Converter={StaticResource ColorToSolidColorBrushConverter}}" />
|
<TextBlock Text="{Binding SummaryText}" Margin="5,1,5,1" Foreground="{Binding SummaryTextColor, Converter={StaticResource ColorToSolidColorBrushConverter}}" />
|
||||||
</Border>
|
</Border>
|
||||||
</Button>
|
</Button>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.Resources>
|
</ItemsControl.Resources>
|
||||||
@@ -199,9 +195,9 @@
|
|||||||
</Expander.Header>
|
</Expander.Header>
|
||||||
<Grid Margin="10,5,10,5" x:Name="BlockItemsGrid">
|
<Grid Margin="10,5,10,5" x:Name="BlockItemsGrid">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<WrapPanel Grid.Row="0">
|
<WrapPanel Grid.Row="0">
|
||||||
@@ -241,23 +237,77 @@
|
|||||||
ToolTip="Add" Background="Transparent" BorderThickness="0" Margin="3,0,0,0" />
|
ToolTip="Add" Background="Transparent" BorderThickness="0" Margin="3,0,0,0" />
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
|
|
||||||
|
<!-- Regular Block Items-->
|
||||||
<Grid Grid.Row="1" Visibility="{Binding AudioVisualBlockItemsGridVisible, Converter={StaticResource InverseBooleanVisibilityConverter}}">
|
<Grid Grid.Row="1" Visibility="{Binding AudioVisualBlockItemsGridVisible, Converter={StaticResource InverseBooleanVisibilityConverter}}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Right">
|
|
||||||
<Hyperlink Command="{Binding SwitchBlockItemsViewCommand}">
|
|
||||||
Switch to Appearance Block Items
|
|
||||||
</Hyperlink>
|
|
||||||
</TextBlock>
|
|
||||||
|
|
||||||
<!-- Add Block Item Links -->
|
<!-- Add Block Item Links -->
|
||||||
<ItemsControl Grid.Column="0" ItemsSource="{Binding BlockItemTypesAvailable}" Grid.Row="0" Margin="0,0,0,10">
|
<ItemsControl Grid.Column="0" ItemsSource="{Binding BlockItemTypesAvailable}" Grid.Row="0" Margin="0,0,0,10">
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<WrapPanel />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Margin="0,0,3,0">
|
||||||
|
<Hyperlink Command="{Binding ElementName=TopLevelGrid, Path=DataContext.AddFilterBlockItemCommand}" CommandParameter="{Binding}">
|
||||||
|
<TextBlock>+</TextBlock><TextBlock Text="{Binding Path=., Converter={StaticResource BlockItemTypeToStringConverter}}" />
|
||||||
|
</Hyperlink>
|
||||||
|
</TextBlock>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
|
||||||
|
<!-- Enable/Disable Block Button -->
|
||||||
|
<userControls:EnableDisableToggleButton Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" />
|
||||||
|
|
||||||
|
<!-- Block Items -->
|
||||||
|
<Grid Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" MaxHeight="200">
|
||||||
|
<Grid.Resources>
|
||||||
|
<CollectionViewSource Source="{Binding RegularBlockItems}" x:Key="BlockItemsCollectionViewSource">
|
||||||
|
<CollectionViewSource.SortDescriptions>
|
||||||
|
<componentModel:SortDescription PropertyName="SortOrder"/>
|
||||||
|
</CollectionViewSource.SortDescriptions>
|
||||||
|
</CollectionViewSource>
|
||||||
|
</Grid.Resources>
|
||||||
|
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
|
||||||
|
<ItemsControl ItemsSource="{Binding Source={StaticResource BlockItemsCollectionViewSource}}"
|
||||||
|
ItemContainerStyle="{StaticResource BlockItemFadeInStyle}">
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<WrapPanel Orientation="Vertical" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<userControls:BlockItemControl BlockItem="{Binding}" RemoveItemCommand="{Binding ElementName=TopLevelGrid, Path=DataContext.RemoveFilterBlockItemCommand}" RemoveEnabled="{Binding Path=., Converter={StaticResource BlockItemToRemoveEnabledVisibilityConverter}}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Audio/Visual Block Items-->
|
||||||
|
<Grid Grid.Row="1" Visibility="{Binding AudioVisualBlockItemsGridVisible, Converter={StaticResource BooleanVisibilityConverter}}">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!-- Add AudioVisual Block Item Links -->
|
||||||
|
<ItemsControl Grid.Column="0" ItemsSource="{Binding AudioVisualBlockItemTypesAvailable}" Grid.Row="0" Margin="0,0,0,10">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<WrapPanel></WrapPanel>
|
<WrapPanel></WrapPanel>
|
||||||
@@ -275,116 +325,56 @@
|
|||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
|
|
||||||
<!-- Enable/Disable Block Button -->
|
<!-- Enable/Disable Block Button -->
|
||||||
<ToggleButton Grid.Row="0"
|
<userControls:EnableDisableToggleButton Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" />
|
||||||
Grid.Column="1"
|
|
||||||
Style="{StaticResource ChromelessToggleButton}"
|
<TextBlock Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" FontStyle="Italic" HorizontalAlignment="Left" Visibility="{Binding HasAudioVisualBlockItems, Converter={StaticResource InverseBooleanVisibilityConverter}}">To change the appearance of this block, add a Text, Background or Border Block Item above.</TextBlock>
|
||||||
IsChecked="{Binding BlockEnabled}"
|
|
||||||
Margin="0,0,5,0"
|
|
||||||
ToolTip="Enable/Disable Block"
|
|
||||||
Cursor="Hand"
|
|
||||||
Width="25"
|
|
||||||
Height="25">
|
|
||||||
<Image RenderOptions.BitmapScalingMode="HighQuality">
|
|
||||||
<Image.Style>
|
|
||||||
<Style TargetType="{x:Type Image}">
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding BlockEnabled}" Value="true">
|
|
||||||
<Setter Property="Source" Value="/Filtration;component/Resources/Icons/standby_enabled_icon.png"/>
|
|
||||||
</DataTrigger>
|
|
||||||
<DataTrigger Binding="{Binding BlockEnabled}" Value="false">
|
|
||||||
<Setter Property="Source" Value="/Filtration;component/Resources/Icons/standby_disabled_icon.png"/>
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</Image.Style>
|
|
||||||
</Image>
|
|
||||||
</ToggleButton>
|
|
||||||
|
|
||||||
<!-- Block Items -->
|
<!-- Block Items -->
|
||||||
<WrapPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" MaxHeight="200">
|
<Grid Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" MaxHeight="200">
|
||||||
<WrapPanel.Resources>
|
<Grid.Resources>
|
||||||
<CollectionViewSource Source="{Binding RegularBlockItems}" x:Key="BlockItemsCollectionViewSource">
|
|
||||||
<CollectionViewSource.SortDescriptions>
|
|
||||||
<componentModel:SortDescription PropertyName="SortOrder"/>
|
|
||||||
</CollectionViewSource.SortDescriptions>
|
|
||||||
</CollectionViewSource>
|
|
||||||
</WrapPanel.Resources>
|
|
||||||
<ItemsControl ItemsSource="{Binding Source={StaticResource BlockItemsCollectionViewSource}}"
|
|
||||||
ItemContainerStyle="{StaticResource BlockItemFadeInStyle}">
|
|
||||||
<ItemsControl.ItemsPanel>
|
|
||||||
<ItemsPanelTemplate>
|
|
||||||
<WrapPanel Orientation="Vertical" />
|
|
||||||
</ItemsPanelTemplate>
|
|
||||||
</ItemsControl.ItemsPanel>
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<userControls:BlockItemControl BlockItem="{Binding}" RemoveItemCommand="{Binding ElementName=TopLevelGrid, Path=DataContext.RemoveFilterBlockItemCommand}" RemoveEnabled="{Binding Path=., Converter={StaticResource BlockItemToRemoveEnabledVisibilityConverter}}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</WrapPanel>
|
|
||||||
</Grid>
|
|
||||||
<Grid Grid.Row="1" Visibility="{Binding AudioVisualBlockItemsGridVisible, Converter={StaticResource BooleanVisibilityConverter}}">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition />
|
|
||||||
<RowDefinition />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Right">
|
|
||||||
<Hyperlink Command="{Binding SwitchBlockItemsViewCommand}">
|
|
||||||
Switch to Regular Block Items
|
|
||||||
</Hyperlink>
|
|
||||||
</TextBlock>
|
|
||||||
<!-- Add AudioVisual Block Item Links -->
|
|
||||||
<ItemsControl ItemsSource="{Binding AudioVisualBlockItemTypesAvailable}" Grid.Row="0" Margin="0,0,0,10">
|
|
||||||
<ItemsControl.ItemsPanel>
|
|
||||||
<ItemsPanelTemplate>
|
|
||||||
<WrapPanel></WrapPanel>
|
|
||||||
</ItemsPanelTemplate>
|
|
||||||
</ItemsControl.ItemsPanel>
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<TextBlock Margin="0,0,3,0">
|
|
||||||
<Hyperlink Command="{Binding ElementName=TopLevelGrid, Path=DataContext.AddFilterBlockItemCommand}" CommandParameter="{Binding}">
|
|
||||||
<TextBlock>+</TextBlock><TextBlock Text="{Binding Path=., Converter={StaticResource BlockItemTypeToStringConverter}}" />
|
|
||||||
</Hyperlink>
|
|
||||||
</TextBlock>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="1" FontStyle="Italic" HorizontalAlignment="Left" Visibility="{Binding HasAudioVisualBlockItems, Converter={StaticResource InverseBooleanVisibilityConverter}}">To change the appearance of this block, add a Text, Background or Border Block Item above.</TextBlock>
|
|
||||||
|
|
||||||
<!-- Block Items -->
|
|
||||||
<WrapPanel Grid.Row="1" MaxHeight="200">
|
|
||||||
<WrapPanel.Resources>
|
|
||||||
<CollectionViewSource Source="{Binding AudioVisualBlockItems}" x:Key="BlockItemsCollectionViewSource">
|
<CollectionViewSource Source="{Binding AudioVisualBlockItems}" x:Key="BlockItemsCollectionViewSource">
|
||||||
<CollectionViewSource.SortDescriptions>
|
<CollectionViewSource.SortDescriptions>
|
||||||
<componentModel:SortDescription PropertyName="SortOrder"/>
|
<componentModel:SortDescription PropertyName="SortOrder"/>
|
||||||
</CollectionViewSource.SortDescriptions>
|
</CollectionViewSource.SortDescriptions>
|
||||||
</CollectionViewSource>
|
</CollectionViewSource>
|
||||||
</WrapPanel.Resources>
|
</Grid.Resources>
|
||||||
<ItemsControl ItemsSource="{Binding Source={StaticResource BlockItemsCollectionViewSource}}"
|
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
|
||||||
|
<ItemsControl ItemsSource="{Binding Source={StaticResource BlockItemsCollectionViewSource}}"
|
||||||
ItemContainerStyle="{StaticResource BlockItemFadeInStyle}">
|
ItemContainerStyle="{StaticResource BlockItemFadeInStyle}">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<WrapPanel Orientation="Vertical" />
|
<WrapPanel Orientation="Vertical" />
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<userControls:BlockItemControl BlockItem="{Binding}" RemoveItemCommand="{Binding ElementName=TopLevelGrid, Path=DataContext.RemoveFilterBlockItemCommand}" />
|
<userControls:BlockItemControl BlockItem="{Binding}" RemoveItemCommand="{Binding ElementName=TopLevelGrid, Path=DataContext.RemoveFilterBlockItemCommand}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</WrapPanel>
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid Grid.Row="2" Margin="0,5,0,5">
|
<Grid Grid.Row="2" Margin="0,5,0,5">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Column="0" Margin="0,0,5,0" Text="Description:" VerticalAlignment="Center" />
|
|
||||||
<TextBox Grid.Column="1" Text="{Binding BlockDescription}" />
|
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,0,8">
|
||||||
|
<Hyperlink Command="{Binding SwitchBlockItemsViewCommand}">
|
||||||
|
<Grid>
|
||||||
|
<TextBlock Text="Switch to Regular Block Items" Visibility="{Binding AudioVisualBlockItemsGridVisible, Converter={StaticResource BooleanVisibilityConverter}}" />
|
||||||
|
<TextBlock Text="Switch to Appearance Block Items" Visibility="{Binding AudioVisualBlockItemsGridVisible, Converter={StaticResource InverseBooleanVisibilityConverter}}" />
|
||||||
|
</Grid>
|
||||||
|
</Hyperlink>
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="0" Margin="0,0,5,0" Text="Description:" VerticalAlignment="Center" />
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding BlockDescription}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Expander>
|
</Expander>
|
||||||
|
|||||||
@@ -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:designTime="clr-namespace:Filtration.ViewModels.DesignTime"
|
xmlns:designTime="clr-namespace:Filtration.ViewModels.DesignTime"
|
||||||
mc:Ignorable="d" d:DesignWidth="1200"
|
mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="400"
|
||||||
d:DataContext="{d:DesignInstance Type=designTime:DesignTimeSettingsPageViewModel, IsDesignTimeCreatable=True}">
|
d:DataContext="{d:DesignInstance Type=designTime:DesignTimeSettingsPageViewModel, IsDesignTimeCreatable=True}">
|
||||||
<Border BorderBrush="Black" BorderThickness="1">
|
<Border BorderBrush="Black" BorderThickness="1">
|
||||||
<DockPanel Margin="10" MaxWidth="600" HorizontalAlignment="Left">
|
<DockPanel Margin="10" MaxWidth="600" HorizontalAlignment="Left">
|
||||||
@@ -22,8 +22,8 @@
|
|||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="5" />
|
<RowDefinition Height="5" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition x:Name="BlankLineBetweenBlocks" Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition x:Name="DownloadPreReleases" Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
@@ -40,8 +40,10 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
<TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center">Add blank line between blocks when saving</TextBlock>
|
<TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center">Add blank line between blocks when saving</TextBlock>
|
||||||
<CheckBox Grid.Row="2" Grid.Column="2" IsChecked="{Binding ExtraLineBetweenBlocks}" />
|
<CheckBox Grid.Row="2" Grid.Column="2" IsChecked="{Binding ExtraLineBetweenBlocks}" />
|
||||||
<TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Center">Download pre-release updates (use with caution)</TextBlock>
|
<TextBlock Grid.Row="3" Grid.Column="0" VerticalAlignment="Center">Download pre-release updates (use with caution)</TextBlock>
|
||||||
<CheckBox Grid.Row="4" Grid.Column="2" IsChecked="{Binding DownloadPrereleaseUpdates}" />
|
<CheckBox Grid.Row="3" Grid.Column="2" IsChecked="{Binding DownloadPrereleaseUpdates}" />
|
||||||
|
<TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Center">Auto-expand all sections when opening scripts</TextBlock>
|
||||||
|
<CheckBox Grid.Row="4" Grid.Column="2" IsChecked="{Binding BlocksExpandedOnOpen}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using Filtration.Services;
|
|||||||
|
|
||||||
namespace Filtration.WindsorInstallers
|
namespace Filtration.WindsorInstallers
|
||||||
{
|
{
|
||||||
public class ServicesInstaller :IWindsorInstaller
|
public class ServicesInstaller : IWindsorInstaller
|
||||||
{
|
{
|
||||||
public void Install(IWindsorContainer container, IConfigurationStore store)
|
public void Install(IWindsorContainer container, IConfigurationStore store)
|
||||||
{
|
{
|
||||||
@@ -19,6 +19,11 @@ namespace Filtration.WindsorInstallers
|
|||||||
.ImplementedBy<ItemFilterScriptDirectoryService>()
|
.ImplementedBy<ItemFilterScriptDirectoryService>()
|
||||||
.LifeStyle.Singleton);
|
.LifeStyle.Singleton);
|
||||||
|
|
||||||
|
container.Register(
|
||||||
|
Component.For<IScriptLoadingService>()
|
||||||
|
.ImplementedBy<ScriptLoadingService>()
|
||||||
|
.LifeStyle.Singleton);
|
||||||
|
|
||||||
container.Register(
|
container.Register(
|
||||||
Component.For<IStaticDataService>()
|
Component.For<IStaticDataService>()
|
||||||
.ImplementedBy<StaticDataService>()
|
.ImplementedBy<StaticDataService>()
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<package id="CommonServiceLocator" version="2.0.4" targetFramework="net461" />
|
<package id="CommonServiceLocator" version="2.0.4" targetFramework="net461" />
|
||||||
<package id="ControlzEx" version="3.0.2.4" targetFramework="net461" />
|
<package id="ControlzEx" version="3.0.2.4" targetFramework="net461" />
|
||||||
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net461" />
|
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net461" />
|
||||||
|
<package id="DynamicData" version="6.7.0.2529" targetFramework="net461" />
|
||||||
<package id="Extended.Wpf.Toolkit" version="3.4.0" targetFramework="net461" />
|
<package id="Extended.Wpf.Toolkit" version="3.4.0" targetFramework="net461" />
|
||||||
<package id="Fluent.Ribbon" version="6.1.0.326" targetFramework="net461" />
|
<package id="Fluent.Ribbon" version="6.1.0.326" targetFramework="net461" />
|
||||||
<package id="MahApps.Metro" version="1.2.4.0" targetFramework="net461" />
|
<package id="MahApps.Metro" version="1.2.4.0" targetFramework="net461" />
|
||||||
@@ -16,7 +17,8 @@
|
|||||||
<package id="NuGet.CommandLine" version="4.7.1" targetFramework="net461" developmentDependency="true" />
|
<package id="NuGet.CommandLine" version="4.7.1" targetFramework="net461" developmentDependency="true" />
|
||||||
<package id="SharpCompress" version="0.17.1" targetFramework="net461" />
|
<package id="SharpCompress" version="0.17.1" targetFramework="net461" />
|
||||||
<package id="Splat" version="1.6.2" targetFramework="net461" />
|
<package id="Splat" version="1.6.2" targetFramework="net461" />
|
||||||
<package id="squirrel.windows" version="1.8.0" targetFramework="net461" />
|
<package id="squirrel.windows" version="1.9.0" targetFramework="net461" />
|
||||||
|
<package id="System.Reactive" version="4.0.0" targetFramework="net461" />
|
||||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
|
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
|
||||||
<package id="WindowsAPICodePack-Core" version="1.1.2" targetFramework="net461" />
|
<package id="WindowsAPICodePack-Core" version="1.1.2" targetFramework="net461" />
|
||||||
<package id="WindowsAPICodePack-Shell" version="1.1.1" targetFramework="net461" />
|
<package id="WindowsAPICodePack-Shell" version="1.1.1" targetFramework="net461" />
|
||||||
|
|||||||
Reference in New Issue
Block a user