PageRenderTime 121ms CodeModel.GetById 50ms app.highlight 2ms RepoModel.GetById 68ms app.codeStats 0ms

/src/SampleLibrary/IOC/SampleAroundInvokeInterceptorClass.cs

http://github.com/philiplaureano/LinFu
C# | 31 lines | 25 code | 6 blank | 0 comment | 0 complexity | f4b8afd96ed340cf45b262fefe29a01b MD5 | raw file
 1using LinFu.AOP.Interfaces;
 2using LinFu.IoC;
 3using LinFu.IoC.Configuration;
 4using LinFu.IoC.Interceptors;
 5using LinFu.IoC.Interfaces;
 6
 7namespace SampleLibrary.IOC
 8{
 9    [Intercepts(typeof(ISampleWrappedInterface))]
10    public class SampleAroundInvokeInterceptorClass : IAroundInvoke, IInitialize, ITargetHolder
11    {
12        public void BeforeInvoke(IInvocationInfo info)
13        {
14            Target = info.Target;
15        }
16
17        public void AfterInvoke(IInvocationInfo info, object returnValue)
18        {
19        }
20
21
22        public void Initialize(IServiceContainer source)
23        {
24            var typeName = GetType().Name;
25            source.AddService<ITargetHolder>(typeName, this);
26        }
27
28
29        public object Target { get; set; }
30    }
31}