From 746186658150dcbca2721d6d6fea77b4d7c09467 Mon Sep 17 00:00:00 2001 From: sr55 Date: Mon, 15 Aug 2011 19:23:58 +0000 Subject: WinGui: Add a service manager to maintain single instances of services & update the user settings service to import defaults from an xml file. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4177 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/Functions/Main.cs | 2 +- win/CS/Functions/PresetLoader.cs | 6 ++++-- win/CS/Functions/QueryGenerator.cs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'win/CS/Functions') diff --git a/win/CS/Functions/Main.cs b/win/CS/Functions/Main.cs index 9aa5afdc4..03f6d2dba 100644 --- a/win/CS/Functions/Main.cs +++ b/win/CS/Functions/Main.cs @@ -35,7 +35,7 @@ namespace Handbrake.Functions /// private static readonly XmlSerializer Ser = new XmlSerializer(typeof(List)); - private static readonly IUserSettingService UserSettingService = new UserSettingService(); + private static readonly IUserSettingService UserSettingService = ServiceManager.UserSettingService; /// /// Set's up the DataGridView on the Chapters tab (frmMain) diff --git a/win/CS/Functions/PresetLoader.cs b/win/CS/Functions/PresetLoader.cs index 195459201..efc22495c 100644 --- a/win/CS/Functions/PresetLoader.cs +++ b/win/CS/Functions/PresetLoader.cs @@ -11,7 +11,6 @@ namespace Handbrake.Functions using HandBrake.ApplicationServices; using HandBrake.ApplicationServices.Model; using HandBrake.ApplicationServices.Model.Encoding; - using HandBrake.ApplicationServices.Services; using HandBrake.ApplicationServices.Services.Interfaces; using HandBrake.Interop.Model.Encoding; @@ -22,7 +21,10 @@ namespace Handbrake.Functions /// public class PresetLoader { - private static readonly IUserSettingService UserSettingService = new UserSettingService(); + /// + /// The User Setting Service. + /// + private static readonly IUserSettingService UserSettingService = ServiceManager.UserSettingService; /// /// This function takes in a Query which has been parsed by QueryParser and diff --git a/win/CS/Functions/QueryGenerator.cs b/win/CS/Functions/QueryGenerator.cs index 782c4dcf9..1d0a32be5 100644 --- a/win/CS/Functions/QueryGenerator.cs +++ b/win/CS/Functions/QueryGenerator.cs @@ -25,7 +25,7 @@ namespace Handbrake.Functions /// public class QueryGenerator { - private static readonly IUserSettingService UserSettingService = new UserSettingService(); + private static readonly IUserSettingService UserSettingService = ServiceManager.UserSettingService; /// /// The Culture -- cgit v1.2.3