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)); }
private static bool ValidateInteger(JToken o, bool nullable) { return (o.Type == JsonTokenType.Integer || (nullable && IsNullable(o))); }
private static bool ValidateString(JToken o) { return (o.Type == JsonTokenType.String || IsNullable(o)); }
private static bool ValidateDate(JToken o, bool nullable) { return (o.Type == JsonTokenType.Date || (nullable && IsNullable(o))); }
private static bool ValidateBoolean(JToken o, bool nullable) { return (o.Type == JsonTokenType.Boolean || (nullable && IsNullable(o))); }
private static bool IsNullable(JToken o) { return (o.Type == JsonTokenType.Undefined || o.Type == JsonTokenType.Null); }
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; }
public void Replace(JToken value) { }