当前位置: 首页>>代码示例>>C#>>正文


C# JsonObject.Contains方法代码示例

本文整理汇总了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);
                }
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:13,代码来源:JsonAdditionalItemsRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:32,代码来源:JsonDependencyRuleFactory.cs

示例3: Append

 public override void Append(JsonSchemaRuleComponent rules, JsonObject definition, Func<JsonObject, JsonSchemaRule> parse)
 {
     if (definition.Contains<JsonTrue>("uniqueItems"))
     {
         rules.Add(new JsonUniqueItemsRule());
     }
 }
开发者ID:amacal,项目名称:jinx,代码行数:7,代码来源:JsonUniqueItemsRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:10,代码来源:JsonRefRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:10,代码来源:JsonMinItemsRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:10,代码来源:JsonMultipleOfRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:10,代码来源:JsonNotRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:10,代码来源:JsonFormatRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:10,代码来源:JsonPatternRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:11,代码来源:JsonMaximumRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:21,代码来源:JsonItemsRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:22,代码来源:JsonTypeRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:13,代码来源:JsonOneOfRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:13,代码来源:JsonPropertiesRuleFactory.cs

示例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);
            }
        }
开发者ID:amacal,项目名称:jinx,代码行数:13,代码来源:JsonEnumRuleFactory.cs


注:本文中的JsonObject.Contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。