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


C# JsonValue.GetValues方法代码示例

本文整理汇总了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;
        }
开发者ID:javaday,项目名称:Spring.Social.oDesk,代码行数:32,代码来源:JobDeserializer.cs

示例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;
 }
开发者ID:nsavga,项目名称:spring-net-rest,代码行数:9,代码来源:TwitterClient.cs

示例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;
 }
开发者ID:kisspa,项目名称:spring-net-social-twitter,代码行数:9,代码来源:SavedSearchListDeserializer.cs

示例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;
 }
开发者ID:kisspa,项目名称:spring-net-social-twitter,代码行数:9,代码来源:TweetListDeserializer.cs

示例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;
 }
开发者ID:kisspa,项目名称:spring-net-social-twitter,代码行数:9,代码来源:UserListListDeserializer.cs

示例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;
 }
开发者ID:kisspa,项目名称:spring-net-social-twitter,代码行数:9,代码来源:DirectMessageListDeserializer.cs

示例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;
 }
开发者ID:kisspa,项目名称:spring-net-social-twitter,代码行数:9,代码来源:LongListDeserializer.cs

示例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;
 }
开发者ID:gultekinbozkurt,项目名称:spring-net-social-dropbox,代码行数:9,代码来源:EntryListDeserializer.cs

示例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;
 }
开发者ID:kisspa,项目名称:spring-net-social-twitter,代码行数:11,代码来源:CursoredTwitterProfileListDeserializer.cs

示例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;
 }
开发者ID:kisspa,项目名称:spring-net-social-twitter,代码行数:11,代码来源:CursoredLongListDeserializer.cs

示例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;
 }
开发者ID:kisspa,项目名称:spring-net-social-twitter,代码行数:11,代码来源:CursoredUserListListDeserializer.cs

示例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;
        }
开发者ID:javaday,项目名称:Spring.Social.oDesk,代码行数:13,代码来源:JobListDeserializer.cs

示例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;
 }
开发者ID:kisspa,项目名称:spring-net-social-twitter,代码行数:14,代码来源:SuggestionCategoryListDeserializer.cs

示例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;
		}
开发者ID:kisspa,项目名称:spring-net-social-facebook,代码行数:14,代码来源:ImageListDeserializer.cs

示例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;
		}
开发者ID:kisspa,项目名称:spring-net-social-facebook,代码行数:16,代码来源:StoryTagMapDeserializer.cs


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