/src/LinFu.AOP/Interfaces/IMethodBodyRewriterParameters.cs

http://github.com/philiplaureano/LinFu · C# · 76 lines · 21 code · 10 blank · 45 comment · 0 complexity · 646f52009fbabca2bb9cb8165d3bd42d MD5 · raw file

  1. using System;
  2. using System.Collections.Generic;
  3. using LinFu.AOP.Interfaces;
  4. using Mono.Cecil;
  5. using Mono.Cecil.Cil;
  6. namespace LinFu.AOP.Cecil
  7. {
  8. /// <summary>
  9. /// Represents the parameters used to add interception to a given method body.
  10. /// </summary>
  11. public interface IMethodBodyRewriterParameters
  12. {
  13. /// <summary>
  14. /// Gets the value indicating the TargetMethod to be modified.
  15. /// </summary>
  16. /// <value>The method to be modified.</value>
  17. MethodDefinition TargetMethod { get; }
  18. /// <summary>
  19. /// Gets the value indicating the local variable used to store the <see cref="IAroundInvokeProvider" /> instance.
  20. /// </summary>
  21. /// <value>The <see cref="IAroundInvokeProvider" /> instance.</value>
  22. VariableDefinition AroundInvokeProvider { get; }
  23. /// <summary>
  24. /// Gets the value indicating the local variable used to store the <see cref="IMethodReplacementProvider" /> instance.
  25. /// </summary>
  26. /// <value>The <see cref="IMethodReplacementProvider" /> instance.</value>
  27. VariableDefinition MethodReplacementProvider { get; }
  28. /// <summary>
  29. /// Gets the value indicating the class-level<see cref="IMethodReplacementProvider" /> instance.
  30. /// </summary>
  31. /// <value>The class-level<see cref="IMethodReplacementProvider" /> instance.</value>
  32. VariableDefinition ClassMethodReplacementProvider { get; }
  33. /// <summary>
  34. /// Gets the value indicating the local variable that will store the value that determines whether or not
  35. /// interception is disabled.
  36. /// </summary>
  37. /// <value>The value that determines whether or not interception is disabled.</value>
  38. VariableDefinition InterceptionDisabled { get; }
  39. /// <summary>
  40. /// Gets the value indicating the local variable that will store the <see cref="IInvocationInfo" /> instance.
  41. /// </summary>
  42. /// <value>The local variable that will store the <see cref="IInvocationInfo" /> instance.</value>
  43. VariableDefinition InvocationInfo { get; }
  44. /// <summary>
  45. /// Gets the value indicating the local variable that will store the return value.
  46. /// </summary>
  47. /// <value>The value indicating the local variable that will store the return value.</value>
  48. VariableDefinition ReturnValue { get; }
  49. /// <summary>
  50. /// Gets the value indicating the interception registry type that will be responsible for handling class-level
  51. /// interception events.
  52. /// </summary>
  53. /// <value>The interception registry type that will be responsible for handling class-level interception events.</value>
  54. Type RegistryType { get; }
  55. /// <summary>
  56. /// Gets the value indicating the functor that resolves the GetMethodReplacementProvider method.
  57. /// </summary>
  58. /// <value>The functor that resolves the GetMethodReplacementProvider method.</value>
  59. Func<ModuleDefinition, MethodReference> GetMethodReplacementProviderMethod { get; }
  60. /// <summary>
  61. /// Gets the value indicating the list of old instructions in the current method body.
  62. /// </summary>
  63. /// <value>The value indicating the list of old instructions in the current method body.</value>
  64. IEnumerable<Instruction> OldInstructions { get; }
  65. }
  66. }