private static string GetTokenString(JsonValueType valueType, JsonTokenType tokenType) { switch (valueType) { case JsonValueType.Number: return("Integer"); case JsonValueType.Unknown: if (tokenType == JsonTokenType.StartArray) { return(JsonValueType.Array.ToString()); } if (tokenType == JsonTokenType.StartObject) { return(JsonValueType.Object.ToString()); } return(tokenType.ToString()); default: break; } return(valueType.ToString()); }
private static InvalidCastException GetImplisitException(JsonValueType tryType, JsonValueType realType) { return(new InvalidCastException(String.Concat("Wrong type '", tryType.ToString(), "'. Real type is '", realType.ToString(), "'."))); }