• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Utils.VkResponse类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中VkNet.Utils.VkResponse的典型用法代码示例。如果您正苦于以下问题:C# VkResponse类的具体用法?C# VkResponse怎么用?C# VkResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VkResponse类属于VkNet.Utils命名空间,在下文中一共展示了VkResponse类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FromJson

		/// <summary>
		/// Разобрать из json.
		/// </summary>
		/// <param name="response">Ответ сервера.</param>
		/// <returns></returns>
		internal static NewsSuggestions FromJson(VkResponse response)
		{
			var newsSuggestions = new NewsSuggestions
			{
				Users = new List<User>(),
				Groups = new List<Group>()
			};
			VkResponseArray result = response;
			foreach (var item in result)
			{

				switch (item["type"].ToString())
				{
					case "page":
					case "group":
						{
							Group @group = item;
							newsSuggestions.Groups.Add(@group);
						}
						break;
					case "profile":
						{
							User user = item;
							newsSuggestions.Users.Add(user);
						}
						break;
					default:
						{
							throw new System.Exception(string.Format("Типа '{0}' не существует. Пожалуйста заведите задачу на сайте проекта: https://github.com/vknet/vk/issues", item["type"]));
						}
				}
			}
			return newsSuggestions;
		}
开发者ID:kadkin,项目名称:vk,代码行数:39,代码来源:NewsSuggestions.cs


示例2: FromJson

        internal static Education FromJson(VkResponse response)
        {
            if (response["university"] == null || response["university"].ToString() == "0")
                return null;

            var education = new Education();

            education.UniversityId = Utilities.GetNullableLongId(response["university"]);
            education.UniversityName = response["university_name"];
            education.FacultyId = Utilities.GetNullableLongId(response["faculty"]);
            education.FacultyName = response["faculty_name"];
            education.Graduation = (int?) Utilities.GetNullableLongId(response["graduation"]);

            if (education.UniversityId.HasValue && education.UniversityId == 0)
                education.UniversityId = null;

            if (education.FacultyId.HasValue && education.FacultyId == 0)
                education.FacultyId = null;

            if (education.Graduation.HasValue && education.Graduation == 0)
                education.Graduation = null;

            education.EducationForm = response["education_form"]; // установлено экcпериментальным путем
            education.EducationStatus = response["education_status"]; // установлено экcпериментальным путем

            return education;
        }
开发者ID:SaintCat,项目名称:VkBot,代码行数:27,代码来源:Education.cs


示例3: FromJson

 /// <summary>
 /// Разобрать из json.
 /// </summary>
 /// <param name="response">Ответ сервера.</param>
 /// <returns></returns>
 public static LookupContactsOther FromJson(VkResponse response)
 {
     return new LookupContactsOther
     {
         Contact = response["contact"],
         CommonCount = response["common_count"]
     };
 }
开发者ID:vknet,项目名称:vk,代码行数:13,代码来源:LookupContactsOther.cs


示例4: FromJson

		/// <summary>
		/// Разобрать из json.
		/// </summary>
		/// <param name="response">Ответ сервера.</param>
		/// <returns></returns>
		internal static AuthConfirmResult FromJson(VkResponse response)
		{
			return new AuthConfirmResult
			{
				Success = response["success"],
				UserId = response["uid"]
			};
		}
开发者ID:kadkin,项目名称:vk,代码行数:13,代码来源:AuthConfirmResult.cs


示例5: FromJson

 /// <summary>
 /// Разобрать из json.
 /// </summary>
 /// <param name="response">Ответ сервера.</param>
 /// <returns></returns>
 public static LookupContactsResult FromJson(VkResponse response)
 {
     return new LookupContactsResult
     {
         FoundList = response["found"].ToReadOnlyCollectionOf<User>(x => x),
         Other = response["other"].ToReadOnlyCollectionOf<LookupContactsOther>(x => x)
     };
 }
开发者ID:vknet,项目名称:vk,代码行数:13,代码来源:LookupContactsResult.cs


示例6: FromJson

        internal static Reposts FromJson(VkResponse response)
        {
            var reposts = new Reposts();

            reposts.Count = response["count"];
            reposts.UserReposted = response["user_reposted"];

            return reposts;
        }
开发者ID:G-IT-ED,项目名称:vk,代码行数:9,代码来源:Reposts.cs


示例7: FromJson

        internal static Comments FromJson(VkResponse response)
        {
            var comments = new Comments();

            comments.Count = response["count"];
            comments.CanPost = response["can_post"];

            return comments;
        }
