From edfba578093acf30dd9e93e62d65a0469ef74c88 Mon Sep 17 00:00:00 2001 From: Simon G Date: Thu, 2 Dec 2021 14:11:35 +0100 Subject: [PATCH] #50: update xml comments --- .../Factories/CustomTypedFactory.cs | 3 + .../Interfaces/Factories/ITypedFactory.cs | 3 + .../Registrations/Fluent/IOnCreate.cs | 2 +- .../Registrations/Fluent/IWithFactory.cs | 18 +++ .../Registrations/Fluent/IWithParameters.cs | 4 +- .../Registrations/IRegistrationBase.cs | 3 + LightweightIocContainer/IocContainer.cs | 18 +-- LightweightIocContainer/Lifestyle.cs | 2 +- .../LightweightIocContainer.xml | 112 ++++++++++++++---- .../MultipleMultitonRegistration.cs | 4 +- .../Registrations/RegistrationBase.cs | 14 +++ .../Registrations/RegistrationFactory.cs | 14 +-- .../Registrations/TypedRegistration.cs | 8 +- 13 files changed, 153 insertions(+), 52 deletions(-) diff --git a/LightweightIocContainer/Factories/CustomTypedFactory.cs b/LightweightIocContainer/Factories/CustomTypedFactory.cs index 1dd1ff5..e7538b2 100644 --- a/LightweightIocContainer/Factories/CustomTypedFactory.cs +++ b/LightweightIocContainer/Factories/CustomTypedFactory.cs @@ -6,6 +6,9 @@ using LightweightIocContainer.Interfaces.Factories; namespace LightweightIocContainer.Factories { + /// + /// implementation for custom implemented factories + /// public class CustomTypedFactory : ITypedFactory { diff --git a/LightweightIocContainer/Interfaces/Factories/ITypedFactory.cs b/LightweightIocContainer/Interfaces/Factories/ITypedFactory.cs index 2e318ef..25470df 100644 --- a/LightweightIocContainer/Interfaces/Factories/ITypedFactory.cs +++ b/LightweightIocContainer/Interfaces/Factories/ITypedFactory.cs @@ -4,6 +4,9 @@ namespace LightweightIocContainer.Interfaces.Factories { + /// + /// Non-generic + /// public interface ITypedFactory { diff --git a/LightweightIocContainer/Interfaces/Registrations/Fluent/IOnCreate.cs b/LightweightIocContainer/Interfaces/Registrations/Fluent/IOnCreate.cs index 110695e..4938507 100644 --- a/LightweightIocContainer/Interfaces/Registrations/Fluent/IOnCreate.cs +++ b/LightweightIocContainer/Interfaces/Registrations/Fluent/IOnCreate.cs @@ -20,7 +20,7 @@ namespace LightweightIocContainer.Interfaces.Registrations.Fluent } /// - /// Provides an method to an + /// Provides an method to an /// /// The registered interface /// The registered implementation diff --git a/LightweightIocContainer/Interfaces/Registrations/Fluent/IWithFactory.cs b/LightweightIocContainer/Interfaces/Registrations/Fluent/IWithFactory.cs index 9fb860a..054f15e 100644 --- a/LightweightIocContainer/Interfaces/Registrations/Fluent/IWithFactory.cs +++ b/LightweightIocContainer/Interfaces/Registrations/Fluent/IWithFactory.cs @@ -6,11 +6,29 @@ using LightweightIocContainer.Interfaces.Factories; namespace LightweightIocContainer.Interfaces.Registrations.Fluent { + /// + /// Provides a method to an + /// public interface IWithFactory { + /// + /// The Factory added with the method + /// ITypedFactory Factory { get; } + /// + /// Register an abstract typed factory for the + /// + /// The type of the abstract typed factory + /// The current instance of this IRegistrationBase WithFactory(); + + /// + /// Register a custom implemented factory for the + /// + /// The type of the interface for the custom factory + /// The type of the implementation for the custom factory + /// The current instance of this IRegistrationBase WithFactory() where TFactoryImplementation : TFactoryInterface; } } \ No newline at end of file diff --git a/LightweightIocContainer/Interfaces/Registrations/Fluent/IWithParameters.cs b/LightweightIocContainer/Interfaces/Registrations/Fluent/IWithParameters.cs index ccb2f46..b4a1f1d 100644 --- a/LightweightIocContainer/Interfaces/Registrations/Fluent/IWithParameters.cs +++ b/LightweightIocContainer/Interfaces/Registrations/Fluent/IWithParameters.cs @@ -24,7 +24,7 @@ namespace LightweightIocContainer.Interfaces.Registrations.Fluent /// Parameters set with this method are always inserted at the beginning of the argument list if more parameters are given when resolving /// /// The parameters - /// The current instance of this + /// The current instance of this /// are already set or no parameters given IRegistrationBase WithParameters(params object[] parameters); @@ -33,7 +33,7 @@ namespace LightweightIocContainer.Interfaces.Registrations.Fluent /// Parameters set with this method are inserted at the position in the argument list that is passed with the parameter if more parameters are given when resolving /// /// The parameters with their position - /// The current instance of this + /// The current instance of this /// are already set or no parameters given IRegistrationBase WithParameters(params (int index, object parameter)[] parameters); } diff --git a/LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs b/LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs index 780b70c..c655ca9 100644 --- a/LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs +++ b/LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs @@ -6,6 +6,9 @@ using LightweightIocContainer.Interfaces.Registrations.Fluent; namespace LightweightIocContainer.Interfaces.Registrations { + /// + /// The that is used to register an Interface and extends the with fluent options + /// public interface IRegistrationBase : IRegistration, IWithFactory, IWithParameters, ILifestyleProvider { diff --git a/LightweightIocContainer/IocContainer.cs b/LightweightIocContainer/IocContainer.cs index 2aec19d..762c93e 100644 --- a/LightweightIocContainer/IocContainer.cs +++ b/LightweightIocContainer/IocContainer.cs @@ -55,7 +55,7 @@ namespace LightweightIocContainer /// /// The Interface to register /// The Type that implements the interface - /// The for this + /// The for this /// The created public ITypedRegistration Register(Lifestyle lifestyle = Lifestyle.Transient) where TImplementation : TInterface { @@ -94,7 +94,7 @@ namespace LightweightIocContainer /// The base interface to register /// A second interface to register /// The that implements both interfaces - /// The for this + /// The for this /// The created public IMultipleRegistration Register(Lifestyle lifestyle = Lifestyle.Transient) where TImplementation : TInterface2, TInterface1 { @@ -111,7 +111,7 @@ namespace LightweightIocContainer /// A second interface to register /// A third interface to register /// The that implements both interfaces - /// The for this + /// The for this /// The created public IMultipleRegistration Register(Lifestyle lifestyle = Lifestyle.Transient) where TImplementation : TInterface3, TInterface2, TInterface1 { @@ -130,7 +130,7 @@ namespace LightweightIocContainer /// A third interface to register /// A fourth interface to register /// The that implements both interfaces - /// The for this + /// The for this /// The created public IMultipleRegistration Register(Lifestyle lifestyle = Lifestyle.Transient) where TImplementation : TInterface4, TInterface3, TInterface2, TInterface1 { @@ -150,7 +150,7 @@ namespace LightweightIocContainer /// A fourth interface to register /// A fifth interface to register /// The that implements both interfaces - /// The for this + /// The for this /// The created public IMultipleRegistration Register(Lifestyle lifestyle = Lifestyle.Transient) where TImplementation : TInterface5, TInterface4, TInterface3, TInterface2, TInterface1 { @@ -165,7 +165,7 @@ namespace LightweightIocContainer /// Register a without an interface /// /// The to register - /// The for this + /// The for this /// The created public ISingleTypeRegistration Register(Lifestyle lifestyle = Lifestyle.Transient) { @@ -440,11 +440,11 @@ namespace LightweightIocContainer } /// - /// Update the given arguments with the of the given + /// Update the given arguments with the of the given /// - /// The of the given + /// The of the given /// The constructor arguments - /// The argument list updated with the + /// The argument list updated with the private object[] UpdateArgumentsWithRegistrationParameters(IWithParameters registration, object[] arguments) { if (arguments != null && arguments.Any()) //if more arguments were passed to resolve diff --git a/LightweightIocContainer/Lifestyle.cs b/LightweightIocContainer/Lifestyle.cs index a7141d3..973e0ee 100644 --- a/LightweightIocContainer/Lifestyle.cs +++ b/LightweightIocContainer/Lifestyle.cs @@ -7,7 +7,7 @@ using LightweightIocContainer.Interfaces.Registrations; namespace LightweightIocContainer { /// - /// The Lifestyles that can be used for a + /// The Lifestyles that can be used for a /// public enum Lifestyle { diff --git a/LightweightIocContainer/LightweightIocContainer.xml b/LightweightIocContainer/LightweightIocContainer.xml index 47e6289..7d0c8ef 100644 --- a/LightweightIocContainer/LightweightIocContainer.xml +++ b/LightweightIocContainer/LightweightIocContainer.xml @@ -274,6 +274,11 @@ The exception message + + + implementation for custom implemented factories + + Class to help implement an abstract typed factory @@ -356,6 +361,11 @@ The given A new with the given + + + Non-generic + + Class to help implement an abstract typed factory @@ -532,7 +542,7 @@ - Provides an method to an + Provides an method to an The registered interface The registered implementation @@ -544,6 +554,31 @@ The The current instance of this + + + Provides a method to an + + + + + The Factory added with the method + + + + + Register an abstract typed factory for the + + The type of the abstract typed factory + The current instance of this + + + + Register a custom implemented factory for the + + The type of the interface for the custom factory + The type of the implementation for the custom factory + The current instance of this + Provides a method to an @@ -561,7 +596,7 @@ Parameters set with this method are always inserted at the beginning of the argument list if more parameters are given when resolving The parameters - The current instance of this + The current instance of this are already set or no parameters given @@ -570,7 +605,7 @@ Parameters set with this method are inserted at the position in the argument list that is passed with the parameter if more parameters are given when resolving The parameters with their position - The current instance of this + The current instance of this are already set or no parameters given @@ -673,6 +708,11 @@ The of the Interface that is registered with this + + + The that is used to register an Interface and extends the with fluent options + + The to register either only an interface or only a @@ -745,7 +785,7 @@ The Interface to register The Type that implements the interface - The for this + The for this The created @@ -766,7 +806,7 @@ The base interface to register A second interface to register The that implements both interfaces - The for this + The for this The created @@ -777,7 +817,7 @@ A second interface to register A third interface to register The that implements both interfaces - The for this + The for this The created @@ -789,7 +829,7 @@ A third interface to register A fourth interface to register The that implements both interfaces - The for this + The for this The created @@ -802,7 +842,7 @@ A fourth interface to register A fifth interface to register The that implements both interfaces - The for this + The for this The created @@ -810,7 +850,7 @@ Register a without an interface The to register - The for this + The for this The created @@ -924,11 +964,11 @@ - Update the given arguments with the of the given + Update the given arguments with the of the given - The of the given + The of the given The constructor arguments - The argument list updated with the + The argument list updated with the @@ -960,7 +1000,7 @@ - The Lifestyles that can be used for a + The Lifestyles that can be used for a @@ -980,7 +1020,7 @@ - An to register multiple interfaces for on implementation type that implements them as a multiton + An to register multiple interfaces for on implementation type that implements them as a multiton The first interface The second interface @@ -988,7 +1028,7 @@ - An to register multiple interfaces for on implementation type that implements them as a multiton + 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 @@ -1210,6 +1250,11 @@ Can be set in the by calling + + + The Factory added with the method + + Pass parameters that will be used to an instance of this @@ -1228,6 +1273,21 @@ The current instance of this are already set or no parameters given + + + Register an abstract typed factory for the + + The type of the abstract typed factory + The current instance of this + + + + Register a custom implemented factory for the + + The type of the interface for the custom factory + The type of the implementation for the custom factory + The current instance of this + A factory to register interfaces and factories in an and create the needed s @@ -1235,12 +1295,12 @@ - Register an Interface with a Type that implements it and create a + Register an Interface with a Type that implements it and create a The Interface to register The Type that implements the interface - The for this - A new created with the given parameters + The for this + A new created with the given parameters @@ -1258,7 +1318,7 @@ The base interface to register A second interface to register The that implements both interfaces - The for this + The for this The created @@ -1269,7 +1329,7 @@ A second interface to register A third interface to register The that implements both interfaces - The for this + The for this The created @@ -1281,7 +1341,7 @@ A third interface to register A fourth interface to register The that implements both interfaces - The for this + The for this The created @@ -1294,7 +1354,7 @@ A fourth interface to register A fifth interface to register The that implements both interfaces - The for this + The for this The created @@ -1381,21 +1441,21 @@ - A that implements a + A that implements a - A that implements a + A that implements a The of the interface The of the implementation type - The of this + The of this The current instance of the - The that implements the that is registered with this + The that implements the that is registered with this diff --git a/LightweightIocContainer/Registrations/MultipleMultitonRegistration.cs b/LightweightIocContainer/Registrations/MultipleMultitonRegistration.cs index 3a3e61f..7bedc21 100644 --- a/LightweightIocContainer/Registrations/MultipleMultitonRegistration.cs +++ b/LightweightIocContainer/Registrations/MultipleMultitonRegistration.cs @@ -10,7 +10,7 @@ using LightweightIocContainer.Interfaces.Registrations; namespace LightweightIocContainer.Registrations { /// - /// An to register multiple interfaces for on implementation type that implements them as a multiton + /// An to register multiple interfaces for on implementation type that implements them as a multiton /// /// The first interface /// The second interface @@ -18,7 +18,7 @@ namespace LightweightIocContainer.Registrations public class MultipleMultitonRegistration : MultitonRegistration, IMultipleMultitonRegistration where TImplementation : TInterface1, TInterface2 { /// - /// An to register multiple interfaces for on implementation type that implements them as a multiton + /// 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 diff --git a/LightweightIocContainer/Registrations/RegistrationBase.cs b/LightweightIocContainer/Registrations/RegistrationBase.cs index 0998978..666c6ba 100644 --- a/LightweightIocContainer/Registrations/RegistrationBase.cs +++ b/LightweightIocContainer/Registrations/RegistrationBase.cs @@ -49,6 +49,9 @@ namespace LightweightIocContainer.Registrations /// public object[] Parameters { get; private set; } + /// + /// The Factory added with the method + /// public ITypedFactory Factory { get; private set; } /// @@ -99,6 +102,11 @@ namespace LightweightIocContainer.Registrations return this; } + /// + /// Register an abstract typed factory for the + /// + /// The type of the abstract typed factory + /// The current instance of this public IRegistrationBase WithFactory() { TypedFactory factory = new(_container); @@ -109,6 +117,12 @@ namespace LightweightIocContainer.Registrations return this; } + /// + /// Register a custom implemented factory for the + /// + /// The type of the interface for the custom factory + /// The type of the implementation for the custom factory + /// The current instance of this public IRegistrationBase WithFactory() where TFactoryImplementation : TFactoryInterface { Factory = new CustomTypedFactory(); diff --git a/LightweightIocContainer/Registrations/RegistrationFactory.cs b/LightweightIocContainer/Registrations/RegistrationFactory.cs index c6d67c9..9d2ee47 100644 --- a/LightweightIocContainer/Registrations/RegistrationFactory.cs +++ b/LightweightIocContainer/Registrations/RegistrationFactory.cs @@ -19,12 +19,12 @@ namespace LightweightIocContainer.Registrations internal RegistrationFactory(IocContainer container) => _iocContainer = container; /// - /// Register an Interface with a Type that implements it and create a + /// Register an Interface with a Type that implements it and create a /// /// The Interface to register /// The Type that implements the interface - /// The for this - /// A new created with the given parameters + /// The for this + /// A new created with the given parameters public ITypedRegistration Register(Lifestyle lifestyle) where TImplementation : TInterface => new TypedRegistration(typeof(TInterface), typeof(TImplementation), lifestyle, _iocContainer); @@ -44,7 +44,7 @@ namespace LightweightIocContainer.Registrations /// The base interface to register /// A second interface to register /// The that implements both interfaces - /// The for this + /// The for this /// The created public IMultipleRegistration Register(Lifestyle lifestyle) where TImplementation : TInterface1, TInterface2 => new MultipleRegistration(typeof(TInterface1), typeof(TInterface2), typeof(TImplementation), lifestyle, _iocContainer); @@ -56,7 +56,7 @@ namespace LightweightIocContainer.Registrations /// A second interface to register /// A third interface to register /// The that implements both interfaces - /// The for this + /// The for this /// The created public IMultipleRegistration Register(Lifestyle lifestyle) where TImplementation : TInterface1, TInterface2, TInterface3 => new MultipleRegistration(typeof(TInterface1), typeof(TInterface2), typeof(TInterface3), typeof(TImplementation), lifestyle, _iocContainer); @@ -69,7 +69,7 @@ namespace LightweightIocContainer.Registrations /// A third interface to register /// A fourth interface to register /// The that implements both interfaces - /// The for this + /// The for this /// The created public IMultipleRegistration Register(Lifestyle lifestyle) where TImplementation : TInterface1, TInterface2, TInterface3, TInterface4 => new MultipleRegistration(typeof(TInterface1), typeof(TInterface2), typeof(TInterface3), typeof(TInterface4), typeof(TImplementation), lifestyle, _iocContainer); @@ -83,7 +83,7 @@ namespace LightweightIocContainer.Registrations /// A fourth interface to register /// A fifth interface to register /// The that implements both interfaces - /// The for this + /// The for this /// The created public IMultipleRegistration Register(Lifestyle lifestyle) where TImplementation : TInterface1, TInterface2, TInterface3, TInterface4, TInterface5 => new MultipleRegistration(typeof(TInterface1), typeof(TInterface2), typeof(TInterface3), typeof(TInterface4), typeof(TInterface5), typeof(TImplementation), lifestyle, _iocContainer); diff --git a/LightweightIocContainer/Registrations/TypedRegistration.cs b/LightweightIocContainer/Registrations/TypedRegistration.cs index acbe422..5aa5f3b 100644 --- a/LightweightIocContainer/Registrations/TypedRegistration.cs +++ b/LightweightIocContainer/Registrations/TypedRegistration.cs @@ -11,23 +11,23 @@ using LightweightIocContainer.Interfaces.Registrations.Fluent; namespace LightweightIocContainer.Registrations { /// - /// A that implements a + /// A that implements a /// public class TypedRegistration : RegistrationBase, ITypedRegistration where TImplementation : TInterface { /// - /// A that implements a + /// A that implements a /// /// The of the interface /// The of the implementation type - /// The of this + /// The of this /// The current instance of the public TypedRegistration(Type interfaceType, Type implementationType, Lifestyle lifestyle, IocContainer container) : base(interfaceType, lifestyle, container) => ImplementationType = implementationType; /// - /// The that implements the that is registered with this + /// The that implements the that is registered with this /// public Type ImplementationType { get; }