예제 #1
0
        public void Translate(MethodCallExpression method, ITranslationResult result)
        {
            if (method.Method.Name != MethodName || method.Arguments.Count != 2)
            {
                throw new ArgumentOutOfRangeException(nameof(method), $"Method '{nameof(method)}' is not supported");
            }

            var constant = (ConstantExpression)method.Arguments[1];

            result.AddTop((int)constant.Value);
        }
예제 #2
0
        public void Translate(MethodCallExpression method, ITranslationResult result)
        {
            if (method.Method.Name != MethodName || method.Arguments.Count != 2)
            {
                var message = string.Format(Resources.TranslatorMemberNotSupported, method.NodeType);
                throw new ArgumentOutOfRangeException("method", message);
            }

            var constant = (ConstantExpression) method.Arguments[1];

            result.AddTop((int) constant.Value);
        }
예제 #3
0
        public void Translate(MethodCallExpression method, ITranslationResult result)
        {
            if (method.Method.Name != MethodName || method.Arguments.Count != 2)
            {
                var message = string.Format(Resources.TranslatorMemberNotSupported, method.NodeType);
                throw new ArgumentOutOfRangeException("method", message);
            }

            var constant = (ConstantExpression)method.Arguments[1];

            result.AddTop((int)constant.Value);
        }
예제 #4
0
 public override void Translate(MethodCallExpression method, ITranslationResult result)
 {
     base.Translate(method, result);
     result.AddTop(1);
 }
 public override void Translate(MethodCallExpression method, ITranslationResult result)
 {
     base.Translate(method, result);
     result.AddTop(1);
 }