PageRenderTime 101ms CodeModel.GetById 60ms app.highlight 2ms RepoModel.GetById 38ms app.codeStats 0ms

/src/SampleLibrary/AOP/SampleMethodReplacementProvider.cs

http://github.com/philiplaureano/LinFu
C# | 25 lines | 20 code | 5 blank | 0 comment | 0 complexity | 0cf3db25c4e0738d5fe80769b3fe2c26 MD5 | raw file
 1using LinFu.AOP.Interfaces;
 2
 3namespace SampleLibrary.AOP
 4{
 5    public class SampleMethodReplacementProvider : IMethodReplacementProvider
 6    {
 7        private readonly IInterceptor _interceptor;
 8
 9        public SampleMethodReplacementProvider(IInterceptor interceptor)
10        {
11            _interceptor = interceptor;
12        }
13
14
15        public bool CanReplace(object host, IInvocationInfo info)
16        {
17            return true;
18        }
19
20        public IInterceptor GetMethodReplacement(object host, IInvocationInfo info)
21        {
22            return _interceptor;
23        }
24    }
25}