2026-06-17 00:35:16 +02:00
|
|
|
using VoiceCat.App.Forms;
|
|
|
|
|
|
|
|
|
|
namespace VoiceCat.App;
|
|
|
|
|
|
|
|
|
|
internal static class Program
|
|
|
|
|
{
|
|
|
|
|
[STAThread]
|
|
|
|
|
private static void Main()
|
|
|
|
|
{
|
2026-07-03 10:20:18 +01:00
|
|
|
// Surface exceptions that WinForms' default message-loop handling would otherwise
|
|
|
|
|
// swallow silently (or crash with no visible cause).
|
2026-06-17 00:35:16 +02:00
|
|
|
Application.ThreadException += (_, e) =>
|
|
|
|
|
Console.Error.WriteLine($"[UNHANDLED ThreadException] {e.Exception}");
|
|
|
|
|
AppDomain.CurrentDomain.UnhandledException += (_, e) =>
|
|
|
|
|
Console.Error.WriteLine($"[UNHANDLED AppDomain exception] {e.ExceptionObject}");
|
|
|
|
|
|
|
|
|
|
ApplicationConfiguration.Initialize();
|
|
|
|
|
|
|
|
|
|
using var connectDialog = new ConnectDialog();
|
|
|
|
|
var result = connectDialog.ShowDialog();
|
|
|
|
|
if (result != DialogResult.OK || connectDialog.ConnectedClient is null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Application.Run(new MainForm(connectDialog.ConnectedClient, connectDialog.SelfUserId,
|
2026-06-24 12:30:48 +02:00
|
|
|
connectDialog.Nickname, connectDialog.ServerName));
|
2026-06-17 00:35:16 +02:00
|
|
|
}
|
|
|
|
|
}
|