/src/LinFu.AOP.Interfaces/IInvocationInfo.cs

http://github.com/philiplaureano/LinFu · C# · 63 lines · 16 code · 7 blank · 40 comment · 0 complexity · 10c8c44e57d2aca8408a9b39e89f28bf MD5 · raw file

  1. using System;
  2. using System.Diagnostics;
  3. using System.Reflection;
  4. namespace LinFu.AOP.Interfaces
  5. {
  6. /// <summary>
  7. /// Represents the information associated with
  8. /// a single method call.
  9. /// </summary>
  10. public interface IInvocationInfo
  11. {
  12. /// <summary>
  13. /// The target instance currently being called.
  14. /// </summary>
  15. /// <remarks>This typically is a reference to a proxy object.</remarks>
  16. object Target { get; }
  17. /// <summary>
  18. /// The method currently being called.
  19. /// </summary>
  20. MethodBase TargetMethod { get; }
  21. /// <summary>
  22. /// The return type of the <see cref="TargetMethod" />.
  23. /// </summary>
  24. Type ReturnType { get; }
  25. /// <summary>
  26. /// The <see cref="StackTrace" /> associated
  27. /// with the method call when the call was made.
  28. /// </summary>
  29. StackTrace StackTrace { get; }
  30. /// <summary>
  31. /// The parameter types for the current target method.
  32. /// </summary>
  33. /// <remarks>
  34. /// <para>
  35. /// This could be very useful in cases where the actual target method
  36. /// is based on a generic type definition. In such cases,
  37. /// the <see cref="IInvocationInfo" /> instance needs to be able
  38. /// to describe the actual parameter types being used by the
  39. /// current generic type instantiation. This property helps
  40. /// users determine which parameter types are actually being used
  41. /// at the time of the method call.
  42. /// </para>
  43. /// </remarks>
  44. Type[] ParameterTypes { get; }
  45. /// <summary>
  46. /// If the <see cref="TargetMethod" /> method is a generic method,
  47. /// this will hold the generic type arguments used to construct the
  48. /// method.
  49. /// </summary>
  50. Type[] TypeArguments { get; }
  51. /// <summary>
  52. /// The arguments used in the method call.
  53. /// </summary>
  54. object[] Arguments { get; }
  55. }
  56. }