2013-05-11 02:53:50 +03:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using TinyIoC;
|
|
|
|
|
|
|
|
namespace NzbDrone.Common.Composition
|
|
|
|
{
|
|
|
|
public interface IContainer
|
|
|
|
{
|
|
|
|
TinyIoCContainer TinyContainer { get; }
|
|
|
|
void Register<T>(T instance) where T : class;
|
|
|
|
|
|
|
|
void Register<TService, TImplementation>()
|
|
|
|
where TImplementation : class, TService
|
|
|
|
where TService : class;
|
|
|
|
T Resolve<T>() where T : class;
|
|
|
|
object Resolve(Type type);
|
|
|
|
void Register(Type serviceType, Type implementationType);
|
|
|
|
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);
|
|
|
|
IEnumerable<T> ResolveAll<T>() where T : class;
|
|
|
|
IEnumerable<object> ResolveAll(Type type);
|
|
|
|
void Register(Type registrationType, object instance);
|
2013-05-30 04:33:20 +03:00
|
|
|
void RegisterAllAsSingleton(Type registrationType, IEnumerable<Type> implementationList);
|
2013-05-11 02:53:50 +03:00
|
|
|
bool IsTypeRegistered(Type type);
|
2013-05-13 03:36:23 +03:00
|
|
|
|
|
|
|
IEnumerable<Type> GetImplementations(Type contractType);
|
2013-05-11 02:53:50 +03:00
|
|
|
}
|
|
|
|
}
|