#45: add comments

pull/47/head
Simon G 5 years ago
parent 4654ed303f
commit 78eae75296
  1. 8
      LightweightIocContainer/Interfaces/IIocContainer.cs
  2. 6
      LightweightIocContainer/Interfaces/Registrations/IMultipleMultitonRegistration.cs
  3. 8
      LightweightIocContainer/IocContainer.cs
  4. 67
      LightweightIocContainer/LightweightIocContainer.xml
  5. 21
      LightweightIocContainer/Registrations/MultipleMultitonRegistration.cs
  6. 8
      LightweightIocContainer/Registrations/RegistrationFactory.cs

@ -101,6 +101,14 @@ namespace LightweightIocContainer.Interfaces
/// <returns>The created <see cref="IRegistration"/></returns>
IMultitonRegistration<TInterface, TImplementation> RegisterMultiton<TInterface, TImplementation, TScope>() where TImplementation : TInterface;
/// <summary>
/// Register multiple interfaces for a <see cref="Type"/> that implements them as a multiton
/// </summary>
/// <typeparam name="TInterface1">The base interface to register</typeparam>
/// <typeparam name="TInterface2">A second interface to register</typeparam>
/// <typeparam name="TImplementation">The Type that implements the interface</typeparam>
/// <typeparam name="TScope">The Type of the multiton scope</typeparam>
/// <returns>The created <see cref="IRegistration"/></returns>
IMultipleMultitonRegistration<TInterface1, TInterface2, TImplementation> RegisterMultiton<TInterface1, TInterface2, TImplementation, TScope>() where TImplementation : TInterface1, TInterface2;
/// <summary>

