Radarr/NzbDrone/WindowsApp.cs

31 lines
911 B
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;
using NzbDrone.Host;
using NzbDrone.SysTray;
namespace NzbDrone
{
public static class WindowsApp
{
2013-08-30 22:55:01 +00:00
public static void Main(string[] args)
{
try
{
var container = Bootstrap.Start(new StartupArguments(args), new MessageBoxUserAlert());
container.Register<ISystemTrayApp, SystemTrayApp>();
container.Resolve<ISystemTrayApp>().Start();
}
catch (TerminateApplicationException)
{
}
catch (Exception 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!");
}
}
}
}