private Expression CreateBaseCallToMixinStatement(MethodBodyContextBase ctx, MethodDefinition target)
        {
            var mixin          = (MixinDefinition)target.DeclaringClass;
            var baseCallMethod = GetMixinMethodToCall(mixin.MixinIndex, target);
            var mixinReference = GetMixinReference(mixin, baseCallMethod.DeclaringType);

            return(ctx.DelegateTo(mixinReference, baseCallMethod));
        }
예제 #2
0
        public Expression CreateInitializingDelegation(
            MethodBodyContextBase ctx, MethodInfo initializationMethod, Expression instance, MethodInfo methodToCall)
        {
            ArgumentUtility.CheckNotNull("ctx", ctx);
            ArgumentUtility.CheckNotNull("initializationMethod", initializationMethod);
            ArgumentUtility.CheckNotNull("instance", instance);
            ArgumentUtility.CheckNotNull("methodToCall", methodToCall);

            // <CreateInitialization>
            // instance<GenericParameters>.MethodToCall(<parameters>);

            return(Expression.Block(
                       CreateInitialization(ctx.DeclaringType, initializationMethod),
                       ctx.DelegateTo(instance, methodToCall)));
        }
        private Expression CreateBaseCallToTargetClassStatement(MethodBodyContextBase ctx, MethodDefinition target)
        {
            var baseCallMethod = _targetTypeForNextCall.GetBaseCallMethod(target.MethodInfo);

            return(ctx.DelegateTo(_thisField, baseCallMethod));
        }