- creation of registrations is done in registrationCollector now
- installers don't get container anymore, get registrationCollector
- allow validation
- introduce dispose strategies (#55)
/// The dispose strategy that is used for a singleton or multiton that implements <see cref="IDisposable"/> and is created by the <see cref="IocContainer"/>
/// </summary>
publicenumDisposeStrategy
{
/// <summary>
/// No dispose strategy
/// <remarks>Invalid for singletons or multitons that implement <see cref="IDisposable"/></remarks>
/// </summary>
None,
/// <summary>
/// The application is responsible for correctly disposing the instance. Nothing is done by the <see cref="IocContainer"/>
/// </summary>
Application,
/// <summary>
/// The <see cref="IocContainer"/> is responsible for disposing the instance when itself is disposed
/// The <see cref="LightweightIocContainer.DisposeStrategy"/> of singletons/multitons that implement <see cref="IDisposable"/> and are created with this <see cref="IRegistration"/>
thrownewInvalidRegistrationException("This function can only be used to register open generic types.");
addRegistration(registrationCollector);
if(lifestyle==Lifestyle.Multiton)
thrownewInvalidRegistrationException("Can't register a multiton with open generic registration.");//TODO: Is there any need for a possibility to register multitons with open generics?
thrownewInvalidRegistrationException("Can't register a type as Lifestyle.Multiton without a scope (Registration is not of type IMultitonRegistration).");
Registrations.Add(registration);
Registrations.Add(registration);
}
}
/// <summary>
/// Register all <see cref="IMultipleRegistration{TInterface1,TImplementation}.Registrations"/> from an <see cref="IMultipleRegistration{TInterface1,TImplementation}"/>
/// </summary>
/// <typeparam name="TInterface1">The <see cref="Type"/> of the first registered interface</typeparam>
/// <typeparam name="TImplementation">The <see cref="Type"/> of the registered implementation</typeparam>
The dispose strategy that is used for a singleton or multiton that implements <seecref="T:System.IDisposable"/> and is created by the <seecref="T:LightweightIocContainer.IocContainer"/>
Returns the first element of a <seecref="T:System.Collections.Generic.IEnumerable`1"/>, or a new instance of a given <seecref="T:System.Type"/> if the <seecref="T:System.Collections.Generic.IEnumerable`1"/> contains no elements
Returns the first element of a <seecref="T:System.Collections.Generic.IEnumerable`1"/>, or a new instance of a given <seecref="T:System.Type"/> if the <seecref="T:System.Collections.Generic.IEnumerable`1"/> contains no elements
@ -57,6 +78,14 @@
<paramname="predicate">A function to test each element for a condition</param>
<paramname="predicate">A function to test each element for a condition</param>
<returns>The first element of the <seecref="T:System.Collections.Generic.IEnumerable`1"/> or a new instance of the given <seecref="T:System.Type"/> when no element is found</returns>
<returns>The first element of the <seecref="T:System.Collections.Generic.IEnumerable`1"/> or a new instance of the given <seecref="T:System.Type"/> when no element is found</returns>
The <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/>s of the Assembly that this <seecref="T:LightweightIocContainer.Installers.AssemblyInstaller"/> is installing
The <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/>s of the Assembly that this <seecref="T:LightweightIocContainer.Installers.AssemblyInstaller"/> is installing
Install the found <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/>s in the given <seecref="T:LightweightIocContainer.Interfaces.IIocContainer"/>
Install the found <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/>s in the given <seecref="T:LightweightIocContainer.Interfaces.IIocContainer"/>
<paramname="registration">The <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationCollector"/> where<seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s are added</param>
Register an Interface with a Type that implements it
</summary>
<typeparamname="TInterface">The Interface to register</typeparam>
<typeparamname="TImplementation">The Type that implements the interface</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
Register an open generic Interface with an open generic Type that implements it
</summary>
<paramname="tInterface">The open generic Interface to register</param>
<paramname="tImplementation">The open generic Type that implements the interface</param>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
Register multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to register</typeparam>
<typeparamname="TInterface2">A second interface to register</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`2"/></returns>
Register multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to register</typeparam>
<typeparamname="TInterface2">A second interface to register</typeparam>
<typeparamname="TInterface3">A third interface to register</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`3"/></returns>
Register multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to register</typeparam>
<typeparamname="TInterface2">A second interface to register</typeparam>
<typeparamname="TInterface3">A third interface to register</typeparam>
<typeparamname="TInterface4">A fourth interface to register</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`4"/></returns>
Register multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to register</typeparam>
<typeparamname="TInterface2">A second interface to register</typeparam>
<typeparamname="TInterface3">A third interface to register</typeparam>
<typeparamname="TInterface4">A fourth interface to register</typeparam>
<typeparamname="TInterface5">A fifth interface to register</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`5"/></returns>
Register a <seecref="T:System.Type"/> without an interface
</summary>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> to register</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
Install the needed <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s in the given <seecref="T:LightweightIocContainer.Interfaces.IIocContainer"/>
Install the needed <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s in the given <seecref="T:LightweightIocContainer.Interfaces.IIocContainer"/>
<paramname="registration">The <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationCollector"/> where<seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s are added</param>
The <seecref="T:LightweightIocContainer.DisposeStrategy"/> of singletons/multitons that implement <seecref="T:System.IDisposable"/> and are created with this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>
Provides a <seecref="M:LightweightIocContainer.Interfaces.Registrations.Fluent.IWithFactory.WithFactory``1"/> method to an <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/>
Provides a <seecref="M:LightweightIocContainer.Interfaces.Registrations.Fluent.IWithFactory.WithFactory``1"/> method to an <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/>
@ -654,6 +622,16 @@
<para>Can be set in the <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> by calling <seecref="M:LightweightIocContainer.Interfaces.Registrations.Fluent.IWithParameters.WithParameters(System.Object[])"/></para>
<para>Can be set in the <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> by calling <seecref="M:LightweightIocContainer.Interfaces.Registrations.Fluent.IWithParameters.WithParameters(System.Object[])"/></para>
Provides an internal <seecref="M:LightweightIocContainer.Interfaces.Registrations.IInternalValidationProvider.Validate"/> method to an <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/>
Provides a <seecref="T:LightweightIocContainer.Lifestyle"/> to an <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>
Provides a <seecref="T:LightweightIocContainer.Lifestyle"/> to an <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>
@ -759,6 +737,102 @@
The <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/> that is used to register an Interface and extends the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/> with fluent options
The <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/> that is used to register an Interface and extends the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/> with fluent options
<typeparamname="TInterface">The Interface to add</typeparam>
<typeparamname="TImplementation">The Type that implements the interface</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
Add an open generic Interface with an open generic Type that implements it
</summary>
<paramname="tInterface">The open generic Interface to add</param>
<paramname="tImplementation">The open generic Type that implements the interface</param>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
Add multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to add</typeparam>
<typeparamname="TInterface2">A second interface to add</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`2"/></returns>
Add multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to add</typeparam>
<typeparamname="TInterface2">A second interface to add</typeparam>
<typeparamname="TInterface3">A third interface to add</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`3"/></returns>
Add multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to add</typeparam>
<typeparamname="TInterface2">A second interface to add</typeparam>
<typeparamname="TInterface3">A third interface to add</typeparam>
<typeparamname="TInterface4">A fourth interface to add</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`4"/></returns>
Add multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to add</typeparam>
<typeparamname="TInterface2">A second interface to add</typeparam>
<typeparamname="TInterface3">A third interface to add</typeparam>
<typeparamname="TInterface4">A fourth interface to add</typeparam>
<typeparamname="TInterface5">A fifth interface to add</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`5"/></returns>
Add a <seecref="T:System.Type"/> without an interface
</summary>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> to add</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
The <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/> to register either only an interface or only a <seecref="T:System.Type"/>
The <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/> to register either only an interface or only a <seecref="T:System.Type"/>
@ -820,98 +894,11 @@
<paramname="installers">The given <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/>s</param>
<paramname="installers">The given <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/>s</param>
<returns>An instance of the current <seecref="T:LightweightIocContainer.IocContainer"/></returns>
<returns>An instance of the current <seecref="T:LightweightIocContainer.IocContainer"/></returns>
Register an Interface with a Type that implements it
</summary>
<typeparamname="TInterface">The Interface to register</typeparam>
<typeparamname="TImplementation">The Type that implements the interface</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
Register an open generic Interface with an open generic Type that implements it
Register an <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/> at this <seecref="T:LightweightIocContainer.IocContainer"/>
</summary>
</summary>
<paramname="tInterface">The open generic Interface to register</param>
<paramname="addRegistration">The <seecref="T:System.Func`2"/> that creates an <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<paramname="tImplementation">The open generic Type that implements the interface</param>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IOpenGenericRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
<exceptioncref="T:LightweightIocContainer.Exceptions.InvalidRegistrationException">Function can only be used to register open generic types</exception>
<exceptioncref="T:LightweightIocContainer.Exceptions.InvalidRegistrationException">Can't register a multiton with open generic registration</exception>
Register multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to register</typeparam>
<typeparamname="TInterface2">A second interface to register</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`2"/></returns>
Register multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to register</typeparam>
<typeparamname="TInterface2">A second interface to register</typeparam>
<typeparamname="TInterface3">A third interface to register</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`3"/></returns>
Register multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to register</typeparam>
<typeparamname="TInterface2">A second interface to register</typeparam>
<typeparamname="TInterface3">A third interface to register</typeparam>
<typeparamname="TInterface4">A fourth interface to register</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`4"/></returns>
Register multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to register</typeparam>
<typeparamname="TInterface2">A second interface to register</typeparam>
<typeparamname="TInterface3">A third interface to register</typeparam>
<typeparamname="TInterface4">A fourth interface to register</typeparam>
<typeparamname="TInterface5">A fifth interface to register</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`5"/></returns>
Register a <seecref="T:System.Type"/> without an interface
</summary>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> to register</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
<paramname="registration">The given <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<paramname="registration">The given <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<exceptioncref="T:LightweightIocContainer.Exceptions.MultipleRegistrationException">The <seecref="T:System.Type"/> is already registered in this <seecref="T:LightweightIocContainer.IocContainer"/></exception>
<exceptioncref="T:LightweightIocContainer.Exceptions.MultipleRegistrationException">The <seecref="T:System.Type"/> is already registered in this <seecref="T:LightweightIocContainer.IocContainer"/></exception>
Register all <seecref="P:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`2.Registrations"/> from an <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`2"/>
</summary>
<typeparamname="TInterface1">The <seecref="T:System.Type"/> of the first registered interface</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> of the registered implementation</typeparam>
Try to get the sorted constructors for the given <seecref="T:System.Type"/>
Try to get the sorted constructors for the given <seecref="T:System.Type"/>
@ -1384,6 +1370,11 @@
The <seecref="T:System.Type"/> that implements the <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistration.InterfaceType"/> that is registered with this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IOpenGenericRegistration"/>
The <seecref="T:System.Type"/> that implements the <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistration.InterfaceType"/> that is registered with this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IOpenGenericRegistration"/>
The <seecref="T:LightweightIocContainer.Registrations.RegistrationBase"/> that is used to register an Interface
The <seecref="T:LightweightIocContainer.Registrations.RegistrationBase"/> that is used to register an Interface
@ -1407,6 +1398,11 @@
The <seecref="T:LightweightIocContainer.Lifestyle"/> of Instances that are created with this <seecref="T:LightweightIocContainer.Registrations.RegistrationBase"/>
The <seecref="T:LightweightIocContainer.Lifestyle"/> of Instances that are created with this <seecref="T:LightweightIocContainer.Registrations.RegistrationBase"/>
The <seecref="T:LightweightIocContainer.DisposeStrategy"/> of singletons/multitons that implement <seecref="T:System.IDisposable"/> and are created with this <seecref="T:LightweightIocContainer.Registrations.RegistrationBase"/>
An <seecref="T:System.Array"/> of parameters that are used to <seecref="M:LightweightIocContainer.IocContainer.Resolve``1"/> an instance of this <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistration.InterfaceType"/>
An <seecref="T:System.Array"/> of parameters that are used to <seecref="M:LightweightIocContainer.IocContainer.Resolve``1"/> an instance of this <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistration.InterfaceType"/>
@ -1451,6 +1447,153 @@
<typeparamname="TFactoryImplementation">The type of the implementation for the custom factory</typeparam>
<typeparamname="TFactoryImplementation">The type of the implementation for the custom factory</typeparam>
<returns>The current instance of this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></returns>
<returns>The current instance of this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></returns>
Add a <seecref="P:LightweightIocContainer.Registrations.RegistrationBase.DisposeStrategy"/> for the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/>
Validate that no registration that isn't derived from <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultitonRegistration"/> has <seecref="F:LightweightIocContainer.Lifestyle.Multiton"/>
Validate the <seecref="P:LightweightIocContainer.Registrations.RegistrationBase.Factory"/>
</summary>
<exceptioncref="T:LightweightIocContainer.Exceptions.InvalidFactoryRegistrationException">No create method that can create the <seecref="P:LightweightIocContainer.Registrations.RegistrationBase.InterfaceType"/></exception>
Validate the <seecref="P:LightweightIocContainer.Registrations.RegistrationBase.DisposeStrategy"/> for the <seecref="P:LightweightIocContainer.Registrations.RegistrationBase.InterfaceType"/> and <seecref="P:LightweightIocContainer.Registrations.RegistrationBase.Lifestyle"/>
Validate the <seecref="P:LightweightIocContainer.Registrations.RegistrationBase.DisposeStrategy"/> for the given <seecref="T:System.Type"/> and <seecref="P:LightweightIocContainer.Registrations.RegistrationBase.Lifestyle"/>
</summary>
<paramname="type">The given <seecref="T:System.Type"/></param>
<exceptioncref="T:LightweightIocContainer.Exceptions.InvalidDisposeStrategyException">Dispose strategy is invalid for this <seecref="P:LightweightIocContainer.Registrations.RegistrationBase.InterfaceType"/> and <seecref="P:LightweightIocContainer.Registrations.RegistrationBase.Lifestyle"/></exception>
<typeparamname="TInterface">The Interface to add</typeparam>
<typeparamname="TImplementation">The Type that implements the interface</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
Add an open generic Interface with an open generic Type that implements it
</summary>
<paramname="tInterface">The open generic Interface to add</param>
<paramname="tImplementation">The open generic Type that implements the interface</param>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
<exceptioncref="T:LightweightIocContainer.Exceptions.InvalidRegistrationException">Function can only be used to register open generic types</exception>
<exceptioncref="T:LightweightIocContainer.Exceptions.InvalidRegistrationException">Can't register a multiton with open generic registration</exception>
Add multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to add</typeparam>
<typeparamname="TInterface2">A second interface to add</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`2"/></returns>
Add multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to add</typeparam>
<typeparamname="TInterface2">A second interface to add</typeparam>
<typeparamname="TInterface3">A third interface to add</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`3"/></returns>
Add multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to add</typeparam>
<typeparamname="TInterface2">A second interface to add</typeparam>
<typeparamname="TInterface3">A third interface to add</typeparam>
<typeparamname="TInterface4">A fourth interface to add</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`4"/></returns>
Add multiple interfaces for a <seecref="T:System.Type"/> that implements them
</summary>
<typeparamname="TInterface1">The base interface to add</typeparam>
<typeparamname="TInterface2">A second interface to add</typeparam>
<typeparamname="TInterface3">A third interface to add</typeparam>
<typeparamname="TInterface4">A fourth interface to add</typeparam>
<typeparamname="TInterface5">A fifth interface to add</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> that implements both interfaces</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`5"/></returns>
Add a <seecref="T:System.Type"/> without an interface
</summary>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> to add</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
Register all <seecref="P:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`2.Registrations"/> from an <seecref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`2"/>
</summary>
<typeparamname="TInterface1">The <seecref="T:System.Type"/> of the first registered interface</typeparam>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> of the registered implementation</typeparam>
A factory to register interfaces and factories in an <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> and create the needed <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s
A factory to register interfaces and factories in an <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> and create the needed <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s
Validate the <seecref="T:LightweightIocContainer.DisposeStrategy"/> for the <seecref="P:LightweightIocContainer.Registrations.TypedRegistration`2.ImplementationType"/> and <seecref="T:LightweightIocContainer.Lifestyle"/>
/// The <see cref="Type"/> that implements the <see cref="IRegistration.InterfaceType"/> that is registered with this <see cref="IOpenGenericRegistration"/>
/// The <see cref="Type"/> that implements the <see cref="IRegistration.InterfaceType"/> that is registered with this <see cref="IOpenGenericRegistration"/>
/// </summary>
/// </summary>
publicTypeImplementationType{get;}
publicTypeImplementationType{get;}
/// <summary>
/// Validate this <see cref="OpenGenericRegistration"/>
/// </summary>
publicoverridevoidValidate()
{
if(!InterfaceType.ContainsGenericParameters)
thrownewInvalidRegistrationException("This function can only be used to register open generic types.");
if(Lifestyle==Lifestyle.Multiton)
thrownewInvalidRegistrationException("Can't register a multiton with open generic registration.");//TODO: Is there any need to register multitons with open generics?
/// The <see cref="LightweightIocContainer.Lifestyle"/> of Instances that are created with this <see cref="RegistrationBase"/>
/// The <see cref="LightweightIocContainer.Lifestyle"/> of Instances that are created with this <see cref="RegistrationBase"/>
/// </summary>
/// </summary>
publicLifestyleLifestyle{get;}
publicLifestyleLifestyle{get;}
/// <summary>
/// The <see cref="LightweightIocContainer.DisposeStrategy"/> of singletons/multitons that implement <see cref="IDisposable"/> and are created with this <see cref="RegistrationBase"/>
/// An <see cref="Array"/> of parameters that are used to <see cref="IocContainer.Resolve{T}()"/> an instance of this <see cref="IRegistration.InterfaceType"/>
/// An <see cref="Array"/> of parameters that are used to <see cref="IocContainer.Resolve{T}()"/> an instance of this <see cref="IRegistration.InterfaceType"/>
/// Validate that no registration that isn't derived from <see cref="IMultitonRegistration"/> has <see cref="LightweightIocContainer.Lifestyle.Multiton"/>
thrownewInvalidRegistrationException("Can't register a type as Lifestyle.Multiton without a scope (Registration is not of type IMultitonRegistration).");
}
/// <summary>
/// Validate the <see cref="Factory"/>
/// </summary>
/// <exception cref="InvalidFactoryRegistrationException">No create method that can create the <see cref="InterfaceType"/></exception>
/// Validate the <see cref="DisposeStrategy"/> for the given <see cref="Type"/> and <see cref="Lifestyle"/>
/// </summary>
/// <param name="type">The given <see cref="Type"/></param>
/// <exception cref="InvalidDisposeStrategyException">Dispose strategy is invalid for this <see cref="InterfaceType"/> and <see cref="Lifestyle"/></exception>
/// Register all <see cref="IMultipleRegistration{TInterface1,TImplementation}.Registrations"/> from an <see cref="IMultipleRegistration{TInterface1,TImplementation}"/>
/// </summary>
/// <typeparam name="TInterface1">The <see cref="Type"/> of the first registered interface</typeparam>
/// <typeparam name="TImplementation">The <see cref="Type"/> of the registered implementation</typeparam>