2013-08-07 08:32:22 +03:00
|
|
|
using System;
|
|
|
|
using System.Windows.Forms;
|
2013-08-31 01:55:01 +03:00
|
|
|
using NLog;
|
2013-08-13 08:08:37 +03:00
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
2013-08-31 04:42:30 +03:00
|
|
|
using NzbDrone.Common.Instrumentation;
|
2013-08-16 05:20:54 +03:00
|
|
|
using NzbDrone.Host;
|
2013-08-07 08:32:22 +03:00
|
|
|
using NzbDrone.SysTray;
|
|
|
|
|
|
|
|
namespace NzbDrone
|
|
|
|
{
|
|
|
|
public static class WindowsApp
|
|
|
|
{
|
2013-08-31 04:42:30 +03:00
|
|
|
private static readonly Logger Logger = NzbDroneLogger.GetLogger();
|
2013-08-31 01:55:01 +03:00
|
|
|
|
2013-08-07 08:32:22 +03:00
|
|
|
public static void Main(string[] args)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2013-08-31 04:42:30 +03:00
|
|
|
var startupArgs = new StartupArguments(args);
|
|
|
|
|
|
|
|
LogTargets.Register(startupArgs, false, true);
|
|
|
|
|
|
|
|
var container = Bootstrap.Start(startupArgs, new MessageBoxUserAlert());
|
2013-08-07 08:32:22 +03:00
|
|
|
container.Register<ISystemTrayApp, SystemTrayApp>();
|
|
|
|
container.Resolve<ISystemTrayApp>().Start();
|
|
|
|
}
|
2013-08-16 05:20:54 +03:00
|
|
|
catch (TerminateApplicationException)
|
|
|
|
{
|
|
|
|
}
|
2013-08-07 08:32:22 +03:00
|
|
|
catch (Exception e)
|
|
|
|
{
|
2013-09-07 09:38:31 +03:00
|
|
|
Logger.FatalException("EPIC FAIL: " + e.Message, e);
|
2013-08-07 08:32:22 +03:00
|
|
|
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 04:42:30 +03:00
|
|
|
}
|