2014-01-06 06:20:08 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Nancy.Bootstrapper;
|
2013-04-20 00:05:48 +00:00
|
|
|
|
using NzbDrone.Api;
|
2013-05-10 23:53:50 +00:00
|
|
|
|
using NzbDrone.Common.Composition;
|
2013-07-09 00:47:09 +00:00
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
2013-04-20 00:05:48 +00:00
|
|
|
|
using NzbDrone.Core.Datastore;
|
|
|
|
|
using NzbDrone.Core.Organizer;
|
2013-09-11 06:33:47 +00:00
|
|
|
|
using NzbDrone.SignalR;
|
2013-04-20 00:05:48 +00:00
|
|
|
|
|
2013-08-07 05:32:22 +00:00
|
|
|
|
namespace NzbDrone.Host
|
2013-04-20 00:05:48 +00:00
|
|
|
|
{
|
|
|
|
|
public class MainAppContainerBuilder : ContainerBuilderBase
|
|
|
|
|
{
|
2013-11-26 06:53:36 +00:00
|
|
|
|
public static IContainer BuildContainer(StartupContext args)
|
2013-04-20 00:05:48 +00:00
|
|
|
|
{
|
2014-01-06 06:20:08 +00:00
|
|
|
|
var assemblies = new List<String>
|
|
|
|
|
{
|
|
|
|
|
"NzbDrone.Host",
|
|
|
|
|
"NzbDrone.Common",
|
|
|
|
|
"NzbDrone.Core",
|
|
|
|
|
"NzbDrone.Api",
|
|
|
|
|
"NzbDrone.SignalR"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (OsInfo.IsWindows)
|
|
|
|
|
{
|
|
|
|
|
assemblies.Add("NzbDrone.Windows");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
assemblies.Add("NzbDrone.Mono");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new MainAppContainerBuilder(args, assemblies.ToArray()).Container;
|
2013-04-20 00:05:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-01-06 06:20:08 +00:00
|
|
|
|
private MainAppContainerBuilder(StartupContext args, string[] assemblies)
|
|
|
|
|
: base(args, assemblies)
|
2013-04-20 00:05:48 +00:00
|
|
|
|
{
|
2013-05-10 23:53:50 +00:00
|
|
|
|
AutoRegisterImplementations<NzbDronePersistentConnection>();
|
2013-04-20 00:05:48 +00:00
|
|
|
|
|
2013-05-10 23:53:50 +00:00
|
|
|
|
Container.Register(typeof(IBasicRepository<NamingConfig>), typeof(BasicRepository<NamingConfig>));
|
2013-04-20 00:05:48 +00:00
|
|
|
|
|
2013-05-10 23:53:50 +00:00
|
|
|
|
Container.Register<INancyBootstrapper, NancyBootstrapper>();
|
2013-07-09 00:47:09 +00:00
|
|
|
|
}
|
2013-04-20 00:05:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|