-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
37 lines (34 loc) · 1.04 KB
/
Program.cs
File metadata and controls
37 lines (34 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace potter
{
static class Program
{
internal static EventWaitHandle s_event;
internal static string eventName = "potter#startup";
[STAThread]
static void Main()
{
Logger.Append("Starting application");
bool created;
s_event = new EventWaitHandle(false, EventResetMode.AutoReset, eventName, out created);
if (created)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new PotterApplicationContext());
}
else
{
s_event.Set();
Logger.Append("Detected other running potter instance - sending message to open dialog.");
}
Logger.Append("Exiting application");
}
}
}