-
Notifications
You must be signed in to change notification settings - Fork 3
/
Program.cs
58 lines (52 loc) · 1.87 KB
/
Program.cs
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
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Proxmox_Desktop_Client.Classes;
using Proxmox_Desktop_Client.Classes.pveAPI;
using Proxmox_Desktop_Client.Panels;
namespace Proxmox_Desktop_Client
{
static class Program
{
// Create a new instance of Configurations with automatic saving
public static Configurations _Config = new Configurations();
public static Dictionary<string, object> _Panels = new Dictionary<string, object>();
public static ApiClient _Api;
public static string AppVersion = "1.2.7";
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
string processName = Process.GetCurrentProcess().ProcessName;
Process[] processes = Process.GetProcessesByName(processName);
if (processes.Length > 1)
{
MessageBox.Show("Program is already running. Check your system tray.", "Already Running");
Application.Exit();
} else
{
try
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new ClientLogin());
} catch(Exception ex)
{
DebugPoint("Program Failure (MAIN): " + Environment.NewLine + ex.StackTrace);
}
}
}
public static void DebugPoint(string content)
{
if (Debugger.IsAttached)
{
Console.WriteLine(content);
}
}
}
}