summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions/Main.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/C#/Functions/Main.cs')
-rw-r--r--win/C#/Functions/Main.cs23
1 files changed, 10 insertions, 13 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs
index b8b689ce1..02cf67b34 100644
--- a/win/C#/Functions/Main.cs
+++ b/win/C#/Functions/Main.cs
@@ -3,7 +3,7 @@
Homepage: <http://handbrake.fr>.
It may be used under the terms of the GNU General Public License. */
-using System.Linq;
+using HandBrake.ApplicationServices.Services;
namespace Handbrake.Functions
{
@@ -11,18 +11,16 @@ namespace Handbrake.Functions
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
+ using System.Linq;
using System.Net;
- using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
using System.Xml.Serialization;
-
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services.Interfaces;
-
using Model;
/// <summary>
@@ -31,6 +29,11 @@ namespace Handbrake.Functions
public static class Main
{
/// <summary>
+ /// The Error Service
+ /// </summary>
+ private static readonly IErrorService errorService = new ErrorService();
+
+ /// <summary>
/// The XML Serializer
/// </summary>
private static readonly XmlSerializer Ser = new XmlSerializer(typeof(List<Job>));
@@ -168,9 +171,7 @@ namespace Handbrake.Functions
}
catch (Exception exc)
{
- frmExceptionWindow exceptionWindow = new frmExceptionWindow();
- exceptionWindow.Setup("Unable to save Chapter Makrers file! \nChapter marker names will NOT be saved in your encode", exc.ToString());
- exceptionWindow.ShowDialog();
+ ShowExceptiowWindow("Unable to save Chapter Makrers file! \nChapter marker names will NOT be saved in your encode", exc.ToString());
return false;
}
}
@@ -343,9 +344,7 @@ namespace Handbrake.Functions
Properties.Settings.Default.hb_build = 0;
Properties.Settings.Default.Save();
- frmExceptionWindow exceptionWindow = new frmExceptionWindow();
- exceptionWindow.Setup("Unable to retrieve version information from the CLI.", e.ToString());
- exceptionWindow.ShowDialog();
+ ShowExceptiowWindow("Unable to retrieve version information from the CLI.", e.ToString());
}
}
@@ -829,9 +828,7 @@ namespace Handbrake.Functions
/// </param>
public static void ShowExceptiowWindow(string shortError, string longError)
{
- frmExceptionWindow exceptionWindow = new frmExceptionWindow();
- exceptionWindow.Setup(shortError, longError);
- exceptionWindow.Show();
+ errorService.ShowError(shortError, longError);
}
/// <summary>