From cbe5f09e69c95df3be3b38de06c2b7bd6b5bd949 Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 22 Aug 2012 20:11:18 +0000 Subject: WinGui: Initial Work to wire up Encode Process Isolation. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4914 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Services/Base/EncodeBase.cs | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'win/CS/HandBrake.ApplicationServices/Services/Base') diff --git a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs index e20215bcf..36b9002bc 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs @@ -13,8 +13,6 @@ namespace HandBrake.ApplicationServices.Services.Base using System.IO; using System.Text; - using Caliburn.Micro; - using HandBrake.ApplicationServices.EventArgs; using HandBrake.ApplicationServices.Exceptions; using HandBrake.ApplicationServices.Model; @@ -31,17 +29,22 @@ namespace HandBrake.ApplicationServices.Services.Base /// /// A Lock for the filewriter /// - private static readonly object fileWriterLock = new object(); + private static readonly object FileWriterLock = new object(); /// /// The User Setting Service /// - private IUserSettingService userSettingService = IoC.Get(); + private readonly IUserSettingService userSettingService; /// /// Windows 7 API Pack wrapper /// - private Win7 windowsSeven = new Win7(); + private readonly Win7 windowsSeven = new Win7(); + + /// + /// The Log File Header + /// + private readonly StringBuilder header = GeneralUtilities.CreateCliLogHeader(); /// /// The Log Buffer @@ -53,18 +56,17 @@ namespace HandBrake.ApplicationServices.Services.Base /// private StreamWriter fileWriter; - /// - /// The Log File Header - /// - private StringBuilder header = GeneralUtilities.CreateCliLogHeader(); - #endregion /// /// Initializes a new instance of the class. /// - public EncodeBase() + /// + /// The user Setting Service. + /// + public EncodeBase(IUserSettingService userSettingService) { + this.userSettingService = userSettingService; this.logBuffer = new StringBuilder(); } @@ -310,7 +312,7 @@ namespace HandBrake.ApplicationServices.Services.Base this.LogBuffer.AppendLine(message); } - lock (fileWriterLock) + lock (FileWriterLock) { if (this.fileWriter != null && this.fileWriter.BaseStream.CanWrite) { @@ -341,7 +343,7 @@ namespace HandBrake.ApplicationServices.Services.Base { try { - lock (fileWriterLock) + lock (FileWriterLock) { if (this.fileWriter != null) { -- cgit v1.2.3