开发者ID:SaintCat,项目名称:VkBot,代码行数:9,代码来源:Comments.cs


示例8: FromJson

        internal static Street FromJson(VkResponse response)
        {
            var street = new Street();

            street.Id = response["sid"];
            street.Title = response["name"];

            return street;
        }
开发者ID:G-IT-ED,项目名称:vk,代码行数:9,代码来源:Street.cs


示例9: FromJson

        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        internal static Product FromJson(VkResponse response)
        {
            var product = new Product
            {
                Price = response["price"]
            };

            return product;
        }
开发者ID:Olegasdf,项目名称:vk,代码行数:14,代码来源:Product.cs


示例10: FromJson

        internal static Lyrics FromJson(VkResponse re)
        {
            var lyrics = new Lyrics();

            lyrics.Id = re["lyrics_id"];
            lyrics.Text = re["text"];

            return lyrics;
        }
开发者ID:G-IT-ED,项目名称:vk,代码行数:9,代码来源:Lyrics.cs


示例11: FromJson

        internal static Country FromJson(VkResponse response)
        {
            var country = new Country();

            country.Id = response["cid"] ?? response["id"];
            country.Title = response["title"] ?? response["name"];

            return country;
        }
开发者ID:SaintCat,项目名称:VkBot,代码行数:9,代码来源:Country.cs


示例12: FromJson

        internal static Status FromJson(VkResponse response)
        {
            var status = new Status();

            status.Text = response["text"];
            status.Audio = response["audio"];

            return status;
        }
开发者ID:G-IT-ED,项目名称:vk,代码行数:9,代码来源:Status.cs


示例13: FromJson

        internal static LastActivity FromJson(VkResponse re)
        {
            var lastActivity = new LastActivity();

            lastActivity.IsOnline = re["online"];
            lastActivity.Time = Utilities.FromUnixTime(re["time"]);

            return lastActivity;
        }
开发者ID:justloot,项目名称:vk,代码行数:9,代码来源:LastActivity.cs


示例14: FromJson

        internal static FriendList FromJson(VkResponse response)
        {
            var list = new FriendList();

            list.Id = response["lid"];
            list.Name = response["name"];

            return list;
        }
开发者ID:G-IT-ED,项目名称:vk,代码行数:9,代码来源:FriendList.cs


示例15: FromJson

        internal static Faculty FromJson(VkResponse response)
        {
            var faculty = new Faculty();

            faculty.Id = response["id"];
            faculty.Title = response["title"];

            return faculty;
        }
开发者ID:G-IT-ED,项目名称:vk,代码行数:9,代码来源:Faculty.cs


示例16: FromJson

        internal static PostSource FromJson(VkResponse response)
        {
            var postSource = new PostSource();

            postSource.Type = response["type"];
            postSource.Data = response["data"];

            return postSource;
        }
开发者ID:G-IT-ED,项目名称:vk,代码行数:9,代码来源:PostSource.cs


示例17: FromJson

        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        internal static Rating FromJson(VkResponse response)
        {
            var rating = new Rating
            {
                Stars = response["stars"],
                ReviewsCount = response["reviews_count"]
            };

            return rating;
        }
开发者ID:Olegasdf,项目名称:vk,代码行数:15,代码来源:Rating.cs


示例18: FromJson

        internal static LongPollServerResponse FromJson(VkResponse response)
        {
            var longPollServerResponse = new LongPollServerResponse();

            longPollServerResponse.Key = response["key"];
            longPollServerResponse.Server = response["server"];
            longPollServerResponse.Ts = response["ts"];

            return longPollServerResponse;
        }
开发者ID:G-IT-ED,项目名称:vk,代码行数:10,代码来源:LongPollServerResponse.cs


示例19: FromJson

        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        internal static Store FromJson(VkResponse response)
        {
            var store = new Store
            {
                Id = response["id"],
                Name = response["name"]
            };

            return store;
        }
开发者ID:Olegasdf,项目名称:vk,代码行数:15,代码来源:Store.cs


示例20: FromJson

        internal static Relative FromJson(VkResponse response)
        {
            var relative = new Relative();

            relative.Id = response["id"];
            relative.Type = response["type"];
            relative.Name = response["name"];

            return relative;
        }
开发者ID:G-IT-ED,项目名称:vk,代码行数:10,代码来源:Relative.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Interop.libvlc_exception_t类代码示例发布时间:2022-05-26
下一篇:
C# Categories.MessagesCategory类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap