本文整理汇总了C#中JsonValue.GetValues方法的典型用法代码示例。如果您正苦于以下问题:C# JsonValue.GetValues方法的具体用法?C# JsonValue.GetValues怎么用?C# JsonValue.GetValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonValue
的用法示例。
在下文中一共展示了JsonValue.GetValues方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public object Deserialize(JsonValue json, JsonMapper mapper)
{
var job = new Job();
var clientJson = json.GetValue("client");
job.Id = json.GetValueOrDefault<string>("id", "");
job.Title = json.GetValueOrDefault<string>("title", "");
job.Snippet = json.GetValueOrDefault<string>("snippet", "");
job.Skills = deserializeSkills(json.GetValues("skills"));
job.Category = json.GetValueOrDefault<string>("category", "");
job.Subcategory = json.GetValueOrDefault<string>("subcategory", "");
job.JobType = json.GetValueOrDefault<string>("job_type", "");
job.Duration = json.GetValueOrDefault<string>("duration", "");
job.Budget = json.GetValueOrDefault<string>("budget", "");
job.Workload = json.GetValueOrDefault<string>("workload", "");
job.Status = json.GetValueOrDefault<string>("job_status", "");
job.Url = json.GetValueOrDefault<string>("url", "");
job.DateCreated = json.GetValueOrDefault<DateTime>("date_created", DateTime.MinValue);
if (clientJson != null)
{
job.Client.Country = clientJson.GetValueOrDefault<string>("country", "");
job.Client.FeedbackRating = clientJson.GetValueOrDefault<float>("feedback", 0);
job.Client.ReviewCount = clientJson.GetValueOrDefault<int>("reviews_count", 0);
job.Client.JobCount = clientJson.GetValueOrDefault<int>("jobs_posted", 0);
job.Client.HireCount = clientJson.GetValueOrDefault<int>("past_hires", 0);
job.Client.PaymentVerificationStatus = clientJson.GetValueOrDefault<string>("payment_verification_status", "");
}
return job;
}
示例2: ExtractTimelineTweetsFromResponse
private IList<Tweet> ExtractTimelineTweetsFromResponse(JsonValue response)
{
IList<Tweet> tweets = new List<Tweet>();
foreach (JsonValue item in response.GetValues())
{
tweets.Add(PopulateTweetFromTimelineItem(item));
}
return tweets;
}
示例3: Deserialize
public object Deserialize(JsonValue value, JsonMapper mapper)
{
IList<SavedSearch> savedSearches = new List<SavedSearch>();
foreach (JsonValue itemValue in value.GetValues())
{
savedSearches.Add(mapper.Deserialize<SavedSearch>(itemValue));
}
return savedSearches;
}
示例4: Deserialize
public object Deserialize(JsonValue value, JsonMapper mapper)
{
IList<Tweet> tweets = new List<Tweet>();
foreach (JsonValue itemValue in value.GetValues())
{
tweets.Add(mapper.Deserialize<Tweet>(itemValue));
}
return tweets;
}
示例5: Deserialize
public object Deserialize(JsonValue value, JsonMapper mapper)
{
IList<UserList> userLists = new List<UserList>();
foreach (JsonValue itemValue in value.GetValues())
{
userLists.Add(mapper.Deserialize<UserList>(itemValue));
}
return userLists;
}
示例6: Deserialize
public object Deserialize(JsonValue value, JsonMapper mapper)
{
IList<DirectMessage> directMessages = new List<DirectMessage>();
foreach (JsonValue itemValue in value.GetValues())
{
directMessages.Add(mapper.Deserialize<DirectMessage>(itemValue));
}
return directMessages;
}
示例7: Deserialize
public object Deserialize(JsonValue value, JsonMapper mapper)
{
IList<long> longs = new List<long>();
foreach (JsonValue itemValue in value.GetValues())
{
longs.Add(itemValue.GetValue<long>());
}
return longs;
}
示例8: Deserialize
public object Deserialize(JsonValue value, JsonMapper mapper)
{
IList<Entry> entries = new List<Entry>();
foreach (JsonValue itemValue in value.GetValues())
{
entries.Add(mapper.Deserialize<Entry>(itemValue));
}
return entries;
}
示例9: Deserialize
public object Deserialize(JsonValue value, JsonMapper mapper)
{
CursoredList<TwitterProfile> twitterProfiles = new CursoredList<TwitterProfile>();
twitterProfiles.PreviousCursor = value.GetValue<long>("previous_cursor");
twitterProfiles.NextCursor = value.GetValue<long>("next_cursor");
foreach (JsonValue itemValue in value.GetValues("users"))
{
twitterProfiles.Add(mapper.Deserialize<TwitterProfile>(itemValue));
}
return twitterProfiles;
}
示例10: Deserialize
public object Deserialize(JsonValue value, JsonMapper mapper)
{
CursoredList<long> cursoredList = new CursoredList<long>();
cursoredList.PreviousCursor = value.GetValue<long>("previous_cursor");
cursoredList.NextCursor = value.GetValue<long>("next_cursor");
foreach (JsonValue itemValue in value.GetValues("ids"))
{
cursoredList.Add(itemValue.GetValue<long>());
}
return cursoredList;
}
示例11: Deserialize
public object Deserialize(JsonValue value, JsonMapper mapper)
{
CursoredList<UserList> userLists = new CursoredList<UserList>();
userLists.PreviousCursor = value.GetValue<long>("previous_cursor");
userLists.NextCursor = value.GetValue<long>("next_cursor");
foreach (JsonValue itemValue in value.GetValues("lists"))
{
userLists.Add(mapper.Deserialize<UserList>(itemValue));
}
return userLists;
}
示例12: Deserialize
public virtual object Deserialize(JsonValue json, JsonMapper mapper)
{
var jobList = new List<Job>();
foreach(var jobJson in json.GetValues())
{
var job = mapper.Deserialize<Job>(jobJson);
jobList.Add(job);
}
return jobList;
}
示例13: Deserialize
public object Deserialize(JsonValue value, JsonMapper mapper)
{
IList<SuggestionCategory> suggestionCategories = new List<SuggestionCategory>();
foreach (JsonValue itemValue in value.GetValues())
{
suggestionCategories.Add(new SuggestionCategory()
{
Name = itemValue.GetValue<string>("name"),
Size = itemValue.GetValue<int>("size"),
Slug = itemValue.GetValue<string>("slug")
});
}
return suggestionCategories;
}
示例14: Deserialize
public object Deserialize(JsonValue json, JsonMapper mapper)
{
IList<Photo.Image> entries = null;
if ( json != null && !json.IsNull )
{
// 04/15/2012 Paul. Images is an array, not a data node.
entries = new List<Photo.Image>();
foreach ( JsonValue itemValue in json.GetValues() )
{
entries.Add(mapper.Deserialize<Photo.Image>(itemValue));
}
}
return entries;
}
示例15: Deserialize
public object Deserialize(JsonValue json, JsonMapper mapper)
{
Dictionary<int, List<StoryTag>> tags = null;
if ( json != null && !json.IsNull )
{
tags = new Dictionary<int, List<StoryTag>>();
int i = 0;
foreach ( JsonValue itemValue in json.GetValues() )
{
List<StoryTag> tagList = mapper.Deserialize<List<StoryTag>>(itemValue);
tags.Add(i, tagList);
i++;
}
}
return tags;
}