-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
56 lines (44 loc) · 1.56 KB
/
Program.cs
File metadata and controls
56 lines (44 loc) · 1.56 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
48
49
50
51
52
53
54
55
56
using System.Diagnostics;
using System.Net.Sockets;
using System.Text;
namespace deskdecorator
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
///
public static int gLanguage = 0;
[STAThread]
static void Main(string[] args)
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.SetHighDpiMode(HighDpiMode.SystemAware);
var logger = Logger.Instance;
Debug.WriteLine("Hello World, or nah?");
if (args.Contains("--add-label"))
{
using (var client = new UdpClient())
{
var message = Encoding.UTF8.GetBytes("DESKDEC|--add-label");
client.Send(message, message.Length, "127.0.0.1", 8534);
}
return; // Kein UI starten
}
Form1 form = new Form1(logger);
Application.Run(form);
AppDomain.CurrentDomain.ProcessExit += (s, e) =>
{
// Perform cleanup tasks here
Debug.WriteLine("============== FORM CLOSING ==============");
form.Close();
logger = null;
};
}
}
}