diff options
author | sr55 <[email protected]> | 2012-02-18 22:09:26 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-02-18 22:09:26 +0000 |
commit | 68395c181bbf629c33607829aa971cf12c19c29d (patch) | |
tree | 6fae1b33a36a3a16ac70ce11b33de868fd152597 /win/CS/HandBrakeWPF/Helpers/UpdateCheckHelper.cs | |
parent | be861eb1e625b3e903d76bf60cdfb4bae8f8b1df (diff) |
WinGui: (WPF) General work hooking up various aspects of the new WPF UI, bug fixes and improvements.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4456 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Helpers/UpdateCheckHelper.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Helpers/UpdateCheckHelper.cs | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/UpdateCheckHelper.cs b/win/CS/HandBrakeWPF/Helpers/UpdateCheckHelper.cs new file mode 100644 index 000000000..11917e771 --- /dev/null +++ b/win/CS/HandBrakeWPF/Helpers/UpdateCheckHelper.cs @@ -0,0 +1,60 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="UpdateCheckHelper.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Update Check Helper
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Helpers
+{
+ using System;
+ using System.Windows;
+
+ using Caliburn.Micro;
+
+ using HandBrake.ApplicationServices.Model.General;
+ using HandBrake.ApplicationServices.Services;
+
+ using HandBrakeWPF.Services.Interfaces;
+
+ /// <summary>
+ /// Update Check Helper
+ /// </summary>
+ public class UpdateCheckHelper
+ {
+ /// <summary>
+ /// Handle the Update Check Finishing.
+ /// </summary>
+ /// <param name="result">
+ /// The result.
+ /// </param>
+ public static void UpdateCheckDoneMenu(IAsyncResult result)
+ {
+ // Make sure it's running on the calling thread
+ IErrorService errorService = IoC.Get<IErrorService>();
+ try
+ {
+ // Get the information about the new build, if any, and close the window
+ UpdateCheckInformation info = UpdateService.EndCheckForUpdates(result);
+
+ if (info.NewVersionAvailable)
+ {
+ errorService.ShowMessageBox(
+ "A New Update is Available", "Update available!", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ else
+ {
+ errorService.ShowMessageBox(
+ "There is no new version at this time.", "No Updates", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ return;
+ }
+ catch (Exception ex)
+ {
+ errorService.ShowError("Unable to check for updates", "Please try again later, the update service may currently be down.", ex);
+ }
+ }
+ }
+}
|