If I defined in config:
container.Register(
Component.For<X.Y.Z.IActivityService>()
.ImplementedBy<X.Y.Z.ActivityService>()
.ServiceOverrides(ServiceOverride.ForKey("Listeners").Eq(new [] { typeof(X.Y.Z.DefaultActivityListener).FullName }))
.LifeStyle.Transient
);
and I want to expand this configuration and add a new element to the Listeners array property so that the final configuration is efficient:
container.Register(
Component.For<X.Y.Z.IActivityService>()
.ImplementedBy<X.Y.Z.ActivityService>()
.ServiceOverrides(ServiceOverride.ForKey("Listeners").Eq(new [] { typeof(X.Y.Z.DefaultActivityListener).FullName, "MyOtherListenerID" }))
.LifeStyle.Transient
);
Do I have to know the contents of the "array" when I first register the component, or can I get the registration of the component and add to it?
I want to implement my configuration using a decorator template so that I can create my container and then expand it as needed for different scenarios. This means that I need to have access to the components already configured and add to them.
DefaultConfig, , "DecoratedConfig", .
,
IWindsorContaner c = new DecoratedConfig(new DefaultConfig()).InitialiseContainer();
DefaultConfig ActivityService DefaultActivityListener ( ).
DecoratedConfig , ActivityService Listener Listeners ActivityService.
.