Container Cleanup

pull/4/head
kayone 11 years ago committed by Mark McDowall
parent 68129e3518
commit abd994ef71

@ -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();

@ -6,7 +6,6 @@ namespace NzbDrone.Common.Composition
{ {
public interface IContainer public interface IContainer
{ {
TinyIoCContainer TinyContainer { get; }
void Register<T>(T instance) where T : class; void Register<T>(T instance) where T : class;
void Register<TService, TImplementation>() void Register<TService, TImplementation>()
@ -16,14 +15,8 @@ namespace NzbDrone.Common.Composition
object Resolve(Type type); object Resolve(Type type);
void Register(Type serviceType, Type implementationType); void Register(Type serviceType, Type implementationType);
void Register<TService>(Func<IContainer, TService> factory) where TService : class; void Register<TService>(Func<IContainer, TService> factory) where TService : class;
void RegisterSingleton<TService, TImplementation>()
where TImplementation : class, TService
where TService : class;
void RegisterSingleton<T>() where T : class;
void RegisterSingleton(Type service, Type implementation); void RegisterSingleton(Type service, Type implementation);
IEnumerable<T> ResolveAll<T>() where T : class; IEnumerable<T> ResolveAll<T>() where T : class;
IEnumerable<object> ResolveAll(Type type);
void Register(Type registrationType, object instance);
void RegisterAllAsSingleton(Type registrationType, IEnumerable<Type> implementationList); void RegisterAllAsSingleton(Type registrationType, IEnumerable<Type> implementationList);
bool IsTypeRegistered(Type type); bool IsTypeRegistered(Type type);

Loading…
Cancel
Save