summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/Main.cs23
-rw-r--r--win/C#/Functions/QueryParser.cs5
2 files changed, 11 insertions, 17 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>
diff --git a/win/C#/Functions/QueryParser.cs b/win/C#/Functions/QueryParser.cs
index f0c7fdb61..c4ea1e5c9 100644
--- a/win/C#/Functions/QueryParser.cs
+++ b/win/C#/Functions/QueryParser.cs
@@ -9,7 +9,6 @@ namespace Handbrake.Functions
using System.Collections;
using System.Globalization;
using System.Text.RegularExpressions;
- using System.Windows.Forms;
using Model;
/// <summary>
@@ -641,9 +640,7 @@ namespace Handbrake.Functions
}
catch (Exception exc)
{
- frmExceptionWindow exceptionWindow = new frmExceptionWindow();
- exceptionWindow.Setup("An error has occured in the Query Parser.", exc.ToString());
- exceptionWindow.ShowDialog();
+ Main.ShowExceptiowWindow("An error has occured in the Query Parser.", exc.ToString());
}
#endregion