mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-09-06 04:31:32 +12:00
49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
// <copyright file="UpdateWindow.xaml.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
//
|
|
// Copyright (c) 2022-2022 Peter Kirmeier
|
|
|
|
namespace SystemTrayMenu.UserInterface
|
|
{
|
|
using System.IO;
|
|
using System.Reflection;
|
|
using System.Windows;
|
|
using System.Windows.Media.Imaging;
|
|
using SystemTrayMenu.Helper.Updater;
|
|
|
|
/// <summary>
|
|
/// Logic of Update window.
|
|
/// </summary>
|
|
public partial class UpdateWindow : Window
|
|
{
|
|
public UpdateWindow()
|
|
{
|
|
InitializeComponent();
|
|
|
|
Assembly myassembly = Assembly.GetExecutingAssembly();
|
|
string myname = myassembly.GetName().Name ?? string.Empty;
|
|
|
|
using (Stream? imgstream = myassembly.GetManifestResourceStream(myname + ".Resources.SystemTrayMenu.png"))
|
|
{
|
|
if (imgstream != null)
|
|
{
|
|
BitmapImage imageSource = new BitmapImage();
|
|
imageSource.BeginInit();
|
|
imageSource.StreamSource = imgstream;
|
|
imageSource.EndInit();
|
|
|
|
Icon = imageSource;
|
|
}
|
|
}
|
|
|
|
label.Content = ((string)label.Content) + " " + GitHubUpdate.LatestVersionName;
|
|
}
|
|
|
|
private void ButtonGoToDownloadPage_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
GitHubUpdate.WebOpenLatestRelease();
|
|
Close();
|
|
}
|
|
}
|
|
}
|