public static Exception ArgumentType(string function, int arg, Type type) { return _Eval(SR.Format(SR.Expr_ArgumentType, function, arg.ToString(CultureInfo.InvariantCulture), type.ToString())); }
private Type GetDataType(ExpressionNode node) { Type nodeType = node.GetType(); string typeName = null; if (nodeType == typeof(NameNode)) { typeName = ((NameNode)node)._name; } if (nodeType == typeof(ConstNode)) { typeName = ((ConstNode)node)._val.ToString(); } if (typeName == null) { throw ExprException.ArgumentType(s_funcs[_info]._name, 2, typeof(Type)); } Type dataType = Type.GetType(typeName); if (dataType == null) { throw ExprException.InvalidType(typeName); } // ReadXml might not be on the current call stack. So we'll use the TypeLimiter // that was captured when this FunctionNode instance was created. TypeLimiter.EnsureTypeIsAllowed(dataType, _capturedLimiter); return(dataType); }