/src/LinFu.AOP/Interfaces/IMethodCallFilter.cs

http://github.com/philiplaureano/LinFu · C# · 19 lines · 8 code · 1 blank · 10 comment · 0 complexity · b9af6ba76d3e99d78cf63b5c7ae76b32 MD5 · raw file

  1. using Mono.Cecil;
  2. namespace LinFu.AOP.Cecil.Interfaces
  3. {
  4. /// <summary>
  5. /// Represents a type that determines the method calls that need to be intercepted.
  6. /// </summary>
  7. public interface IMethodCallFilter
  8. {
  9. /// <summary>
  10. /// Determines whether or not a particular method call should be intercepted.
  11. /// </summary>
  12. /// <param name="targetType">The host type that contains the method call.</param>
  13. /// <param name="hostMethod">The method that contains the current method call.</param>
  14. /// <param name="currentMethodCall">The method call to be intercepted.</param>
  15. /// <returns>Returns <c>true</c> if the method call should be intercepted; otherwise, it will return <c>false</c>.</returns>
  16. bool ShouldWeave(TypeReference targetType, MethodReference hostMethod, MethodReference currentMethodCall);
  17. }
  18. }