diff options
author | sr55 <[email protected]> | 2011-12-27 22:52:43 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-12-27 22:52:43 +0000 |
commit | 5b745b8f17f8acc6d3799eb3cb86e09c7ca99017 (patch) | |
tree | 5a97790d448b6ac3b85b46f1803df00c34a39820 /win/CS/HandBrakeWPF/Services/ErrorService.cs | |
parent | 20fd52b888f111ac2d7670fa3c41e495661cdebd (diff) |
WinGui: (WPF) Initial work to hookup the log viewer + some additional helper classes ported over form the WinForms version.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4390 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/ErrorService.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/ErrorService.cs | 61 |
1 files changed, 52 insertions, 9 deletions
diff --git a/win/CS/HandBrakeWPF/Services/ErrorService.cs b/win/CS/HandBrakeWPF/Services/ErrorService.cs index c5d89d5cf..3228ab363 100644 --- a/win/CS/HandBrakeWPF/Services/ErrorService.cs +++ b/win/CS/HandBrakeWPF/Services/ErrorService.cs @@ -9,6 +9,7 @@ namespace HandBrakeWPF.Services
{
+ using System;
using System.Windows;
using Interfaces;
using Caliburn.Micro;
@@ -20,11 +21,17 @@ namespace HandBrakeWPF.Services public class ErrorService : IErrorService
{
/// <summary>
- /// Show an Exception Error Window.
+ /// Show an Exception Error Window
/// </summary>
- /// <param name="message"></param>
- /// <param name="solution"></param>
- /// <param name="details"></param>
+ /// <param name="message">
+ /// The message.
+ /// </param>
+ /// <param name="solution">
+ /// The solution.
+ /// </param>
+ /// <param name="details">
+ /// The details.
+ /// </param>
public void ShowError(string message, string solution, string details)
{
IWindowManager windowManager = IoC.Get<IWindowManager>();
@@ -40,14 +47,50 @@ namespace HandBrakeWPF.Services }
/// <summary>
+ /// Show an Exception Error Window
+ /// </summary>
+ /// <param name="message">
+ /// The message.
+ /// </param>
+ /// <param name="solution">
+ /// The solution.
+ /// </param>
+ /// <param name="exception">
+ /// The exception.
+ /// </param>
+ public void ShowError(string message, string solution, Exception exception)
+ {
+ IWindowManager windowManager = IoC.Get<IWindowManager>();
+ IErrorViewModel errorViewModel = IoC.Get<IErrorViewModel>();
+
+ if (windowManager != null && errorViewModel != null)
+ {
+ errorViewModel.ErrorMessage = message;
+ errorViewModel.Solution = solution;
+ errorViewModel.Details = exception.ToString();
+ windowManager.ShowDialog(errorViewModel);
+ }
+ }
+
+ /// <summary>
/// Show a Message Box.
/// It is good practice to use this, so that if we ever introduce unit testing, the message boxes won't cause issues.
/// </summary>
- /// <param name="message"></param>
- /// <param name="header"></param>
- /// <param name="image"></param>
- /// <param name="buttons"></param>
- /// <returns></returns>
+ /// <param name="message">
+ /// The message.
+ /// </param>
+ /// <param name="header">
+ /// The header.
+ /// </param>
+ /// <param name="buttons">
+ /// The buttons.
+ /// </param>
+ /// <param name="image">
+ /// The image.
+ /// </param>
+ /// <returns>
+ /// The MessageBoxResult Object
+ /// </returns>
public MessageBoxResult ShowMessageBox(string message, string header, MessageBoxButton buttons, MessageBoxImage image)
{
return MessageBox.Show(message, header, buttons, image);
|