|
|
@ -24,8 +24,6 @@ namespace NzbDrone.Common.Composition
|
|
|
|
_container.Register<TService, TImplementation>();
|
|
|
|
_container.Register<TService, TImplementation>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public TinyIoCContainer TinyContainer { get { return _container; } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Register<T>(T instance) where T : class
|
|
|
|
public void Register<T>(T instance) where T : class
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_container.Register<T>(instance);
|
|
|
|
_container.Register<T>(instance);
|
|
|
@ -51,18 +49,6 @@ namespace NzbDrone.Common.Composition
|
|
|
|
_container.Register((c, n) => factory(this));
|
|
|
|
_container.Register((c, n) => factory(this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void RegisterSingleton<TService, TImplementation>()
|
|
|
|
|
|
|
|
where TImplementation : class, TService
|
|
|
|
|
|
|
|
where TService : class
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_container.Register<TService, TImplementation>().AsSingleton();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void RegisterSingleton<T>() where T : class
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_container.Register<T, T>().AsSingleton();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void RegisterSingleton(Type service, Type implementation)
|
|
|
|
public void RegisterSingleton(Type service, Type implementation)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_container.Register(service, implementation).AsSingleton();
|
|
|
|
_container.Register(service, implementation).AsSingleton();
|
|
|
@ -73,16 +59,6 @@ namespace NzbDrone.Common.Composition
|
|
|
|
return _container.ResolveAll<T>();
|
|
|
|
return _container.ResolveAll<T>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IEnumerable<object> ResolveAll(Type type)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return _container.ResolveAll(type);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Register(Type registrationType, object instance)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_container.Register(registrationType, instance);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void RegisterAllAsSingleton(Type registrationType, IEnumerable<Type> implementationList)
|
|
|
|
public void RegisterAllAsSingleton(Type registrationType, IEnumerable<Type> implementationList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_container.RegisterMultiple(registrationType, implementationList).AsSingleton();
|
|
|
|
_container.RegisterMultiple(registrationType, implementationList).AsSingleton();
|
|
|
|