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

/src/LinFu.AOP/Interfaces/IAroundMethodWeaver.cs

http://github.com/philiplaureano/LinFu
C# | 33 lines | 11 code | 3 blank | 19 comment | 0 complexity | 3b8eb70037e243481e172e55d389f7a6 MD5 | raw file
 1using Mono.Cecil;
 2using Mono.Cecil.Cil;
 3
 4namespace LinFu.AOP.Cecil.Interfaces
 5{
 6    /// <summary>
 7    ///     Represents a class that adds a method
 8    ///     epilog and prolog to an existing method instance.
 9    /// </summary>
10    public interface IAroundMethodWeaver : IHostWeaver<TypeDefinition>
11    {
12        /// <summary>
13        ///     Determines whether or not the current item should be modified.
14        /// </summary>
15        /// <param name="method">The target item.</param>
16        /// <returns>Returns <c>true</c> if the current item can be modified; otherwise, it should return <c>false.</c></returns>
17        bool ShouldWeave(MethodDefinition method);
18
19        /// <summary>
20        ///     Adds an prolog to the target method.
21        /// </summary>
22        /// <param name="firstInstruction">The instruction that marks the start of the <paramref name="methodBody" /></param>
23        /// <param name="methodBody">The method body of the target method.</param>
24        void AddProlog(Instruction firstInstruction, MethodBody methodBody);
25
26        /// <summary>
27        ///     Adds an epilog to the target method.
28        /// </summary>
29        /// <param name="lastInstruction">The instruction that marks the end of the <paramref name="methodBody" /></param>
30        /// <param name="methodBody">The method body of the target method.</param>
31        void AddEpilog(Instruction lastInstruction, MethodBody methodBody);
32    }
33}