/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
- using LinFu.AOP.Interfaces;
- using LinFu.IoC;
- using LinFu.IoC.Configuration;
- using LinFu.IoC.Interceptors;
- using LinFu.IoC.Interfaces;
- namespace SampleLibrary.IOC
- {
- [Intercepts(typeof(ISampleWrappedInterface))]
- public class SampleAroundInvokeInterceptorClass : IAroundInvoke, IInitialize, ITargetHolder
- {
- public void BeforeInvoke(IInvocationInfo info)
- {
- Target = info.Target;
- }
- public void AfterInvoke(IInvocationInfo info, object returnValue)
- {
- }
- public void Initialize(IServiceContainer source)
- {
- var typeName = GetType().Name;
- source.AddService<ITargetHolder>(typeName, this);
- }
- public object Target { get; set; }
- }
- }