PageRenderTime 312ms CodeModel.GetById 141ms app.highlight 1ms RepoModel.GetById 93ms app.codeStats 0ms

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