Ejemplo n.º 1
0
 public LayoutRendererFactory(ServiceRepository serviceRepository, LayoutRendererFactory globalDefaultFactory) : base(serviceRepository, globalDefaultFactory)
 {
     _globalDefaultFactory = globalDefaultFactory;
 }
Ejemplo n.º 2
0
 internal Factory(ServiceRepository serviceRepository, Factory <TBaseType, TAttributeType> globalDefaultFactory)
 {
     _serviceRepository    = serviceRepository;
     _globalDefaultFactory = globalDefaultFactory;
 }
 /// <summary>
 /// Registers singleton-object as implementation of specific interface.
 /// </summary>
 /// <remarks>
 /// If the same single-object implements multiple interfaces then it must be registered for each interface
 /// </remarks>
 /// <typeparam name="T">Type of interface</typeparam>
 /// <param name="serviceRepository">The repo</param>
 /// <param name="singleton">Singleton object to use for override</param>
 public static ServiceRepository RegisterSingleton <T>(this ServiceRepository serviceRepository, T singleton) where T : class
 {
     serviceRepository.RegisterService(typeof(T), singleton);
     return(serviceRepository);
 }