-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
47 lines (38 loc) · 1.32 KB
/
Program.cs
File metadata and controls
47 lines (38 loc) · 1.32 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
38
39
40
41
42
43
44
45
46
47
#region Using statements
using System;
using System.Runtime;
using System.Threading;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
#endregion Using statements
namespace HardTop
{
internal class Program
{
#region Private variable to allow only one instance of application
private static readonly Mutex Mutex = new Mutex(true, "43A57E91-1D03-448D-857C-75B3A81F69A7");
#endregion Private variable to allow only one instance of application
#region Application starting point
[STAThread]
private static void Main()
{
if (!Mutex.WaitOne(TimeSpan.Zero, true))
{
return;
}
Application.EnableVisualStyles();
Application.VisualStyleState = VisualStyleState.ClientAndNonClientAreasEnabled;
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
GCSettings.LatencyMode = GCLatencyMode.Batch;
using (HardTopApplicationContext context = new HardTopApplicationContext())
{
if (context?.Gui != null)
{
Application.Run(context);
}
}
Mutex.ReleaseMutex();
}
#endregion Application starting point
}
}