/// <summary>
        /// Rewrites an instrumentation target.
        /// </summary>
        /// <param name="target">
        /// The target to rewrite.
        /// </param>
        /// <returns>
        /// An assembly target pointing to the assembly inside the rewritten instrumentation
        /// target.
        /// </returns>
        public IAssemblyTarget Rewrite(IInstrumentationTarget target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            // New up the rewriter
            this.rewriter = new DCGMethodInjector(target.Host, target.LocalScopeProvider, target.SourceLocationProvider, this.winbertCore);

            // Inject calls
            this.RewriteChildren(target.MutableAssembly);
            return target.Save();
        }
Esempio n. 2
0
 private RewriteStoreLocal(IMetadataHost host, ILRewriter rewriter)
   : base(host) {
     this.ilRewriter = rewriter;
 }