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


C# JsonObject.Get方法代码示例

本文整理汇总了C#中JsonObject.Get方法的典型用法代码示例。如果您正苦于以下问题:C# JsonObject.Get方法的具体用法?C# JsonObject.Get怎么用?C# JsonObject.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JsonObject的用法示例。


在下文中一共展示了JsonObject.Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CimProjectJsonParser

 internal static CimProject CimProjectJsonParser(JsonObject json)
 {
     var basicProject = BasicProjectJsonParser(json);
     var issueTypes = json.Get<IEnumerable<CimIssueType>>("issuetypes");
     var avatarUris = json.Get<Dictionary<string, Uri>>("avatarUrls");
     return new CimProject(basicProject.Self, basicProject.Key, basicProject.Name, avatarUris, issueTypes);
 }
开发者ID:Tdue21,项目名称:Jira-Rest-Client-Dot-Net-Update,代码行数:7,代码来源:CustomJsonSerializer.cs

示例2: 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

示例3: CreateRequestDataFromJson

 private static RequestData CreateRequestDataFromJson(JsonObject json)
 {
     return new RequestData
     {
         Body = json.Get<Dictionary<string, string>>("Body"),
         Tag = json.Get("Tag"),
         Timeout = json.Get<TimeSpan>("Timeout"),
         Type = json.Get<RequestData.RequestType>("Type"),
         Url = json.Get("Url")
     };
 }
开发者ID:StorozhenkoDmitry,项目名称:SimpleHttp,代码行数:11,代码来源:JsonParser.cs

示例4: Location

        /*
            Example Location:
            {
               "city":{
                  "displayName":"London",
                  "country":{
                     "displayName":"UK"
                  },
                  "lng":-0.128,
                  "lat":51.5078
               },
               "metroArea":{
                  "uri":"http://www.songkick.com/metro_areas/24426-uk-london",
                  "displayName":"London",
                  "country":{
                     "displayName":"UK"
                  },
                  "id":24426,
                  "lng":-0.128,
                  "lat":51.5078
               }
            }
        */
        public Location(JsonObject jsonObject)
        {
            var city = jsonObject.Get<JsonObject> ("city");
            var metroArea = jsonObject.Get<JsonObject> ("metroArea");

            Id = metroArea.Get <int> ("id");
            Uri = metroArea.Get <String> ("uri");

            CityName = city.Get <String> ("displayName");
            CityCountryName = city.GetObjectDisplayName ("country");
            CityStateName = city.GetObjectDisplayName ("state");
        }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:35,代码来源:Location.cs

示例5: 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

示例6: AttachmentJsonParser

 internal static Attachment AttachmentJsonParser(JsonObject json)
 {
     return new Attachment(
         json.Get<Uri>("self"),
         json.Get("filename"),
         json.Get<BasicUser>("author"),
         json.Get<DateTimeOffset>("created"),
         json.Get<int>("size"),
         json.Get("mimeType"),
         json.Get<Uri>("content"),
         json.Get<Uri>("thumbnail"));
 }
开发者ID:Tdue21,项目名称:Jira-Rest-Client-Dot-Net-Update,代码行数:12,代码来源:CustomJsonSerializer.cs

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: 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


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