begin work: base version 0993 move original program for orgnization golang work snapshot decompiled code it builds! (but doesnt run) source code bump library stash decompile 0.1.2, make it build
41 lines
960 B
C#
41 lines
960 B
C#
using System;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace ControlApp;
|
|
|
|
public class MyCustomApplicationContext : ApplicationContext
|
|
{
|
|
private NotifyIcon trayIcon;
|
|
|
|
public MyCustomApplicationContext()
|
|
{
|
|
trayIcon = new NotifyIcon();
|
|
trayIcon.Icon = new Icon("App.ico");
|
|
trayIcon.ContextMenuStrip = new ContextMenuStrip();
|
|
trayIcon.ContextMenuStrip.Items.Add("Exit", null, Exit);
|
|
trayIcon.ContextMenuStrip.Items.Add("Open", null, Open);
|
|
trayIcon.ContextMenuStrip.Items.Add("Panic", null, Panic);
|
|
trayIcon.Visible = true;
|
|
}
|
|
|
|
private void Exit(object sender, EventArgs e)
|
|
{
|
|
trayIcon.Visible = false;
|
|
Application.Exit();
|
|
}
|
|
|
|
private void Open(object sender, EventArgs e)
|
|
{
|
|
using ControlApp myform = new ControlApp();
|
|
myform.ShowDialog();
|
|
}
|
|
|
|
private void Panic(object sender, EventArgs e)
|
|
{
|
|
foreach (Form openForm in Application.OpenForms)
|
|
{
|
|
openForm.Close();
|
|
}
|
|
}
|
|
}
|