System.Data.ExprException.ArgumentType C# (CSharp) Метод

ArgumentType() публичный статический Метод

public static ArgumentType ( string function, int arg, Type type ) : Exception
function string
arg int
type System.Type
Результат System.Exception
        public static Exception ArgumentType(string function, int arg, Type type)
        {
            return _Eval(SR.Format(SR.Expr_ArgumentType, function, arg.ToString(CultureInfo.InvariantCulture), type.ToString()));
        }

Usage Example

Пример #1
0
        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);
        }
All Usage Examples Of System.Data.ExprException::ArgumentType