Repository navigation
Expand file tree
/
Copy pathProgram.cs
More file actions
41 lines (39 loc) · 1.42 KB
/
Copy pathProgram.cs
File metadata and controls
41 lines (39 loc) · 1.42 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
using DigglesModManager.Properties;
using System;
using System.Windows.Forms;
namespace DigglesModManager
{
public static class Program
{
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
[STAThread]
public static void Main()
{
Application.EnableVisualStyles();
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.SetCompatibleTextRenderingDefault(false);
// log all exceptions that are not handled anywhere else
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.ThreadException += (sender, args) =>
{
Log.Error("Unhandled exception", args.Exception);
Helpers.ShowErrorMessage(args.Exception.Message);
};
AppDomain.CurrentDomain.UnhandledException += (sender, args) =>
{
Log.Error("Unhandled exception (the mod manager is closed)", args.ExceptionObject as Exception);
};
try
{
Application.Run(new FormMain());
}
catch (System.IO.FileNotFoundException e)
{
Log.Error("Could not find a file", e);
Helpers.ShowErrorMessage(Resources.FormMain_CouldNotFindFile.Replace("FILENAME", e.FileName));
}
}
}
}