From 4934b148e573ceffad62cbb2e8c09c95a0fe61b3 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 19 Aug 2012 16:43:13 +0000 Subject: WinGui: Prototype of process isolation support (to be used for libhb when this is fixed up). Uses WCF for process communication. Initially for the scan service only, encode service proxy coming soon. No changes required for the UI application. Two new implementations of IScan and IEncode will act as a proxy between the UI and the Server Service Layer. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4911 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Utilities/GeneralUtilities.cs | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs') diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs index 83ea717e0..696eaedef 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs @@ -20,6 +20,7 @@ namespace HandBrake.ApplicationServices.Utilities using Caliburn.Micro; using HandBrake.ApplicationServices.Model; + using HandBrake.ApplicationServices.Services; using HandBrake.ApplicationServices.Services.Interfaces; /// @@ -34,12 +35,6 @@ namespace HandBrake.ApplicationServices.Utilities /// private static readonly string LogDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs"; - - /// - /// The User Setting Service - /// - private static readonly IUserSettingService UserSettingService = IoC.Get(); - /// /// The Instance ID /// @@ -117,12 +112,23 @@ namespace HandBrake.ApplicationServices.Utilities public static StringBuilder CreateCliLogHeader() { var logHeader = new StringBuilder(); + + IUserSettingService userSettingService; + try + { + userSettingService = IoC.Get(); + } + catch (Exception) + { + // TODO Sort this out. Should not be calling IoC.Get or creating a new instance here. + userSettingService = new UserSettingService(); + } logHeader.AppendLine( String.Format( - "HandBrake {0} {1}", - UserSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion), - UserSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeBuild))); + "HandBrake {0} {1}", + userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion), + userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeBuild))); logHeader.AppendLine(String.Format("OS: {0}", Environment.OSVersion)); logHeader.AppendLine(String.Format("CPU: {0}", SystemInfo.GetCpuCount)); logHeader.Append(String.Format("Ram: {0} MB, ", SystemInfo.TotalPhysicalMemory)); -- cgit v1.2.3