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); }
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); }
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); }
public override void Translate(MethodCallExpression method, ITranslationResult result) { base.Translate(method, result); result.AddTop(1); }