1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-01-10 23:29:53 +02:00
Sonarr/NzbDrone/Program.cs

43 lines
1.6 KiB
C#
Raw Normal View History

2010-10-14 09:29:01 +03:00
using System;
2011-10-08 08:06:16 +03:00
using System.Reflection;
2010-10-14 09:29:01 +03:00
using NLog;
2011-10-07 06:37:41 +03:00
using Ninject;
2011-10-07 09:36:04 +03:00
using NzbDrone.Providers;
2010-10-10 22:00:07 +03:00
namespace NzbDrone
2010-09-23 06:19:47 +03:00
{
2011-10-07 09:36:04 +03:00
public static class Program
2010-09-23 06:19:47 +03:00
{
2011-10-07 06:37:41 +03:00
public static readonly StandardKernel Kernel = new StandardKernel();
2010-10-14 09:29:01 +03:00
2011-10-07 09:43:35 +03:00
private static readonly Logger Logger = LogManager.GetLogger("Host.Main");
2011-04-10 05:44:01 +03:00
private static void Main()
2010-10-14 09:29:01 +03:00
{
try
{
2011-10-07 09:36:04 +03: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-08 08:06:16 +03:00
Console.WriteLine("Starting NzbDrone Console. Version " + Assembly.GetExecutingAssembly().GetName().Version);
2011-10-07 09:36:04 +03:00
Kernel.Get<MonitoringProvider>().Start();
2011-10-07 06:37:41 +03:00
Kernel.Get<Application>().Start();
}
catch (Exception e)
{
2011-10-07 06:37:41 +03:00
Console.WriteLine(e.ToString());
Logger.Fatal(e.ToString());
}
Console.WriteLine("Press enter to exit.");
Console.ReadLine();
}
2010-09-23 06:19:47 +03:00
}
2011-04-10 05:44:01 +03:00
}