Sheas-Cealer/Windows/AboutWindow.xaml.cs
2024-04-17 18:10:43 +08:00

32 lines
1.0 KiB
C#

using System.Diagnostics;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace Sheas_Cealer
{
public partial class AboutWindow : Window
{
internal AboutWindow()
{
InitializeComponent();
}
private void AboutWin_Loaded(object sender, RoutedEventArgs e) => UpdateButton.Content = "版本号: " + Assembly.GetExecutingAssembly().GetName().Version!.ToString()[0..^2];
private void AboutButton_Click(object sender, RoutedEventArgs e)
{
if (sender == UpdateButton)
MessageBox.Show("密码: 3wnj");
ProcessStartInfo processStartInfo = new(sender == EmailButton ? "mailto:" : string.Empty + ((Button)sender).ToolTip) { UseShellExecute = true };
Process.Start(processStartInfo);
}
private void AboutWin_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape)
Close();
}
}
}