diff options
author | sr55 <[email protected]> | 2012-08-19 16:43:13 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-08-19 16:43:13 +0000 |
commit | 4934b148e573ceffad62cbb2e8c09c95a0fe61b3 (patch) | |
tree | 5b07f3e8fa74b7f83573746cfe77a9f6c6c2b5ee /win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs | |
parent | 5ea4bd4112519332f1f420d4fd751bc8829e0509 (diff) |
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
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs | 24 |
1 files changed, 15 insertions, 9 deletions
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;
/// <summary>
@@ -34,12 +35,6 @@ namespace HandBrake.ApplicationServices.Utilities /// </summary>
private static readonly string LogDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
"\\HandBrake\\logs";
-
- /// <summary>
- /// The User Setting Service
- /// </summary>
- private static readonly IUserSettingService UserSettingService = IoC.Get<IUserSettingService>();
-
/// <summary>
/// The Instance ID
/// </summary>
@@ -117,12 +112,23 @@ namespace HandBrake.ApplicationServices.Utilities public static StringBuilder CreateCliLogHeader()
{
var logHeader = new StringBuilder();
+
+ IUserSettingService userSettingService;
+ try
+ {
+ userSettingService = IoC.Get<IUserSettingService>();
+ }
+ 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<string>(ASUserSettingConstants.HandBrakeVersion),
- UserSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild)));
+ "HandBrake {0} {1}",
+ userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion),
+ userSettingService.GetUserSetting<int>(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));
|