/src/LinFu.IoC/Configuration/InMemoryAssemblyLoader.cs

http://github.com/philiplaureano/LinFu · C# · 30 lines · 17 code · 4 blank · 9 comment · 0 complexity · cdac675127e58494d06e96a3861a60a9 MD5 · raw file

  1. using System.Reflection;
  2. using LinFu.Reflection;
  3. namespace LinFu.IoC.Configuration
  4. {
  5. /// <summary>
  6. /// An assembly loader that returns an existing
  7. /// <see cref="Assembly" /> from memory.
  8. /// </summary>
  9. internal class InMemoryAssemblyLoader : IAssemblyLoader
  10. {
  11. private readonly Assembly _targetAssembly;
  12. /// <summary>
  13. /// Initializes the class with an existing
  14. /// <see cref="Assembly" />.
  15. /// </summary>
  16. /// <param name="targetAssembly">The target assembly.</param>
  17. internal InMemoryAssemblyLoader(Assembly targetAssembly)
  18. {
  19. _targetAssembly = targetAssembly;
  20. }
  21. public Assembly Load(string assemblyFile)
  22. {
  23. return _targetAssembly;
  24. }
  25. }
  26. }