| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using System;
- using System.Reflection;
- namespace Abp.Dependency
- {
- /// <summary>
- /// Define interface for classes those are used to register dependencies.
- /// </summary>
- public interface IIocRegistrar
- {
- /// <summary>
- /// Adds a dependency registrar for conventional registration.
- /// </summary>
- /// <param name="registrar">dependency registrar</param>
- void AddConventionalRegistrar(IConventionalDependencyRegistrar registrar);
- /// <summary>
- /// Registers types of given assembly by all conventional registrars. See <see cref="IocManager.AddConventionalRegistrar"/> method.
- /// </summary>
- /// <param name="assembly">Assembly to register</param>
- void RegisterAssemblyByConvention(Assembly assembly);
- /// <summary>
- /// Registers types of given assembly by all conventional registrars. See <see cref="IocManager.AddConventionalRegistrar"/> method.
- /// </summary>
- /// <param name="assembly">Assembly to register</param>
- /// <param name="config">Additional configuration</param>
- void RegisterAssemblyByConvention(Assembly assembly, ConventionalRegistrationConfig config);
- /// <summary>
- /// Registers a type as self registration.
- /// </summary>
- /// <typeparam name="T">Type of the class</typeparam>
- /// <param name="lifeStyle">Lifestyle of the objects of this type</param>
- void Register<T>(DependencyLifeStyle lifeStyle = DependencyLifeStyle.Singleton)
- where T : class;
- /// <summary>
- /// Registers a type as self registration.
- /// </summary>
- /// <param name="type">Type of the class</param>
- /// <param name="lifeStyle">Lifestyle of the objects of this type</param>
- void Register(Type type, DependencyLifeStyle lifeStyle = DependencyLifeStyle.Singleton);
- /// <summary>
- /// Registers a type with it's implementation.
- /// </summary>
- /// <typeparam name="TType">Registering type</typeparam>
- /// <typeparam name="TImpl">The type that implements <see cref="TType"/></typeparam>
- /// <param name="lifeStyle">Lifestyle of the objects of this type</param>
- void Register<TType, TImpl>(DependencyLifeStyle lifeStyle = DependencyLifeStyle.Singleton)
- where TType : class
- where TImpl : class, TType;
- /// <summary>
- /// Registers a type with it's implementation.
- /// </summary>
- /// <param name="type">Type of the class</param>
- /// <param name="impl">The type that implements <paramref name="type"/></param>
- /// <param name="lifeStyle">Lifestyle of the objects of this type</param>
- void Register(Type type, Type impl, DependencyLifeStyle lifeStyle = DependencyLifeStyle.Singleton);
- /// <summary>
- /// Checks whether given type is registered before.
- /// </summary>
- /// <param name="type">Type to check</param>
- bool IsRegistered(Type type);
- /// <summary>
- /// Checks whether given type is registered before.
- /// </summary>
- /// <typeparam name="TType">Type to check</typeparam>
- bool IsRegistered<TType>();
- }
- }
|