2010-10-14 06:29:01 +00:00
|
|
|
|
using System;
|
|
|
|
|
using NLog;
|
2011-10-07 03:37:41 +00:00
|
|
|
|
using Ninject;
|
2011-10-07 06:36:04 +00:00
|
|
|
|
using NzbDrone.Providers;
|
2011-10-07 01:30:44 +00:00
|
|
|
|
|
2010-10-10 19:00:07 +00:00
|
|
|
|
namespace NzbDrone
|
2010-09-23 03:19:47 +00:00
|
|
|
|
{
|
2011-10-07 06:36:04 +00:00
|
|
|
|
public static class Program
|
2010-09-23 03:19:47 +00:00
|
|
|
|
{
|
2011-10-07 03:37:41 +00:00
|
|
|
|
public static readonly StandardKernel Kernel = new StandardKernel();
|
2010-10-14 06:29:01 +00:00
|
|
|
|
|
2011-10-07 06:43:35 +00:00
|
|
|
|
private static readonly Logger Logger = LogManager.GetLogger("Host.Main");
|
2011-10-07 01:30:44 +00:00
|
|
|
|
|
2011-04-10 02:44:01 +00:00
|
|
|
|
private static void Main()
|
2010-10-14 06:29:01 +00:00
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2011-10-07 06:36:04 +00:00
|
|
|
|
Kernel.Bind<ConfigProvider>().ToSelf().InSingletonScope();
|
|
|
|
|
Kernel.Bind<ConsoleProvider>().ToSelf().InSingletonScope();
|
|
|
|
|
Kernel.Bind<DebuggerProvider>().ToSelf().InSingletonScope();
|
|
|
|
|
Kernel.Bind<EnviromentProvider>().ToSelf().InSingletonScope();
|
|
|
|
|
Kernel.Bind<IISProvider>().ToSelf().InSingletonScope();
|
|
|
|
|
Kernel.Bind<MonitoringProvider>().ToSelf().InSingletonScope();
|
|
|
|
|
Kernel.Bind<ProcessProvider>().ToSelf().InSingletonScope();
|
|
|
|
|
Kernel.Bind<ServiceProvider>().ToSelf().InSingletonScope();
|
|
|
|
|
Kernel.Bind<WebClientProvider>().ToSelf().InSingletonScope();
|
|
|
|
|
|
2011-10-07 03:37:41 +00:00
|
|
|
|
Console.WriteLine("Starting Console.");
|
2011-10-07 06:36:04 +00:00
|
|
|
|
Kernel.Get<MonitoringProvider>().Start();
|
2011-10-07 03:37:41 +00:00
|
|
|
|
Kernel.Get<Application>().Start();
|
2011-04-22 17:09:06 +00:00
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
2011-10-07 03:37:41 +00:00
|
|
|
|
Console.WriteLine(e.ToString());
|
|
|
|
|
Logger.Fatal(e.ToString());
|
2011-04-22 17:09:06 +00:00
|
|
|
|
}
|
2011-04-25 18:41:20 +00:00
|
|
|
|
|
|
|
|
|
Console.WriteLine("Press enter to exit.");
|
|
|
|
|
Console.ReadLine();
|
2011-04-22 17:09:06 +00:00
|
|
|
|
}
|
2010-09-23 03:19:47 +00:00
|
|
|
|
}
|
2011-04-10 02:44:01 +00:00
|
|
|
|
}
|