PageRenderTime 142ms CodeModel.GetById 81ms app.highlight 1ms RepoModel.GetById 59ms app.codeStats 0ms

/src/LinFu.AOP.Interfaces/IMethodReplacementProvider.cs

http://github.com/philiplaureano/LinFu
C# | 24 lines | 8 code | 1 blank | 15 comment | 0 complexity | 5220772848c3cf1b109c670d8df06997 MD5 | raw file
 1namespace LinFu.AOP.Interfaces
 2{
 3    /// <summary>
 4    ///     Represents a type that can swap method body implementations at runtime.
 5    /// </summary>
 6    public interface IMethodReplacementProvider
 7    {
 8        /// <summary>
 9        ///     Determines whether or not the current method implementation can be replaced.
10        /// </summary>
11        /// <param name="host">The target instance of the method call.</param>
12        /// <param name="info">The <see cref="IInvocationInfo" /> that describes the context of the method call.</param>
13        /// <returns><c>true</c> if the method can be intercepted; otherwise, it will return <c>false</c>.</returns>
14        bool CanReplace(object host, IInvocationInfo info);
15
16        /// <summary>
17        ///     Obtains the <see cref="IInterceptor" /> instance that will be used to replace the current method call.
18        /// </summary>
19        /// <param name="host">The target instance of the method call.</param>
20        /// <param name="info">The <see cref="IInvocationInfo" /> that describes the context of the method call.</param>
21        /// <returns>The interceptor that will intercept the method call itself.</returns>
22        IInterceptor GetMethodReplacement(object host, IInvocationInfo info);
23    }
24}