/src/LinFu.AOP/Interfaces/IWeaver.cs

http://github.com/philiplaureano/LinFu · C# · 24 lines · 8 code · 1 blank · 15 comment · 0 complexity · a9d2ebe1d535cb11f9b09319c994355c MD5 · raw file

  1. namespace LinFu.AOP.Cecil.Interfaces
  2. {
  3. /// <summary>
  4. /// Represents a class that can weave (or modify)
  5. /// a member embedded in an assembly.
  6. /// </summary>
  7. /// <typeparam name="T">The type of object to modify.</typeparam>
  8. /// <typeparam name="THost">The host that holds the item to be modified.</typeparam>
  9. public interface IWeaver<T, THost> : IHostWeaver<THost>
  10. {
  11. /// <summary>
  12. /// Determines whether or not the current item should be modified.
  13. /// </summary>
  14. /// <param name="item">The target item.</param>
  15. /// <returns>Returns <c>true</c> if the current item can be modified; otherwise, it should return <c>false.</c></returns>
  16. bool ShouldWeave(T item);
  17. /// <summary>
  18. /// Modifies the target <paramref name="item" />.
  19. /// </summary>
  20. /// <param name="item">The item to be modified.</param>
  21. void Weave(T item);
  22. }
  23. }