2013-08-07 05:32:22 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
2013-08-30 22:55:01 +00:00
|
|
|
|
using NLog;
|
2013-08-13 05:08:37 +00:00
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
2013-08-16 02:20:54 +00:00
|
|
|
|
using NzbDrone.Host;
|
2013-08-07 05:32:22 +00:00
|
|
|
|
using NzbDrone.SysTray;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone
|
|
|
|
|
{
|
|
|
|
|
public static class WindowsApp
|
|
|
|
|
{
|
2013-08-30 22:55:01 +00:00
|
|
|
|
|
2013-08-07 05:32:22 +00:00
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2013-08-16 02:20:54 +00:00
|
|
|
|
var container = Bootstrap.Start(new StartupArguments(args), new MessageBoxUserAlert());
|
2013-08-07 05:32:22 +00:00
|
|
|
|
container.Register<ISystemTrayApp, SystemTrayApp>();
|
|
|
|
|
container.Resolve<ISystemTrayApp>().Start();
|
|
|
|
|
}
|
2013-08-16 02:20:54 +00:00
|
|
|
|
catch (TerminateApplicationException)
|
|
|
|
|
{
|
|
|
|
|
}
|
2013-08-07 05:32:22 +00:00
|
|
|
|
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!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|