PageRenderTime 11ms CodeModel.GetById 41ms app.highlight 2ms RepoModel.GetById 78ms app.codeStats 0ms

/src/LinFu.AOP/Loaders/PdbLoader.cs

http://github.com/philiplaureano/LinFu
C# | 45 lines | 21 code | 4 blank | 20 comment | 3 complexity | a7b9826f559db7e40b6f141938aa230d MD5 | raw file
 1using System.Reflection;
 2using LinFu.AOP.Cecil.Interfaces;
 3using Mono.Cecil;
 4
 5namespace LinFu.AOP.Cecil.Loaders
 6{
 7    /// <summary>
 8    ///     Represents the default implementation of the <see cref="IPdbLoader" /> interface.
 9    /// </summary>
10    public class PdbLoader : IPdbLoader
11    {
12        /// <summary>
13        ///     Loads an assembly into memory.
14        /// </summary>
15        /// <param name="assemblyArray">The bytes that represent the target assembly.</param>
16        /// <param name="pdbBytes">The bytes that represent the PDB file.</param>
17        /// <returns>A <see cref="System.Reflection.Assembly" /> that represents the loaded assembly.</returns>
18        public Assembly LoadAssembly(byte[] assemblyArray, byte[] pdbBytes)
19        {
20            // Load the assembly into the current application domain
21            if (pdbBytes != null && pdbBytes.Length > 0)
22                return Assembly.Load(assemblyArray, pdbBytes);
23
24            return Assembly.Load(assemblyArray);
25        }
26
27        /// <summary>
28        ///     Loads the debug symbols from the target <paramref name="assembly" />.
29        /// </summary>
30        /// <param name="assembly">The assembly that contains the symbols to be loaded.</param>
31        public void LoadSymbols(AssemblyDefinition assembly)
32        {
33            // TODO: How does Cecil 0.9.x load symbols??
34        }
35
36        /// <summary>
37        ///     Saves the debug symbols for the  target<paramref name="targetAssembly" />.
38        /// </summary>
39        /// <param name="targetAssembly">The assembly that contains the symbols to be saved.</param>
40        public void SaveSymbols(AssemblyDefinition targetAssembly)
41        {
42            // TODO: How does Cecil 0.9.x save symbols??
43        }
44    }
45}