/src/LinFu.Reflection/Interfaces/IActionLoader.cs

http://github.com/philiplaureano/LinFu · C# · 30 lines · 10 code · 2 blank · 18 comment · 0 complexity · 25a912f69e146258c48808ee48e4eb18 MD5 · raw file

  1. using System;
  2. using System.Collections.Generic;
  3. namespace LinFu.Reflection
  4. {
  5. /// <summary>
  6. /// Represents a class that can configure
  7. /// a target of type <typeparamref name="TTarget" />
  8. /// using an input type of <typeparamref name="TInput" />.
  9. /// </summary>
  10. /// <typeparam name="TTarget">The target type to configure.</typeparam>
  11. /// <typeparam name="TInput">The input that will be used to configure the target.</typeparam>
  12. public interface IActionLoader<TTarget, TInput>
  13. {
  14. /// <summary>
  15. /// Generates a set of <see cref="Action{T}" /> instances
  16. /// using the given <paramref name="input" />.
  17. /// </summary>
  18. /// <param name="input">The input that will be used to configure the target.</param>
  19. /// <returns>A set of <see cref="Action{TTarget}" /> instances. This cannot be <c>null</c>.</returns>
  20. IEnumerable<Action<TTarget>> Load(TInput input);
  21. /// <summary>
  22. /// Determines if the PluginLoader can load the <paramref name="inputType" />.
  23. /// </summary>
  24. /// <param name="inputType">The target type that might contain the target instance.</param>
  25. /// <returns><c>true</c> if the type can be loaded; otherwise, it returns <c>false</c>.</returns>
  26. bool CanLoad(TInput inputType);
  27. }
  28. }