2016-12-23 23:45:24 +02:00
|
|
|
using System.Collections.Generic;
|
2014-01-06 09:20:08 +03:00
|
|
|
using Nancy.Bootstrapper;
|
2013-04-20 03:05:48 +03:00
|
|
|
using NzbDrone.Api;
|
2013-05-11 02:53:50 +03:00
|
|
|
using NzbDrone.Common.Composition;
|
2013-07-09 03:47:09 +03:00
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
2016-04-24 16:20:45 +02:00
|
|
|
using NzbDrone.Common.Http.Dispatchers;
|
2013-09-11 09:33:47 +03:00
|
|
|
using NzbDrone.SignalR;
|
2013-04-20 03:05:48 +03:00
|
|
|
|
2013-08-07 08:32:22 +03:00
|
|
|
namespace NzbDrone.Host
|
2013-04-20 03:05:48 +03:00
|
|
|
{
|
|
|
|
public class MainAppContainerBuilder : ContainerBuilderBase
|
|
|
|
{
|
2013-11-26 09:53:36 +03:00
|
|
|
public static IContainer BuildContainer(StartupContext args)
|
2013-04-20 03:05:48 +03:00
|
|
|
{
|
2015-10-03 19:45:26 +02:00
|
|
|
var assemblies = new List<string>
|
2014-01-06 09:20:08 +03:00
|
|
|
{
|
|
|
|
"NzbDrone.Host",
|
|
|
|
"NzbDrone.Core",
|
|
|
|
"NzbDrone.Api",
|
|
|
|
"NzbDrone.SignalR"
|
|
|
|
};
|
|
|
|
|
2017-01-04 20:51:09 +02:00
|
|
|
return new MainAppContainerBuilder(args, assemblies).Container;
|
2013-04-20 03:05:48 +03:00
|
|
|
}
|
|
|
|
|
2017-01-04 20:51:09 +02:00
|
|
|
private MainAppContainerBuilder(StartupContext args, List<string> assemblies)
|
2014-01-06 09:20:08 +03:00
|
|
|
: base(args, assemblies)
|
2013-04-20 03:05:48 +03:00
|
|
|
{
|
2013-05-11 02:53:50 +03:00
|
|
|
AutoRegisterImplementations<NzbDronePersistentConnection>();
|
2013-04-20 03:05:48 +03:00
|
|
|
|
2013-05-11 02:53:50 +03:00
|
|
|
Container.Register<INancyBootstrapper, NancyBootstrapper>();
|
2016-04-24 16:20:45 +02:00
|
|
|
Container.Register<IHttpDispatcher, FallbackHttpDispatcher>();
|
2013-07-09 03:47:09 +03:00
|
|
|
}
|
2013-04-20 03:05:48 +03:00
|
|
|
}
|
|
|
|
}
|