/// <summary>
 /// Method to determine if this component shall be installed
 /// </summary>
 protected internal override bool ShallInstall(IComponentRegistrator registrator, Type foundType)
 {
     if (base.ShallInstall(registrator, foundType))
     {
         return(_depReg.InstallerMode == InstallerMode.All || TypeRequired(foundType));
     }
     return(false);
 }
Esempio n. 2
0
 /// <summary>
 /// Install components to the container
 /// </summary>
 /// <param name="registrator">Registrator to register new types</param>
 public virtual void Install(IComponentRegistrator registrator)
 {
     // Install all components
     foreach (var type in _targetAssembly.GetTypes())
     {
         // Register all we want
         if (ShallInstall(registrator, type))
         {
             registrator.Register(type);
         }
     }
 }
        /// <summary>
        /// Constructor to modify the applied registrator
        /// </summary>
        /// <param name="registrator">Registrator replacement</param>
        internal CastleContainer(ComponentRegistrator registrator)
        {
            // Boot up the container and give it to the registrator
            Container   = registrator.Container = new WindsorContainer();
            Registrator = registrator;

            Container.AddFacility <TypedFactoryFacility>();
            Container.AddFacility <MoryxFacility>();

            // Self registration for framework functionality
            SetInstance <IContainer>(this);
        }
Esempio n. 4
0
 /// <summary>
 /// Method to determine if this component shall be installed
 /// </summary>
 protected internal virtual bool ShallInstall(IComponentRegistrator registrator, Type foundType)
 {
     return(registrator.ShallInstall(foundType));
 }
 /// <inheritdoc />
 public void Install(IComponentRegistrator registrator)
 {
     registrator.Register(typeof(EmptyInterceptor));
     registrator.Register(typeof(DummyLogger), new [] { typeof(IModuleLogger) });
 }
Esempio n. 6
0
 public void Install(IComponentRegistrator registrator)
 {
     registrator.Register(typeof(ContextFactory <>), new [] { typeof(IContextFactory <>) }, "GenericContextFactory", LifeCycle.Singleton);
     registrator.Register(typeof(UnitOfWorkFactory <>), new[] { typeof(IUnitOfWorkFactory <>) }, "UnitOfWorkFactory", LifeCycle.Singleton);
 }
        /// <summary>
        /// Install all components
        /// </summary>
        public override void Install(IComponentRegistrator registrator)
        {
            SkippedNamed = !ShallInstall(registrator, typeof(NamedDummy));

            SkippedUnnamed = !ShallInstall(registrator, typeof(UnnamedDummy));
        }