2013-07-09 02:47:09 +02:00
|
|
|
|
using Nancy.Bootstrapper;
|
2013-04-20 02:05:48 +02:00
|
|
|
|
using NzbDrone.Api;
|
2013-05-05 23:24:33 +02:00
|
|
|
|
using NzbDrone.Api.SignalR;
|
2013-05-11 01:53:50 +02:00
|
|
|
|
using NzbDrone.Common.Composition;
|
2013-07-09 02:47:09 +02:00
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
2013-04-20 02:05:48 +02:00
|
|
|
|
using NzbDrone.Core.Datastore;
|
|
|
|
|
using NzbDrone.Core.Organizer;
|
|
|
|
|
using NzbDrone.Core.RootFolders;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone
|
|
|
|
|
{
|
|
|
|
|
public class MainAppContainerBuilder : ContainerBuilderBase
|
|
|
|
|
{
|
2013-07-09 02:47:09 +02:00
|
|
|
|
public static IContainer BuildContainer(string[] args)
|
2013-04-20 02:05:48 +02:00
|
|
|
|
{
|
2013-07-09 02:47:09 +02:00
|
|
|
|
return new MainAppContainerBuilder(args).Container;
|
2013-04-20 02:05:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2013-07-09 02:47:09 +02:00
|
|
|
|
private MainAppContainerBuilder(string[] args)
|
2013-04-20 02:05:48 +02:00
|
|
|
|
: base("NzbDrone", "NzbDrone.Common", "NzbDrone.Core", "NzbDrone.Api")
|
|
|
|
|
{
|
2013-05-11 01:53:50 +02:00
|
|
|
|
AutoRegisterImplementations<NzbDronePersistentConnection>();
|
2013-04-20 02:05:48 +02:00
|
|
|
|
|
2013-05-11 01:53:50 +02:00
|
|
|
|
Container.Register(typeof(IBasicRepository<RootFolder>), typeof(BasicRepository<RootFolder>));
|
|
|
|
|
Container.Register(typeof(IBasicRepository<NamingConfig>), typeof(BasicRepository<NamingConfig>));
|
2013-04-20 02:05:48 +02:00
|
|
|
|
|
2013-05-11 01:53:50 +02:00
|
|
|
|
Container.Register<INancyBootstrapper, NancyBootstrapper>();
|
2013-04-20 02:05:48 +02:00
|
|
|
|
|
2013-07-09 02:47:09 +02:00
|
|
|
|
Container.Register(new StartupArguments(args));
|
|
|
|
|
}
|
2013-04-20 02:05:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|