Результат выполнения запроса получения приложений
コード例 #1
0
ファイル: AppGetObject.cs プロジェクト: vknet/vk
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        public static AppGetObject FromJson(VkResponse response)
        {
            AppGetObject appGetObject;
            if (response.ContainsKey("items"))
            {
                appGetObject = new AppGetObject
                {
                    TotalCount = response["count"],
                    Apps = response["items"].ToVkCollectionOf<App>(r => r),
                    Friends = response["profiles"].ToVkCollectionOf<User>(r => r)
                };
            } else
            {
                appGetObject = new AppGetObject
                {
                    TotalCount = response["count"],
                    Apps = response["items"].ToVkCollectionOf<App>(r => r)
                };
            }

            return appGetObject;
        }
コード例 #2
0
ファイル: AppGetObject.cs プロジェクト: wowbios/vk
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        public static AppGetObject FromJson(VkResponse response)
        {
            AppGetObject appGetObject;

            if (response.ContainsKey("items"))
            {
                appGetObject = new AppGetObject
                {
                    TotalCount = response["count"],
                    Apps       = response["items"].ToVkCollectionOf <App>(r => r),
                    Friends    = response["profiles"].ToVkCollectionOf <User>(r => r)
                };
            }
            else
            {
                appGetObject = new AppGetObject
                {
                    TotalCount = response["count"],
                    Apps       = response["items"].ToVkCollectionOf <App>(r => r)
                };
            }

            return(appGetObject);
        }