mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-15 01:25:36 -05:00
- Add support for filtering by category
- Break up main window into partials instead of using regions
This commit is contained in:
40
Application/MainWindow/UpdateHandler.cs
Normal file
40
Application/MainWindow/UpdateHandler.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using Common.Update;
|
||||
using FeedCenter.Properties;
|
||||
using System.Windows;
|
||||
|
||||
namespace FeedCenter
|
||||
{
|
||||
public partial class MainWindow
|
||||
{
|
||||
private static void InitializeUpdate()
|
||||
{
|
||||
UpdateCheck.ApplicationName = Properties.Resources.ApplicationDisplayName;
|
||||
UpdateCheck.UpdateServer = Settings.Default.VersionLocation;
|
||||
UpdateCheck.UpdateFile = Settings.Default.VersionFile;
|
||||
UpdateCheck.ApplicationShutdown = ApplicationShutdown;
|
||||
UpdateCheck.ApplicationCurrentMessage = ApplicationCurrentMessage;
|
||||
UpdateCheck.ApplicationUpdateMessage = ApplicationUpdateMessage;
|
||||
}
|
||||
|
||||
private static bool ApplicationUpdateMessage(string title, string message)
|
||||
{
|
||||
return MessageBox.Show(message, title, MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes;
|
||||
}
|
||||
|
||||
private static void ApplicationCurrentMessage(string title, string message)
|
||||
{
|
||||
MessageBox.Show(message, title, MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
|
||||
private static void ApplicationShutdown()
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
|
||||
private void HandleNewVersionLinkClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Display update information
|
||||
UpdateCheck.DisplayUpdateInformation(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user