-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
20 lines (17 loc) · 843 Bytes
/
Copy pathProgram.cs
File metadata and controls
20 lines (17 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
namespace PSG2SaveEditor;
static class Program
{
/// <summary>The main entry point for the application.</summary>
[STAThread]
static void Main(string[] args)
{
ApplicationConfiguration.Initialize();
// Log any unhandled exception so failures are diagnosable instead of a silent crash.
string log = Path.Combine(AppContext.BaseDirectory, "crash.log");
Application.ThreadException += (_, e) => File.WriteAllText(log, e.Exception.ToString());
AppDomain.CurrentDomain.UnhandledException += (_, e) => File.WriteAllText(log, e.ExceptionObject?.ToString() ?? "unknown");
// Allow opening a .p2s passed on the command line (drag-drop / "Open with").
string? path = args.Length > 0 && File.Exists(args[0]) ? args[0] : null;
Application.Run(new MainForm(path));
}
}