1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-28 02:40:01 +00:00
Radarr/NzbDrone/WindowsApp.cs

39 lines
1.2 KiB
C#
Raw Normal View History

using System;
using System.Windows.Forms;
2013-08-30 22:55:01 +00:00
using NLog;
using NzbDrone.Common.EnvironmentInfo;
2013-08-31 01:42:30 +00:00
using NzbDrone.Common.Instrumentation;
using NzbDrone.Host;
using NzbDrone.SysTray;
namespace NzbDrone
{
public static class WindowsApp
{
2013-08-31 01:42:30 +00:00
private static readonly Logger Logger = NzbDroneLogger.GetLogger();
2013-08-30 22:55:01 +00:00
public static void Main(string[] args)
{
try
{
2013-08-31 01:42:30 +00:00
var startupArgs = new StartupArguments(args);
LogTargets.Register(startupArgs, false, true);
var container = Bootstrap.Start(startupArgs, new MessageBoxUserAlert());
container.Register<ISystemTrayApp, SystemTrayApp>();
container.Resolve<ISystemTrayApp>().Start();
}
catch (TerminateApplicationException)
{
}
catch (Exception e)
{
Logger.FatalException("EPIC FAIL: " + e.Message, e);
var message = string.Format("{0}: {1}", e.GetType().Name, e.Message);
MessageBox.Show(text: message, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Error, caption: "Epic Fail!");
}
}
}
2013-08-31 01:42:30 +00:00
}