diff --git a/LightweightIocContainer/Interfaces/IIocContainer.cs b/LightweightIocContainer/Interfaces/IIocContainer.cs index 676e121..efdb7ba 100644 --- a/LightweightIocContainer/Interfaces/IIocContainer.cs +++ b/LightweightIocContainer/Interfaces/IIocContainer.cs @@ -101,6 +101,14 @@ namespace LightweightIocContainer.Interfaces /// The created IMultitonRegistration RegisterMultiton() where TImplementation : TInterface; + /// + /// Register multiple interfaces for a that implements them as a multiton + /// + /// The base interface to register + /// A second interface to register + /// The Type that implements the interface + /// The Type of the multiton scope + /// The created IMultipleMultitonRegistration RegisterMultiton() where TImplementation : TInterface1, TInterface2; /// diff --git a/LightweightIocContainer/Interfaces/Registrations/IMultipleMultitonRegistration.cs b/LightweightIocContainer/Interfaces/Registrations/IMultipleMultitonRegistration.cs index cfc9c7f..079248d 100644 --- a/LightweightIocContainer/Interfaces/Registrations/IMultipleMultitonRegistration.cs +++ b/LightweightIocContainer/Interfaces/Registrations/IMultipleMultitonRegistration.cs @@ -4,6 +4,12 @@ namespace LightweightIocContainer.Interfaces.Registrations { + /// + /// An to register multiple interfaces for on implementation type that implements them as a multiton + /// + /// The first interface + /// The second interface + /// The implementation public interface IMultipleMultitonRegistration : IMultitonRegistration, IMultipleRegistration where TImplementation : TInterface1, TInterface2 { diff --git a/LightweightIocContainer/IocContainer.cs b/LightweightIocContainer/IocContainer.cs index 57c2e84..0382121 100644 --- a/LightweightIocContainer/IocContainer.cs +++ b/LightweightIocContainer/IocContainer.cs @@ -193,6 +193,14 @@ namespace LightweightIocContainer return registration; } + /// + /// Register multiple interfaces for a that implements them as a multiton + /// + /// The base interface to register + /// A second interface to register + /// The Type that implements the interface + /// The Type of the multiton scope + /// The created public IMultipleMultitonRegistration RegisterMultiton() where TImplementation : TInterface1, TInterface2 { IMultipleMultitonRegistration registration = _registrationFactory.RegisterMultiton(); diff --git a/LightweightIocContainer/LightweightIocContainer.xml b/LightweightIocContainer/LightweightIocContainer.xml index a2891e6..9d9947d 100644 --- a/LightweightIocContainer/LightweightIocContainer.xml +++ b/LightweightIocContainer/LightweightIocContainer.xml @@ -447,6 +447,16 @@ The Type of the multiton scope The created + + + Register multiple interfaces for a that implements them as a multiton + + The base interface to register + A second interface to register + The Type that implements the interface + The Type of the multiton scope + The created + Register an Interface as an abstract typed factory @@ -575,6 +585,14 @@ The Lifestyle of Instances that are created with this + + + An to register multiple interfaces for on implementation type that implements them as a multiton + + The first interface + The second interface + The implementation + The base interface for every to register multiple interfaces @@ -827,6 +845,16 @@ The Type of the multiton scope The created + + + Register multiple interfaces for a that implements them as a multiton + + The base interface to register + A second interface to register + The Type that implements the interface + The Type of the multiton scope + The created + Register an Interface as an abstract typed factory @@ -989,6 +1017,35 @@ The of the implementation The of the + + + An to register multiple interfaces for on implementation type that implements them as a multiton + + The first interface + The second interface + The implementation + + + + An to register multiple interfaces for on implementation type that implements them as a multiton + + The of the first interface + The of the second interface + The of the implementation + The of the multiton scope + + + + A of s that are registered within this + + + + + Pass an that will be invoked when an instance of this type is created + + The + The current instance of this + The base class for every to register multiple interfaces @@ -1299,6 +1356,16 @@ The Type of the multiton scope A new created with the given parameters + + + Register multiple interfaces for a that implements them as a multiton + + The base interface to register + A second interface to register + The Type that implements the interface + The Type of the multiton scope + A new created with the given parameters + Register an Interface as an abstract typed factory and create a diff --git a/LightweightIocContainer/Registrations/MultipleMultitonRegistration.cs b/LightweightIocContainer/Registrations/MultipleMultitonRegistration.cs index abc784f..d2ce510 100644 --- a/LightweightIocContainer/Registrations/MultipleMultitonRegistration.cs +++ b/LightweightIocContainer/Registrations/MultipleMultitonRegistration.cs @@ -8,8 +8,21 @@ using LightweightIocContainer.Interfaces.Registrations; namespace LightweightIocContainer.Registrations { + /// + /// An to register multiple interfaces for on implementation type that implements them as a multiton + /// + /// The first interface + /// The second interface + /// The implementation public class MultipleMultitonRegistration : MultitonRegistration, IMultipleMultitonRegistration where TImplementation : TInterface1, TInterface2 { + /// + /// An to register multiple interfaces for on implementation type that implements them as a multiton + /// + /// The of the first interface + /// The of the second interface + /// The of the implementation + /// The of the multiton scope public MultipleMultitonRegistration(Type interfaceType1, Type interfaceType2, Type implementationType, Type scope) : base(interfaceType1, implementationType, scope) { @@ -20,8 +33,16 @@ namespace LightweightIocContainer.Registrations }; } + /// + /// A of s that are registered within this + /// public List Registrations { get; } + /// + /// Pass an that will be invoked when an instance of this type is created + /// + /// The + /// The current instance of this public override ITypedRegistrationBase OnCreate(Action action) { foreach (var registration in Registrations) diff --git a/LightweightIocContainer/Registrations/RegistrationFactory.cs b/LightweightIocContainer/Registrations/RegistrationFactory.cs index d17d1e4..03913e5 100644 --- a/LightweightIocContainer/Registrations/RegistrationFactory.cs +++ b/LightweightIocContainer/Registrations/RegistrationFactory.cs @@ -119,6 +119,14 @@ namespace LightweightIocContainer.Registrations return new MultitonRegistration(typeof(TInterface), typeof(TImplementation), typeof(TScope)); } + /// + /// Register multiple interfaces for a that implements them as a multiton + /// + /// The base interface to register + /// A second interface to register + /// The Type that implements the interface + /// The Type of the multiton scope + /// A new created with the given parameters public IMultipleMultitonRegistration RegisterMultiton() where TImplementation : TInterface1, TInterface2 { return new MultipleMultitonRegistration(typeof(TInterface1), typeof(TInterface2), typeof(TImplementation), typeof(TScope));