Files
FeedCenter/Application/MainWindow/UpdateHandler.cs
Chris Kaczor b5f570688d More modernization
- Split generic "common" libraries into specific libraries
- Use other packages in lieu of custom code
- General cleanup
2023-04-05 16:06:38 -04:00

40 lines
1.2 KiB
C#

using CKaczor.ApplicationUpdate;
using FeedCenter.Properties;
using System.Windows;
namespace FeedCenter
{
public partial class MainWindow
{
private static void InitializeUpdate()
{
UpdateCheck.Initialize(ServerType.GitHub,
Settings.Default.VersionLocation,
string.Empty,
Properties.Resources.ApplicationDisplayName,
ApplicationShutdown,
ApplicationCurrentMessage,
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)
{
UpdateCheck.DisplayUpdateInformation(true);
}
}
}