public ReplacementStaticFieldAssignmentBuilder(ReplacementMethodConstructionContext context, ReplaceableFieldInfo fieldInfo)
     : base(context)
 {
     var reflector = new UnitReflector(context.Host);
     var containingType = reflector.Get(fieldInfo.DeclaringType.FullName);
     field = reflector.From(containingType).GetField(fieldInfo.Name);
 }
        private void AddAlternativeInvocation(BlockStatement block,
            IMethodDefinition fakeMethod, IMethodReference originalCall)
        {
            var context = new ReplacementMethodConstructionContext(host, originalCall, fakeMethod, block, log, null);
            var methodBuilder = context.GetMethodBuilder();

            methodBuilder.BuildMethod();
        }
 public ReplacementStaticFunctionBuilder(ReplacementMethodConstructionContext context, IMethodReference staticFunction)
     : base(context)
 {
     this.staticFunction = staticFunction;
 }
 public ReplacementInstanceFunctionBuilder(ReplacementMethodConstructionContext context, IMethodReference instanceFunction)
     : base(context)
 {
     this.instanceFunction = instanceFunction;
 }
 public ReplacementFieldAccessorBuilder(ReplacementMethodConstructionContext context, ReplaceableFieldInfo fieldInfo)
     : base(context)
 {
     var reflector = new UnitReflector(context.Host);
     field = reflector.From(fieldInfo.DeclaringType.FullName).GetField(fieldInfo.Name);
 }
 public ReplacementConstructorBuilder(ReplacementMethodConstructionContext context, IMethodReference constructor)
     : base(context)
 {
     this.constructor = constructor;
 }