diff --git a/Filtration.ObjectModel.Tests/Properties/AssemblyInfo.cs b/Filtration.ObjectModel.Tests/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..d98fb3d
--- /dev/null
+++ b/Filtration.ObjectModel.Tests/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Filtration.ObjectModel.Tests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("Filtration.ObjectModel.Tests")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7ed27cde-6bc5-4d11-b45d-8823de2077ce")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Filtration/App.config b/Filtration/App.config
index 9c05822..3a0477b 100644
--- a/Filtration/App.config
+++ b/Filtration/App.config
@@ -1,6 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Filtration/App.xaml.cs b/Filtration/App.xaml.cs
index 0f66f22..8bdcdb2 100644
--- a/Filtration/App.xaml.cs
+++ b/Filtration/App.xaml.cs
@@ -3,6 +3,7 @@ using System.Windows;
using Castle.MicroKernel.ModelBuilder.Inspectors;
using Castle.Windsor;
using Castle.Windsor.Installer;
+using Filtration.Properties;
using Filtration.Views;
namespace Filtration
@@ -31,6 +32,7 @@ namespace Filtration
protected override void OnExit(ExitEventArgs e)
{
_container.Dispose();
+ Settings.Default.Save();
base.OnExit(e);
}
}
diff --git a/Filtration/Filtration.csproj b/Filtration/Filtration.csproj
index 0d1e226..7869f32 100644
--- a/Filtration/Filtration.csproj
+++ b/Filtration/Filtration.csproj
@@ -121,6 +121,7 @@
+
@@ -346,6 +347,8 @@
+
+
Always
diff --git a/Filtration/Properties/Settings.Designer.cs b/Filtration/Properties/Settings.Designer.cs
index 60cbe77..eb7c523 100644
--- a/Filtration/Properties/Settings.Designer.cs
+++ b/Filtration/Properties/Settings.Designer.cs
@@ -1,30 +1,38 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34209
+// Runtime Version:4.0.30319.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
-namespace Filtration.Properties
-{
-
-
+namespace Filtration.Properties {
+
+
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
+
+ public static Settings Default {
+ get {
return defaultInstance;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string DefaultFilterDirectory {
+ get {
+ return ((string)(this["DefaultFilterDirectory"]));
+ }
+ set {
+ this["DefaultFilterDirectory"] = value;
+ }
+ }
}
}
diff --git a/Filtration/Properties/Settings.settings b/Filtration/Properties/Settings.settings
index 033d7a5..f44e762 100644
--- a/Filtration/Properties/Settings.settings
+++ b/Filtration/Properties/Settings.settings
@@ -1,7 +1,9 @@
-
-
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Filtration/Resources/Icons/collapse_icon.png b/Filtration/Resources/Icons/collapse_icon.png
new file mode 100644
index 0000000..a1a16de
Binary files /dev/null and b/Filtration/Resources/Icons/collapse_icon.png differ
diff --git a/Filtration/Resources/Icons/expand_icon.png b/Filtration/Resources/Icons/expand_icon.png
new file mode 100644
index 0000000..4dc9007
Binary files /dev/null and b/Filtration/Resources/Icons/expand_icon.png differ
diff --git a/Filtration/Services/ItemFilterPersistenceService.cs b/Filtration/Services/ItemFilterPersistenceService.cs
index ae5314b..748d2b7 100644
--- a/Filtration/Services/ItemFilterPersistenceService.cs
+++ b/Filtration/Services/ItemFilterPersistenceService.cs
@@ -1,5 +1,6 @@
using System.IO;
using Filtration.ObjectModel;
+using Filtration.Properties;
using Filtration.Translators;
namespace Filtration.Services
@@ -23,7 +24,15 @@ namespace Filtration.Services
_fileSystemService = fileSystemService;
_itemFilterScriptTranslator = itemFilterScriptTranslator;
- ItemFilterScriptDirectory = DefaultPathOfExileDirectory();
+ if (string.IsNullOrEmpty(Settings.Default.DefaultFilterDirectory))
+ {
+ ItemFilterScriptDirectory = DefaultPathOfExileDirectory();
+ Settings.Default.DefaultFilterDirectory = ItemFilterScriptDirectory;
+ }
+ else
+ {
+ ItemFilterScriptDirectory = Settings.Default.DefaultFilterDirectory;
+ }
}
public string ItemFilterScriptDirectory { get; private set; }
@@ -45,6 +54,7 @@ namespace Filtration.Services
}
ItemFilterScriptDirectory = path;
+ Settings.Default.DefaultFilterDirectory = path;
}
public ItemFilterScript LoadItemFilterScript(string filePath)
diff --git a/Filtration/Settings.cs b/Filtration/Settings.cs
new file mode 100644
index 0000000..eb1469e
--- /dev/null
+++ b/Filtration/Settings.cs
@@ -0,0 +1,28 @@
+namespace Filtration.Properties {
+
+
+ // This class allows you to handle specific events on the settings class:
+ // The SettingChanging event is raised before a setting's value is changed.
+ // The PropertyChanged event is raised after a setting's value is changed.
+ // The SettingsLoaded event is raised after the setting values are loaded.
+ // The SettingsSaving event is raised before the setting values are saved.
+ internal sealed partial class Settings {
+
+ public Settings() {
+ // // To add event handlers for saving and changing settings, uncomment the lines below:
+ //
+ // this.SettingChanging += this.SettingChangingEventHandler;
+ //
+ // this.SettingsSaving += this.SettingsSavingEventHandler;
+ //
+ }
+
+ private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
+ // Add code to handle the SettingChangingEvent event here.
+ }
+
+ private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
+ // Add code to handle the SettingsSaving event here.
+ }
+ }
+}
diff --git a/Filtration/ViewModels/AvalonDockWorkspaceViewModel.cs b/Filtration/ViewModels/AvalonDockWorkspaceViewModel.cs
index 7a4d21b..415bf78 100644
--- a/Filtration/ViewModels/AvalonDockWorkspaceViewModel.cs
+++ b/Filtration/ViewModels/AvalonDockWorkspaceViewModel.cs
@@ -40,6 +40,7 @@ namespace Filtration.ViewModels
_sectionBrowserViewModel.Initialise(this);
_blockGroupBrowserViewModel.Initialise(this);
+ _blockOutputPreviewViewModel.Initialise(this);
_openDocuments = new ObservableCollection {startPageViewModel};
ActiveDocument = startPageViewModel;
@@ -135,6 +136,7 @@ namespace Filtration.ViewModels
{
_sectionBrowserViewModel.ClearDown();
_blockGroupBrowserViewModel.ClearDown();
+ _blockOutputPreviewViewModel.ClearDown();
}
OpenDocuments.Remove(document);
diff --git a/Filtration/ViewModels/ItemFilterBlockGroupViewModel.cs b/Filtration/ViewModels/ItemFilterBlockGroupViewModel.cs
index f38cdc9..c9487ef 100644
--- a/Filtration/ViewModels/ItemFilterBlockGroupViewModel.cs
+++ b/Filtration/ViewModels/ItemFilterBlockGroupViewModel.cs
@@ -9,6 +9,7 @@ namespace Filtration.ViewModels
private bool? _isChecked;
private bool _reentrancyCheck;
private bool _postMapComplete;
+ private bool _isExpanded;
public ItemFilterBlockGroupViewModel()
{
@@ -54,6 +55,16 @@ namespace Filtration.ViewModels
}
}
+ public bool IsExpanded
+ {
+ get { return _isExpanded; }
+ set
+ {
+ _isExpanded = value;
+ RaisePropertyChanged();
+ }
+ }
+
private void UpdateCheckState()
{
// update all children:
diff --git a/Filtration/ViewModels/ItemFilterScriptViewModel.cs b/Filtration/ViewModels/ItemFilterScriptViewModel.cs
index 4f80d71..655bfd7 100644
--- a/Filtration/ViewModels/ItemFilterScriptViewModel.cs
+++ b/Filtration/ViewModels/ItemFilterScriptViewModel.cs
@@ -165,8 +165,12 @@ namespace Filtration.ViewModels
get { return _selectedBlockViewModel; }
set
{
- _selectedBlockViewModel = value;
- RaisePropertyChanged();
+ if (value != _selectedBlockViewModel)
+ {
+ _selectedBlockViewModel = value;
+ Messenger.Default.Send(new NotificationMessage("SelectedBlockChanged"));
+ RaisePropertyChanged();
+ }
}
}
diff --git a/Filtration/ViewModels/ToolPanes/BlockOutputPreviewViewModel.cs b/Filtration/ViewModels/ToolPanes/BlockOutputPreviewViewModel.cs
index 049c883..6b3a722 100644
--- a/Filtration/ViewModels/ToolPanes/BlockOutputPreviewViewModel.cs
+++ b/Filtration/ViewModels/ToolPanes/BlockOutputPreviewViewModel.cs
@@ -1,17 +1,24 @@
using System;
using System.Windows.Media.Imaging;
+using Filtration.Translators;
+using GalaSoft.MvvmLight.Messaging;
namespace Filtration.ViewModels.ToolPanes
{
internal interface IBlockOutputPreviewViewModel : IToolViewModel
{
bool IsVisible { get; set; }
+ void ClearDown();
}
internal class BlockOutputPreviewViewModel : ToolViewModel, IBlockOutputPreviewViewModel
{
- public BlockOutputPreviewViewModel() : base("Block Output Preview")
+ private readonly IItemFilterBlockTranslator _itemFilterBlockTranslator;
+ private string _previewText;
+
+ public BlockOutputPreviewViewModel(IItemFilterBlockTranslator itemFilterBlockTranslator) : base("Block Output Preview")
{
+ _itemFilterBlockTranslator = itemFilterBlockTranslator;
ContentId = ToolContentId;
var icon = new BitmapImage();
icon.BeginInit();
@@ -19,10 +26,56 @@ namespace Filtration.ViewModels.ToolPanes
icon.EndInit();
IconSource = icon;
- IsVisible = false;
+ IsVisible = false;
+
+ Messenger.Default.Register(this, message =>
+ {
+ switch (message.Notification)
+ {
+ case "SelectedBlockChanged":
+ {
+ OnSelectedBlockChanged(null, null);
+ break;
+ }
+ case "ActiveDocumentChanged":
+ {
+ OnSelectedBlockChanged(null, null);
+ break;
+ }
+ }
+ });
+
+ }
+
+ public const string ToolContentId = "BlockOutputPreviewTool";
+
+ public string PreviewText
+ {
+ get { return _previewText; }
+ private set
+ {
+ _previewText = value;
+ RaisePropertyChanged();
+ }
}
+ public void ClearDown()
+ {
+ PreviewText = string.Empty;
+ }
- public const string ToolContentId = "BlockOutputPreviewTool";
+ private void OnSelectedBlockChanged(object sender, EventArgs e)
+ {
+ if (AvalonDockWorkspaceViewModel.ActiveScriptViewModel == null ||
+ AvalonDockWorkspaceViewModel.ActiveScriptViewModel.SelectedBlockViewModel == null)
+ {
+ PreviewText = string.Empty;
+ return;
+ }
+
+ PreviewText =
+ _itemFilterBlockTranslator.TranslateItemFilterBlockToString(
+ AvalonDockWorkspaceViewModel.ActiveScriptViewModel.SelectedBlockViewModel.Block);
+ }
}
}
diff --git a/Filtration/Views/IconsDictionary.xaml b/Filtration/Views/IconsDictionary.xaml
index 9677152..c02c072 100644
--- a/Filtration/Views/IconsDictionary.xaml
+++ b/Filtration/Views/IconsDictionary.xaml
@@ -22,4 +22,6 @@
+
+
\ No newline at end of file
diff --git a/Filtration/Views/ToolPanes/BlockGroupBrowserView.xaml b/Filtration/Views/ToolPanes/BlockGroupBrowserView.xaml
index d2858c8..1b5ccf1 100644
--- a/Filtration/Views/ToolPanes/BlockGroupBrowserView.xaml
+++ b/Filtration/Views/ToolPanes/BlockGroupBrowserView.xaml
@@ -21,17 +21,27 @@
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/Filtration/Views/ToolPanes/BlockOutputPreviewView.xaml b/Filtration/Views/ToolPanes/BlockOutputPreviewView.xaml
index 1f0bc5c..cbb818b 100644
--- a/Filtration/Views/ToolPanes/BlockOutputPreviewView.xaml
+++ b/Filtration/Views/ToolPanes/BlockOutputPreviewView.xaml
@@ -3,9 +3,11 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:toolPanes="clr-namespace:Filtration.ViewModels.ToolPanes"
+ d:DataContext="{d:DesignInstance Type=toolPanes:BlockOutputPreviewViewModel}"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
- This is the Block Text Preview Pane
+
diff --git a/Releases/0.1/Filtration.exe.config b/Releases/0.1/Filtration.exe.config
new file mode 100644
index 0000000..9c05822
--- /dev/null
+++ b/Releases/0.1/Filtration.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file