- add comments (#10)

pull/32/head v1.1.0-beta
Simon Gockner 7 years ago
parent d45ca22ec8
commit 29fbf4b0ad
  1. 10
      LightweightIocContainer/Installers/AssemblyInstaller.cs
  2. 12
      LightweightIocContainer/Installers/FromAssembly.cs
  3. 7
      LightweightIocContainer/Interfaces/Installers/IAssemblyInstaller.cs

@ -10,6 +10,9 @@ using LightweightIocContainer.Interfaces.Installers;
namespace LightweightIocContainer.Installers
{
/// <summary>
/// An <see cref="IIocInstaller"/> that installs all <see cref="IIocInstaller"/>s for its given <see cref="Assembly"/>
/// </summary>
public class AssemblyInstaller : IAssemblyInstaller
{
public AssemblyInstaller(Assembly assembly)
@ -26,8 +29,15 @@ namespace LightweightIocContainer.Installers
}
}
/// <summary>
/// The <see cref="IIocInstaller"/>s of the Assembly that this <see cref="AssemblyInstaller"/> is installing
/// </summary>
public List<IIocInstaller> Installers { get; }
/// <summary>
/// Install the found <see cref="IIocInstaller"/>s in the given <see cref="IIocContainer"/>
/// </summary>
/// <param name="container">The current <see cref="IIocContainer"/></param>
public void Install(IIocContainer container)
{
foreach (var installer in Installers)

@ -7,14 +7,26 @@ using LightweightIocContainer.Interfaces.Installers;
namespace LightweightIocContainer.Installers
{
/// <summary>
/// Helper class that supplies methods to find the wanted <see cref="Assembly"/>
/// </summary>
public static class FromAssembly
{
/// <summary>
/// Get an <see cref="IAssemblyInstaller"/> that installs from the <see cref="Assembly"/> calling the method
/// </summary>
/// <returns>A new <see cref="IAssemblyInstaller"/> with the calling <see cref="Assembly"/></returns>
public static IAssemblyInstaller This()
{
Assembly assembly = Assembly.GetCallingAssembly();
return new AssemblyInstaller(assembly);
}
/// <summary>
/// Get an <see cref="IAssemblyInstaller"/> that installs from the given <see cref="Assembly"/>
/// </summary>
/// <param name="assembly">The given <see cref="Assembly"/></param>
/// <returns>A new <see cref="IAssemblyInstaller"/> with the given <see cref="Assembly"/></returns>
public static IAssemblyInstaller Instance(Assembly assembly)
{
return new AssemblyInstaller(assembly);

@ -3,11 +3,18 @@
// // Copyright(c) 2019 SimonG. All Rights Reserved.
using System.Collections.Generic;
using System.Reflection;
namespace LightweightIocContainer.Interfaces.Installers
{
/// <summary>
/// An <see cref="IIocInstaller"/> that installs all <see cref="IIocInstaller"/>s for its given <see cref="Assembly"/>
/// </summary>
public interface IAssemblyInstaller : IIocInstaller
{
/// <summary>
/// The <see cref="IIocInstaller"/>s of the Assembly that this <see cref="IAssemblyInstaller"/> is installing
/// </summary>
List<IIocInstaller> Installers { get; }
}
}
Loading…
Cancel
Save