update to v0.1.2
This commit is contained in:
parent
ddd2ea9eb5
commit
ea448c9fe1
16 changed files with 1072 additions and 6773 deletions
|
@ -8,6 +8,8 @@ public class MyCustomApplicationContext : ApplicationContext
|
|||
{
|
||||
private NotifyIcon trayIcon;
|
||||
|
||||
private ControlApp myform;
|
||||
|
||||
public MyCustomApplicationContext()
|
||||
{
|
||||
trayIcon = new NotifyIcon();
|
||||
|
@ -16,7 +18,22 @@ public class MyCustomApplicationContext : ApplicationContext
|
|||
trayIcon.ContextMenuStrip.Items.Add("Exit", null, Exit);
|
||||
trayIcon.ContextMenuStrip.Items.Add("Open", null, Open);
|
||||
trayIcon.ContextMenuStrip.Items.Add("Panic", null, Panic);
|
||||
trayIcon.ContextMenuStrip.Items.Add("Subliminal", null, Subliminal);
|
||||
trayIcon.MouseClick += TrayIcon_MouseClick;
|
||||
trayIcon.Visible = true;
|
||||
myform = new ControlApp();
|
||||
}
|
||||
|
||||
private void TrayIcon_MouseClick(object? sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
if (myform.IsDisposed)
|
||||
{
|
||||
myform = new ControlApp();
|
||||
}
|
||||
myform.Show();
|
||||
}
|
||||
}
|
||||
|
||||
private void Exit(object sender, EventArgs e)
|
||||
|
@ -27,8 +44,37 @@ public class MyCustomApplicationContext : ApplicationContext
|
|||
|
||||
private void Open(object sender, EventArgs e)
|
||||
{
|
||||
using ControlApp myform = new ControlApp();
|
||||
myform.ShowDialog();
|
||||
if (myform.IsDisposed)
|
||||
{
|
||||
myform = new ControlApp();
|
||||
}
|
||||
myform.Show();
|
||||
}
|
||||
|
||||
private void Subliminal(object sender, EventArgs e)
|
||||
{
|
||||
bool done = false;
|
||||
foreach (Form fm in Application.OpenForms)
|
||||
{
|
||||
if (fm.GetType() == typeof(SubLoop))
|
||||
{
|
||||
SubLoop pop = (SubLoop)fm;
|
||||
try
|
||||
{
|
||||
pop.Close();
|
||||
done = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!done)
|
||||
{
|
||||
new SubLoop().Show();
|
||||
}
|
||||
}
|
||||
|
||||
private void Panic(object sender, EventArgs e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue