From 20fd52b888f111ac2d7670fa3c41e495661cdebd Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 27 Dec 2011 18:41:31 +0000 Subject: WinGui: (WPF) Initial work to implement the "Queue" and "Add Preset" Windows. Additional setup work around the main window. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4389 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/Services/ErrorService.cs | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 win/CS/HandBrakeWPF/Services/ErrorService.cs (limited to 'win/CS/HandBrakeWPF/Services/ErrorService.cs') diff --git a/win/CS/HandBrakeWPF/Services/ErrorService.cs b/win/CS/HandBrakeWPF/Services/ErrorService.cs new file mode 100644 index 000000000..c5d89d5cf --- /dev/null +++ b/win/CS/HandBrakeWPF/Services/ErrorService.cs @@ -0,0 +1,56 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The Error Service +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Services +{ + using System.Windows; + using Interfaces; + using Caliburn.Micro; + using ViewModels.Interfaces; + + /// + /// The Error Service + /// + public class ErrorService : IErrorService + { + /// + /// Show an Exception Error Window. + /// + /// + /// + /// + public void ShowError(string message, string solution, string details) + { + IWindowManager windowManager = IoC.Get(); + IErrorViewModel errorViewModel = IoC.Get(); + + if (windowManager != null && errorViewModel != null) + { + errorViewModel.ErrorMessage = message; + errorViewModel.Solution = solution; + errorViewModel.Details = details; + windowManager.ShowDialog(errorViewModel); + } + } + + /// + /// 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. + /// + /// + /// + /// + /// + /// + public MessageBoxResult ShowMessageBox(string message, string header, MessageBoxButton buttons, MessageBoxImage image) + { + return MessageBox.Show(message, header, buttons, image); + } + } +} -- cgit v1.2.3