/src/LinFu.IoC/Configuration/InitializerPlugin.cs

http://github.com/philiplaureano/LinFu · C# · 31 lines · 15 code · 2 blank · 14 comment · 0 complexity · 3f623ad9235d1dcf1eee755614297cc2 MD5 · raw file

  1. using LinFu.IoC.Interfaces;
  2. using LinFu.Reflection;
  3. namespace LinFu.IoC.Configuration
  4. {
  5. /// <summary>
  6. /// A class that injects the <see cref="Initializer" /> postprocessor
  7. /// into every container that is created or loaded.
  8. /// </summary>
  9. public class InitializerPlugin : ILoaderPlugin<IServiceContainer>
  10. {
  11. /// <summary>
  12. /// This override does absolutely nothing.
  13. /// </summary>
  14. /// <param name="target">The target container.</param>
  15. public void BeginLoad(IServiceContainer target)
  16. {
  17. // Do nothing
  18. }
  19. /// <summary>
  20. /// Injects the <see cref="Initializer" /> postprocessor into
  21. /// the container.
  22. /// </summary>
  23. /// <param name="target"></param>
  24. public void EndLoad(IServiceContainer target)
  25. {
  26. target.PostProcessors.Add(new Initializer());
  27. }
  28. }
  29. }