上传文件至 PUBG2017PSLauncher
This commit is contained in:
parent
d246c1ff86
commit
5cf123a8f2
5 changed files with 1089 additions and 0 deletions
43
PUBG2017PSLauncher/App.xaml.cs
Normal file
43
PUBG2017PSLauncher/App.xaml.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using System.Drawing;
|
||||
|
||||
namespace PUBG2017PSLauncher
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : System.Windows.Application
|
||||
{
|
||||
static NotifyIcon trayIcon;
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
trayIcon = new NotifyIcon()
|
||||
{
|
||||
Text = "OG:BG 启动器",
|
||||
Icon = Icon.ExtractAssociatedIcon(Assembly.GetEntryAssembly().ManifestModule.Name),
|
||||
ContextMenuStrip = new ContextMenuStrip()
|
||||
{
|
||||
Items = {new ToolStripMenuItem("退出启动器", null, ExitFromTray)}
|
||||
},
|
||||
Visible = true
|
||||
};
|
||||
|
||||
trayIcon.Click += TrayLeftClicked;
|
||||
|
||||
base.OnStartup(e);
|
||||
}
|
||||
|
||||
void ExitFromTray(object sender, EventArgs e)
|
||||
{
|
||||
Current.Shutdown();
|
||||
}
|
||||
|
||||
void TrayLeftClicked(object sender, EventArgs e)
|
||||
{
|
||||
MainWindow.Visibility = Visibility.Visible;
|
||||
MainWindow.ShowInTaskbar = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue