Esempio n. 1
0
        internal override void ValidateObject(JToken o, JToken previous)
        {
            ValidationUtils.ArgumentNotNull(o, "o");

              if (o.Type == JsonTokenType.Property)
            throw new ArgumentException(string.Format("An item of type {0} cannot be added to content.", o.Type));
        }
Esempio n. 2
0
 private static bool ValidateInteger(JToken o, bool nullable)
 {
     return (o.Type == JsonTokenType.Integer || (nullable && IsNullable(o)));
 }
Esempio n. 3
0
 private static bool ValidateString(JToken o)
 {
     return (o.Type == JsonTokenType.String || IsNullable(o));
 }
Esempio n. 4
0
 private static bool ValidateDate(JToken o, bool nullable)
 {
     return (o.Type == JsonTokenType.Date || (nullable && IsNullable(o)));
 }
Esempio n. 5
0
 private static bool ValidateBoolean(JToken o, bool nullable)
 {
     return (o.Type == JsonTokenType.Boolean || (nullable && IsNullable(o)));
 }
Esempio n. 6
0
 private static bool IsNullable(JToken o)
 {
     return (o.Type == JsonTokenType.Undefined || o.Type == JsonTokenType.Null);
 }
Esempio n. 7
0
        private static JValue EnsureValue(JToken value)
        {
            if (value == null)
            throw new ArgumentNullException("value");

              if (value is JProperty)
            value = ((JProperty)value).Value;

              JValue v = value as JValue;

              return v;
        }
Esempio n. 8
0
 public void Replace(JToken value)
 {
 }