/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
- namespace LinFu.AOP.Interfaces
- {
- /// <summary>
- /// Represents a type that can swap method body implementations at runtime.
- /// </summary>
- public interface IMethodReplacementProvider
- {
- /// <summary>
- /// Determines whether or not the current method implementation can be replaced.
- /// </summary>
- /// <param name="host">The target instance of the method call.</param>
- /// <param name="info">The <see cref="IInvocationInfo" /> that describes the context of the method call.</param>
- /// <returns><c>true</c> if the method can be intercepted; otherwise, it will return <c>false</c>.</returns>
- bool CanReplace(object host, IInvocationInfo info);
- /// <summary>
- /// Obtains the <see cref="IInterceptor" /> instance that will be used to replace the current method call.
- /// </summary>
- /// <param name="host">The target instance of the method call.</param>
- /// <param name="info">The <see cref="IInvocationInfo" /> that describes the context of the method call.</param>
- /// <returns>The interceptor that will intercept the method call itself.</returns>
- IInterceptor GetMethodReplacement(object host, IInvocationInfo info);
- }
- }