protected override void WeaveFunction(ILGenerator ilGenerator) { var setReturnValueWeaver = new SetReturnValueWeaver(topAspectInScopeArgType); var argsImplLocalBuilder = localBuilderRepository.Get(topAspectInScopeArgType); byRefArgumentStoreWeaver.StoreArgsIfNeeded(ilGenerator); ilGenerator.EmitLoadLocal(argsImplLocalBuilder); argumentsWeaver.Weave(ilGenerator); ilGenerator.Emit(OpCodes.Callvirt, Method); setReturnValueWeaver.Weave(ilGenerator); byRefArgumentStoreWeaver.RestoreArgsIfNeeded(ilGenerator); }
protected override ILGenerator WeaveFunction(ILGenerator ilGenerator) { var setReturnValueWeaver = new SetReturnValueWeaver(previousAspectArgsType); var argsImplLocalBuilder = localBuilderRepository.Get(previousAspectArgsType); byRefArgumentStoreWeaver.StoreArgsIfNeeded(ilGenerator); ilGenerator.EmitLoadLocal(argsImplLocalBuilder); argumentsWeaver.Weave(ilGenerator); ilGenerator.Emit(OpCodes.Callvirt, MethodInfoImpl); setReturnValueWeaver.Weave(ilGenerator); byRefArgumentStoreWeaver.RestoreArgsIfNeeded(ilGenerator); return(ilGenerator); }
protected override void WeaveFunction(ILGenerator ilGenerator) { var aspectArgumentContract = method.ToAspectArgumentContract(); var setReturnValueWeaver = new SetReturnValueWeaver(aspectArgumentContract); var returnValueGetMethod = aspectArgumentContract.GetProperty("ReturnValue"); byRefArgumentsStoreWeaver.StoreArgsIfNeeded(ilGenerator); ilGenerator.EmitLoadArg(2); argumentsWeaver.Weave(ilGenerator); ilGenerator.Emit(OpCodes.Callvirt, method); setReturnValueWeaver.Weave(ilGenerator); byRefArgumentsStoreWeaver.RestoreArgsIfNeeded(ilGenerator); ilGenerator.EmitLoadArg(2); ilGenerator.Emit(OpCodes.Callvirt, returnValueGetMethod.GetGetMethod()); }