41 lines
917 B
C#
41 lines
917 B
C#
|
|
namespace gatuna_client;
|
||
|
|
|
||
|
|
static class Program
|
||
|
|
{
|
||
|
|
[STAThread]
|
||
|
|
static void Main()
|
||
|
|
{
|
||
|
|
ApplicationConfiguration.Initialize();
|
||
|
|
|
||
|
|
var form = new MainForm();
|
||
|
|
|
||
|
|
using var tray = new NotifyIcon
|
||
|
|
{
|
||
|
|
Icon = SystemIcons.Application,
|
||
|
|
Text = "gatuna",
|
||
|
|
Visible = true,
|
||
|
|
};
|
||
|
|
|
||
|
|
tray.ContextMenuStrip = new ContextMenuStrip();
|
||
|
|
tray.ContextMenuStrip.Items.Add("Show", null, (_, _) =>
|
||
|
|
{
|
||
|
|
form.Show();
|
||
|
|
form.Activate();
|
||
|
|
});
|
||
|
|
tray.ContextMenuStrip.Items.Add("-");
|
||
|
|
tray.ContextMenuStrip.Items.Add("Exit", null, (_, _) =>
|
||
|
|
{
|
||
|
|
form.Shutdown();
|
||
|
|
tray.Visible = false;
|
||
|
|
Application.Exit();
|
||
|
|
});
|
||
|
|
tray.DoubleClick += (_, _) =>
|
||
|
|
{
|
||
|
|
form.Show();
|
||
|
|
form.Activate();
|
||
|
|
};
|
||
|
|
|
||
|
|
Application.Run(form);
|
||
|
|
}
|
||
|
|
}
|