diff options
author | sr55 <[email protected]> | 2013-01-17 22:29:37 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-01-17 22:29:37 +0000 |
commit | 7dd8b460af31e84d3b1cb82b63f03464dbadf3ee (patch) | |
tree | 83399a9a0e8a942831a2fb6d7a4d849100b6ad7b /win/CS/HandBrake.ApplicationServices/Services | |
parent | 6f7272a5caf858b0dd461eee74654c1e4d54500b (diff) |
WinGui: UI Tweaks.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5180 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/Interfaces/IUserSettingService.cs | 18 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs | 23 |
2 files changed, 41 insertions, 0 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IUserSettingService.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IUserSettingService.cs index d7bba9550..bf6cb9c91 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IUserSettingService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IUserSettingService.cs @@ -9,12 +9,30 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
{
+ using HandBrake.ApplicationServices.EventArgs;
+
+ /// <summary>
+ /// The setting event handler.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ public delegate void SettingEventHandler(object sender, SettingChangedEventArgs e);
+
/// <summary>
/// The User Setting Service Interace.
/// </summary>
public interface IUserSettingService
{
/// <summary>
+ /// The setting changed.
+ /// </summary>
+ event SettingEventHandler SettingChanged;
+
+ /// <summary>
/// Set the specified user setting.
/// </summary>
/// <param name="name">
diff --git a/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs b/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs index ab77ce800..db7389637 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs @@ -16,6 +16,7 @@ namespace HandBrake.ApplicationServices.Services using System.Xml.Serialization;
using HandBrake.ApplicationServices.Collections;
+ using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Services.Interfaces;
@@ -48,6 +49,11 @@ namespace HandBrake.ApplicationServices.Services }
/// <summary>
+ /// The setting changed.
+ /// </summary>
+ public event SettingEventHandler SettingChanged;
+
+ /// <summary>
/// Set the specified user setting.
/// </summary>
/// <param name="name">
@@ -60,6 +66,8 @@ namespace HandBrake.ApplicationServices.Services {
this.userSettings[name] = value;
this.Save();
+
+ this.OnSettingChanged(new SettingChangedEventArgs {Key = name, Value = value});
}
/// <summary>
@@ -99,6 +107,21 @@ namespace HandBrake.ApplicationServices.Services }
/// <summary>
+ /// The on setting changed.
+ /// </summary>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ protected virtual void OnSettingChanged(SettingChangedEventArgs e)
+ {
+ SettingEventHandler handler = this.SettingChanged;
+ if (handler != null)
+ {
+ handler(this, e);
+ }
+ }
+
+ /// <summary>
/// Save the User Settings
/// </summary>
private void Save()
|