/src/LinFu.AOP.Interfaces/TypeActivationContext.cs

http://github.com/philiplaureano/LinFu · C# · 39 lines · 17 code · 4 blank · 18 comment · 0 complexity · b389cdea0eea0fd6822c707b5346cf16 MD5 · raw file

  1. using System;
  2. using System.Reflection;
  3. namespace LinFu.AOP.Interfaces
  4. {
  5. /// <summary>
  6. /// Represents an <see cref="ActivationContext" /> that can be used to instantiate a given type
  7. /// and be used to describe the method that invoked the instantiation operation as well as specify the object
  8. /// instance that invoked the instantiation itself.
  9. /// </summary>
  10. public class TypeActivationContext : ActivationContext, ITypeActivationContext
  11. {
  12. /// <summary>
  13. /// Initializes a new instance of the MethodActivationContext class.
  14. /// </summary>
  15. /// <param name="target">The object instance that initiated the activation request.</param>
  16. /// <param name="targetMethod">The method where the activation was invoked.</param>
  17. /// <param name="concreteType">The type to be constructed.</param>
  18. /// <param name="additionalArguments">The additional arguments that will be passed to the constructor.</param>
  19. public TypeActivationContext(object target, MethodBase targetMethod,
  20. Type concreteType, object[] additionalArguments)
  21. : base(concreteType, additionalArguments)
  22. {
  23. Target = target;
  24. TargetMethod = targetMethod;
  25. }
  26. /// <summary>
  27. /// Gets the value indicating the object instance that initiated the object instantiation operation.
  28. /// </summary>
  29. public object Target { get; protected set; }
  30. /// <summary>
  31. /// Gets the value indiating the <see cref="MethodBase" /> instance that initiated the object instantiation operation.
  32. /// </summary>
  33. public MethodBase TargetMethod { get; protected set; }
  34. }
  35. }