@ -4,6 +4,12 @@
namespace LightweightIocContainer.Interfaces.Registrations
{
/// <summary>
/// An <see cref="IRegistrationBase{TInterface}"/> to register multiple interfaces for on implementation type that implements them as a multiton
/// </summary>
/// <typeparam name="TInterface1">The first interface</typeparam>
/// <typeparam name="TInterface2">The second interface</typeparam>
/// <typeparam name="TImplementation">The implementation</typeparam>
public interface IMultipleMultitonRegistration<TInterface1, TInterface2, TImplementation> : IMultitonRegistration<TInterface1, TImplementation>, IMultipleRegistration<TInterface1, TInterface2, TImplementation> where TImplementation : TInterface1, TInterface2
{

@ -193,6 +193,14 @@ namespace LightweightIocContainer
return registration;
}
/// <summary>
/// Register multiple interfaces for a <see cref="Type"/> that implements them as a multiton
/// </summary>
/// <typeparam name="TInterface1">The base interface to register</typeparam>
/// <typeparam name="TInterface2">A second interface to register</typeparam>
/// <typeparam name="TImplementation">The Type that implements the interface</typeparam>
/// <typeparam name="TScope">The Type of the multiton scope</typeparam>
/// <returns>The created <see cref="IRegistration"/></returns>
public IMultipleMultitonRegistration<TInterface1, TInterface2, TImplementation> RegisterMultiton<TInterface1, TInterface2, TImplementation, TScope>() where TImplementation : TInterface1, TInterface2
{
IMultipleMultitonRegistration<TInterface1, TInterface2, TImplementation> registration = _registrationFactory.RegisterMultiton<TInterface1, TInterface2, TImplementation, TScope>();

@ -447,6 +447,16 @@
<typeparam name="TScope">The Type of the multiton scope</typeparam>
<returns>The created <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
</member>
<member name="M:LightweightIocContainer.Interfaces.IIocContainer.RegisterMultiton``4">
<summary>
Register multiple interfaces for a <see cref="T:System.Type"/> that implements them as a multiton
</summary>
<typeparam name="TInterface1">The base interface to register</typeparam>
<typeparam name="TInterface2">A second interface to register</typeparam>
<typeparam name="TImplementation">The Type that implements the interface</typeparam>
<typeparam name="TScope">The Type of the multiton scope</typeparam>
<returns>The created <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
</member>
<member name="M:LightweightIocContainer.Interfaces.IIocContainer.RegisterFactory``1">
<summary>
Register an Interface as an abstract typed factory
@ -575,6 +585,14 @@
The Lifestyle of Instances that are created with this <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>
</summary>
</member>
<member name="T:LightweightIocContainer.Interfaces.Registrations.IMultipleMultitonRegistration`3">
<summary>
An <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/> to register multiple interfaces for on implementation type that implements them as a multiton
</summary>
<typeparam name="TInterface1">The first interface</typeparam>
<typeparam name="TInterface2">The second interface</typeparam>
<typeparam name="TImplementation">The implementation</typeparam>
</member>
<member name="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`2">
<summary>
The base interface for every <see cref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`3"/> to register multiple interfaces
@ -827,6 +845,16 @@
<typeparam name="TScope">The Type of the multiton scope</typeparam>
<returns>The created <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
</member>
<member name="M:LightweightIocContainer.IocContainer.RegisterMultiton``4">
<summary>
Register multiple interfaces for a <see cref="T:System.Type"/> that implements them as a multiton
</summary>
<typeparam name="TInterface1">The base interface to register</typeparam>
<typeparam name="TInterface2">A second interface to register</typeparam>
<typeparam name="TImplementation">The Type that implements the interface</typeparam>
<typeparam name="TScope">The Type of the multiton scope</typeparam>
<returns>The created <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
</member>
<member name="M:LightweightIocContainer.IocContainer.RegisterFactory``1">
<summary>
Register an Interface as an abstract typed factory
@ -989,6 +1017,35 @@
<param name="implementationType">The <see cref="T:System.Type"/> of the implementation</param>
<param name="lifestyle">The <see cref="T:LightweightIocContainer.Lifestyle"/> of the <see cref="T:LightweightIocContainer.Registrations.RegistrationBase`1"/></param>
</member>
<member name="T:LightweightIocContainer.Registrations.MultipleMultitonRegistration`3">
<summary>
An <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/> to register multiple interfaces for on implementation type that implements them as a multiton
</summary>
<typeparam name="TInterface1">The first interface</typeparam>
<typeparam name="TInterface2">The second interface</typeparam>
<typeparam name="TImplementation">The implementation</typeparam>
</member>
<member name="M:LightweightIocContainer.Registrations.MultipleMultitonRegistration`3.#ctor(System.Type,System.Type,System.Type,System.Type)">
<summary>
An <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/> to register multiple interfaces for on implementation type that implements them as a multiton
</summary>
<param name="interfaceType1">The <see cref="T:System.Type"/> of the first interface</param>
<param name="interfaceType2">The <see cref="T:System.Type"/> of the second interface</param>
<param name="implementationType">The <see cref="T:System.Type"/> of the implementation</param>
<param name="scope">The <see cref="T:System.Type"/> of the multiton scope</param>
</member>
<member name="P:LightweightIocContainer.Registrations.MultipleMultitonRegistration`3.Registrations">
<summary>
A <see cref="T:System.Collections.Generic.List`1"/> of <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s that are registered within this <see cref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`2"/>
</summary>
</member>
<member name="M:LightweightIocContainer.Registrations.MultipleMultitonRegistration`3.OnCreate(System.Action{`2})">
<summary>
Pass an <see cref="T:System.Action`1"/> that will be invoked when an instance of this type is created
</summary>
<param name="action">The <see cref="T:System.Action`1"/></param>
<returns>The current instance of this <see cref="T:LightweightIocContainer.Interfaces.Registrations.ITypedRegistrationBase`2"/></returns>
</member>
<member name="T:LightweightIocContainer.Registrations.MultipleRegistration`2">
<summary>
The base class for every <see cref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleRegistration`3"/> to register multiple interfaces
@ -1299,6 +1356,16 @@
<typeparam name="TScope">The Type of the multiton scope</typeparam>
<returns>A new created <see cref="T:LightweightIocContainer.Interfaces.Registrations.IMultitonRegistration`2"/> with the given parameters</returns>
</member>
<member name="M:LightweightIocContainer.Registrations.RegistrationFactory.RegisterMultiton``4">
<summary>
Register multiple interfaces for a <see cref="T:System.Type"/> that implements them as a multiton
</summary>
<typeparam name="TInterface1">The base interface to register</typeparam>
<typeparam name="TInterface2">A second interface to register</typeparam>
<typeparam name="TImplementation">The Type that implements the interface</typeparam>
<typeparam name="TScope">The Type of the multiton scope</typeparam>
<returns>A new created <see cref="T:LightweightIocContainer.Interfaces.Registrations.IMultipleMultitonRegistration`3"/> with the given parameters</returns>
</member>
<member name="M:LightweightIocContainer.Registrations.RegistrationFactory.RegisterFactory``1">
<summary>
Register an Interface as an abstract typed factory and create a <see cref="T:LightweightIocContainer.Interfaces.Registrations.ITypedFactoryRegistration`1"/>

@ -8,8 +8,21 @@ using LightweightIocContainer.Interfaces.Registrations;
namespace LightweightIocContainer.Registrations
{
/// <summary>
/// An <see cref="IRegistrationBase{TInterface}"/> to register multiple interfaces for on implementation type that implements them as a multiton
/// </summary>
/// <typeparam name="TInterface1">The first interface</typeparam>
/// <typeparam name="TInterface2">The second interface</typeparam>
/// <typeparam name="TImplementation">The implementation</typeparam>
public class MultipleMultitonRegistration<TInterface1, TInterface2, TImplementation> : MultitonRegistration<TInterface1, TImplementation>, IMultipleMultitonRegistration<TInterface1, TInterface2, TImplementation> where TImplementation : TInterface1, TInterface2
{
/// <summary>
/// An <see cref="IRegistrationBase{TInterface}"/> to register multiple interfaces for on implementation type that implements them as a multiton
/// </summary>
/// <param name="interfaceType1">The <see cref="Type"/> of the first interface</param>
/// <param name="interfaceType2">The <see cref="Type"/> of the second interface</param>
/// <param name="implementationType">The <see cref="Type"/> of the implementation</param>
/// <param name="scope">The <see cref="Type"/> of the multiton scope</param>
public MultipleMultitonRegistration(Type interfaceType1, Type interfaceType2, Type implementationType, Type scope)
: base(interfaceType1, implementationType, scope)
{
@ -20,8 +33,16 @@ namespace LightweightIocContainer.Registrations
};
}
/// <summary>
/// A <see cref="List{T}"/> of <see cref="IRegistration"/>s that are registered within this <see cref="IMultipleRegistration{TInterface1,TImplementation}"/>
/// </summary>
public List<IRegistration> Registrations { get; }
/// <summary>
/// Pass an <see cref="Action{T}"/> that will be invoked when an instance of this type is created
/// </summary>
/// <param name="action">The <see cref="Action{T}"/></param>
/// <returns>The current instance of this <see cref="ITypedRegistrationBase{TInterface,TImplementation}"/></returns>
public override ITypedRegistrationBase<TInterface1, TImplementation> OnCreate(Action<TImplementation> action)
{
foreach (var registration in Registrations)

@ -119,6 +119,14 @@ namespace LightweightIocContainer.Registrations
return new MultitonRegistration<TInterface, TImplementation>(typeof(TInterface), typeof(TImplementation), typeof(TScope));
}
/// <summary>
/// Register multiple interfaces for a <see cref="Type"/> that implements them as a multiton
/// </summary>
/// <typeparam name="TInterface1">The base interface to register</typeparam>
/// <typeparam name="TInterface2">A second interface to register</typeparam>
/// <typeparam name="TImplementation">The Type that implements the interface</typeparam>
/// <typeparam name="TScope">The Type of the multiton scope</typeparam>
/// <returns>A new created <see cref="IMultipleMultitonRegistration{TInterface1,TInterface2,TImplementation}"/> with the given parameters</returns>
public IMultipleMultitonRegistration<TInterface1, TInterface2, TImplementation> RegisterMultiton<TInterface1, TInterface2, TImplementation, TScope>() where TImplementation : TInterface1, TInterface2
{
return new MultipleMultitonRegistration<TInterface1, TInterface2, TImplementation>(typeof(TInterface1), typeof(TInterface2), typeof(TImplementation), typeof(TScope));

Loading…
Cancel
Save