本文整理汇总了C#中JsonObject.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# JsonObject.Contains方法的具体用法?C# JsonObject.Contains怎么用?C# JsonObject.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonObject
的用法示例。
在下文中一共展示了JsonObject.Contains方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parsee)
{
if (definition.Contains<JsonFalse>("additionalItems"))
{
if (definition.Contains<JsonArray>("items"))
{
JsonArray items = definition.Get<JsonArray>("items");
JsonAdditionalItemsRule rule = new JsonAdditionalItemsRule(items.Count);
rules.Add(rule);
}
}
}
示例2: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonObject>("dependencies"))
{
JsonObject dependencies = definition.Get<JsonObject>("dependencies");
JsonDependencyRule rule = new JsonDependencyRule();
foreach (string property in dependencies.GetKeys())
{
if (dependencies.Contains<JsonArray>(property))
{
JsonArray items = dependencies.Get<JsonArray>(property);
List<string> values = new List<string>(items.Count);
foreach (JsonText item in items.Items<JsonText>())
values.Add(item.Value);
rule.Add(property, values.ToArray());
}
if (dependencies.Contains<JsonObject>(property))
{
JsonObject container = dependencies.Get<JsonObject>(property);
JsonSchemaRule schema = parse(container);
rule.Add(property, schema);
}
}
rules.Add(rule);
}
}
示例3: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonTrue>("uniqueItems"))
{
rules.Add(new JsonUniqueItemsRule());
}
}
示例4: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonText>("$ref"))
{
string reference = definition.Get<JsonText>("$ref").Value;
JsonRefRule rule = new JsonRefRule(reference);
rules.Add(rule);
}
}
示例5: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonNumber>("minItems"))
{
JsonNumber minItems = definition.Get<JsonNumber>("minItems");
JsonMinItemsRule rule = new JsonMinItemsRule(minItems.ToInt32());
rules.Add(rule);
}
}
示例6: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonNumber>("multipleOf"))
{
JsonNumber multipleOf = definition.Get<JsonNumber>("multipleOf");
JsonMultipleOfRule rule = new JsonMultipleOfRule(multipleOf.ToDecimal());
rules.Add(rule);
}
}
示例7: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonObject>("not"))
{
JsonObject not = definition.Get<JsonObject>("not");
JsonNotRule rule = new JsonNotRule(parse(not));
rules.Add(rule);
}
}
示例8: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonText>("format"))
{
JsonText format = definition.Get<JsonText>("format");
JsonFormatRule rule = new JsonFormatRule(format.Value);
rules.Add(rule);
}
}
示例9: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonText>("pattern"))
{
JsonText pattern = definition.Get<JsonText>("pattern");
JsonPatternRule rule = new JsonPatternRule(pattern.Value);
rules.Add(rule);
}
}
示例10: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonNumber>("maximum"))
{
JsonNumber maximum = definition.Get<JsonNumber>("maximum");
JsonTrue exclusiveMaximum = definition.Get<JsonTrue>("exclusiveMaximum");
JsonMaximumRule rule = new JsonMaximumRule(maximum.ToDecimal(), exclusiveMaximum != null);
rules.Add(rule);
}
}
示例11: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonObject>("items"))
{
JsonObject items = definition.Get<JsonObject>("items");
JsonItemsRule rule = new JsonItemsRule(parse(items));
rules.Add(rule);
}
if (definition.Contains<JsonArray>("items"))
{
JsonArray items = definition.Get<JsonArray>("items");
JsonItemsRule rule = new JsonItemsRule();
foreach (JsonObject item in items.Items<JsonObject>())
rule.AddTuple(parse(item));
rules.Add(rule);
}
}
示例12: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonText>("type"))
{
JsonText type = definition.Get<JsonText>("type");
JsonTypeRule rule = new JsonTypeRule();
rule.AddType(type.Value);
rules.Add(rule);
}
if (definition.Contains<JsonArray>("type"))
{
JsonArray type = definition.Get<JsonArray>("type");
JsonTypeRule rule = new JsonTypeRule();
foreach (JsonText item in type.Items<JsonText>())
rule.AddType(item.Value);
rules.Add(rule);
}
}
示例13: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonArray>("oneOf"))
{
JsonArray allOf = definition.Get<JsonArray>("oneOf");
JsonOneOfRule rule = new JsonOneOfRule();
foreach (JsonObject item in allOf.Items<JsonObject>())
rule.Add(parse(item));
rules.Add(rule);
}
}
示例14: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonObject>("properties"))
{
JsonObject properties = definition.Get<JsonObject>("properties");
JsonPropertiesRule rule = new JsonPropertiesRule();
foreach (string property in properties.GetKeys())
rule.AddProperty(property, parse(properties.Get<JsonObject>(property)));
rules.Add(rule);
}
}
示例15: Append
public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
{
if (definition.Contains<JsonArray>("enum"))
{
JsonArray enums = definition.Get<JsonArray>("enum");
JsonEnumRule rule = new JsonEnumRule();
foreach (JsonValue value in enums.Items())
rule.Add(value);
rules.Add(rule);
}
}