diff --git a/Application/FileConverter/FileConverter.sln.DotSettings b/Application/FileConverter/FileConverter.sln.DotSettings
index fc7e786..9473ccd 100644
--- a/Application/FileConverter/FileConverter.sln.DotSettings
+++ b/Application/FileConverter/FileConverter.sln.DotSettings
@@ -6,8 +6,10 @@
DO_NOT_SHOW
False
False
+ False
UseExplicitType
UseExplicitType
UseExplicitType
<Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" />
- True
\ No newline at end of file
+ True
+ True
\ No newline at end of file
diff --git a/Application/FileConverter/Settings.cs b/Application/FileConverter/Settings.cs
index d494f6b..393210d 100644
--- a/Application/FileConverter/Settings.cs
+++ b/Application/FileConverter/Settings.cs
@@ -9,15 +9,21 @@ namespace FileConverter
using System.Reflection;
using System.Security.Principal;
using System.Windows;
+ using System.ComponentModel;
+ using System.Runtime.CompilerServices;
using Microsoft.Win32;
- public class Settings
- {
- public List ConversionPresets = new List();
+ using FileConverter.Annotations;
+ public class Settings : INotifyPropertyChanged
+ {
private const char PresetSeparator = ';';
+ private List conversionPresets = new List();
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
private static bool IsInAdmininstratorPrivileges
{
get
@@ -26,6 +32,19 @@ namespace FileConverter
}
}
+ public List ConversionPresets
+ {
+ get { return this.conversionPresets; }
+ set { this.conversionPresets = value; }
+ }
+
+ [NotifyPropertyChangedInvocator]
+ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ PropertyChangedEventHandler handler = this.PropertyChanged;
+ handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+
public void Load()
{
List conversionPresets = this.ConversionPresets;
diff --git a/Application/FileConverter/SettingsWindow.xaml b/Application/FileConverter/SettingsWindow.xaml
index 1320108..c734f2b 100644
--- a/Application/FileConverter/SettingsWindow.xaml
+++ b/Application/FileConverter/SettingsWindow.xaml
@@ -84,6 +84,9 @@
+
+
+
diff --git a/Application/FileConverter/SettingsWindow.xaml.cs b/Application/FileConverter/SettingsWindow.xaml.cs
index 43a2f15..dcf6f0e 100644
--- a/Application/FileConverter/SettingsWindow.xaml.cs
+++ b/Application/FileConverter/SettingsWindow.xaml.cs
@@ -2,7 +2,6 @@
namespace FileConverter
{
- using System;
using System.Runtime.CompilerServices;
using System.Windows;
using System.ComponentModel;
@@ -97,5 +96,17 @@ namespace FileConverter
this.Close();
}
+
+ private void AddPresetButton_Click(object sender, RoutedEventArgs e)
+ {
+ Application application = Application.Current as Application;
+ application.Settings.ConversionPresets.Add(new ConversionPreset("New preset", OutputType.None, new string[0]));
+ }
+
+ private void RemovePresetButton_Click(object sender, RoutedEventArgs e)
+ {
+ Application application = Application.Current as Application;
+ application.Settings.ConversionPresets.Remove(this.selectedPreset);
+ }
}
}