本文整理汇总了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);
}
示例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);
}
}
示例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")
};
}
示例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");
}
示例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);
}
}
示例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"));
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}