summaryrefslogtreecommitdiffstats
path: root/win/C#/HandBrake.ApplicationServices/Services
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-09-19 12:17:07 +0000
committersr55 <[email protected]>2010-09-19 12:17:07 +0000
commit1d3a178d671af6d09b3e3be35562fe5070ace809 (patch)
tree288f38ac3e39cf5300fb7d3ddffff5e3604b1565 /win/C#/HandBrake.ApplicationServices/Services
parent8cac9d8c62ce452ff27a6b70f005056f44b55581 (diff)
WinGui:
- Moved some non-specific HandBrake code (Exception Window, Update Information Window, Update Download Window) out into a separate framework library. Hoping to make this more reusable at a later point. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3543 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/HandBrake.ApplicationServices/Services')
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Encode.cs3
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/ErrorService.cs89
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Interfaces/IErrorService.cs35
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Queue.cs1
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Scan.cs2
5 files changed, 4 insertions, 126 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
index 42d2822ea..855f517b2 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
@@ -12,10 +12,11 @@ namespace HandBrake.ApplicationServices.Services
using System.Threading;
using System.Windows.Forms;
+ using HandBrake.Framework.Services;
+ using HandBrake.Framework.Services.Interfaces;
using HandBrake.ApplicationServices.Functions;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Parsing;
- using HandBrake.ApplicationServices.Properties;
using HandBrake.ApplicationServices.Services.Interfaces;
/// <summary>
diff --git a/win/C#/HandBrake.ApplicationServices/Services/ErrorService.cs b/win/C#/HandBrake.ApplicationServices/Services/ErrorService.cs
deleted file mode 100644
index 7b75ce893..000000000
--- a/win/C#/HandBrake.ApplicationServices/Services/ErrorService.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ErrorService.cs $
- This file is part of the HandBrake source code.
- Homepage: <http://handbrake.fr>.
- It may be used under the terms of the GNU General Public License. */
-
-namespace HandBrake.ApplicationServices.Services
-{
- using System;
- using System.IO;
- using System.Threading;
-
- using Interfaces;
- using Views;
-
- /// <summary>
- /// The Error Service
- /// </summary>
- public class ErrorService : IErrorService
- {
- /// <summary>
- /// Show an Error Window
- /// </summary>
- /// <param name="shortError">
- /// The short error message for the user to read
- /// </param>
- /// <param name="longError">
- /// Exception string or advanced details
- /// </param>
- public void ShowError(string shortError, string longError)
- {
- try
- {
- Thread newThread = new Thread(new ParameterizedThreadStart(WriteExceptionToFile));
- newThread.Start(shortError + Environment.NewLine + longError);
- }
- catch (Exception)
- {
- // Do Nothing
- }
-
- ExceptionWindow window = new ExceptionWindow();
- window.Setup(shortError, longError);
- window.Show();
- }
-
- /// <summary>
- /// Show a Notice or Warning Message.
- /// </summary>
- /// <param name="notice">
- /// The text to display to the user
- /// </param>
- /// <param name="isWarning">
- /// Is a warning window, show the warning icon instead of the notice
- /// </param>
- public void ShowNotice(string notice, bool isWarning)
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Write Exceptions out to log files
- /// </summary>
- /// <param name="state">
- /// The state.
- /// </param>
- public void WriteExceptionToFile(object state)
- {
- try
- {
- string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
- string file = Path.Combine(logDir, string.Format("Exception_{0}.txt", DateTime.Now.Ticks));
-
- if (!File.Exists(file))
- {
- using (StreamWriter streamWriter = new StreamWriter(file))
- {
- streamWriter.WriteLine(state.ToString());
- streamWriter.Close();
- streamWriter.Dispose();
- }
- }
- }
- catch
- {
- return; // Game over. Stop digging.
- }
- }
- }
-}
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IErrorService.cs b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IErrorService.cs
deleted file mode 100644
index 2c61f0ff4..000000000
--- a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IErrorService.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-/* IErrorService.cs $
- This file is part of the HandBrake source code.
- Homepage: <http://handbrake.fr>.
- It may be used under the terms of the GNU General Public License. */
-
-namespace HandBrake.ApplicationServices.Services.Interfaces
-{
- /// <summary>
- /// The Error service for showing the exception window.
- /// </summary>
- public interface IErrorService
- {
- /// <summary>
- /// Show an Error Window
- /// </summary>
- /// <param name="shortError">
- /// The short error message for the user to read
- /// </param>
- /// <param name="longError">
- /// Exception string or advanced details
- /// </param>
- void ShowError(string shortError, string longError);
-
- /// <summary>
- /// Show a Notice or Warning Message.
- /// </summary>
- /// <param name="notice">
- /// The text to display to the user
- /// </param>
- /// <param name="isWarning">
- /// Is a warning window, show the warning icon instead of the notice
- /// </param>
- void ShowNotice(string notice, bool isWarning);
- }
-} \ No newline at end of file
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs
index 4c4beda08..ae5c437ad 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs
@@ -17,7 +17,6 @@ namespace HandBrake.ApplicationServices.Services
using HandBrake.ApplicationServices.Functions;
using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Properties;
using HandBrake.ApplicationServices.Services.Interfaces;
/// <summary>
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
index be150989b..45bd37a90 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
@@ -12,6 +12,8 @@ namespace HandBrake.ApplicationServices.Services
using System.Threading;
using System.Windows.Forms;
+ using HandBrake.Framework.Services;
+ using HandBrake.Framework.Services.Interfaces;
using HandBrake.ApplicationServices.Functions;
using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services.Interfaces;