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


C# JsonData.GetJson方法代码示例

本文整理汇总了C#中JsonData.GetJson方法的典型用法代码示例。如果您正苦于以下问题:C# JsonData.GetJson方法的具体用法?C# JsonData.GetJson怎么用?C# JsonData.GetJson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JsonData的用法示例。


在下文中一共展示了JsonData.GetJson方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Parse

        internal static UpdateResponse Parse(JsonData data)
        {
            if (data == null || !data.Has("update_id"))
            {
                return null;
            }

            return new UpdateResponse
            {
                UpdateId = data.Get<int>("update_id"),
                Message = MessageResponse.Parse(data.GetJson("message")),
                InlineQuery = InlineQueryResponse.Parse(data.GetJson("inline_query")),
                ChosenInlineResult = ChosenInlineResultResponse.Parse(data.GetJson("chosen_inline_result"))
            };
        }
开发者ID:LouisMT,项目名称:TeleBotDotNet,代码行数:15,代码来源:UpdateResponse.cs

示例2: Parse

        public static UpdateResponse Parse(JsonData data)
        {
            if (data == null || !data.Has("update_id"))
            {
                return null;
            }

            return new UpdateResponse
            {
                UpdateId = data.Get<int>("update_id"),
                Message = MessageResponse.Parse(data.GetJson("message"))
            };
        }
开发者ID:YekanPedia,项目名称:RoboTele,代码行数:13,代码来源:UpdateResponse.cs

示例3: Parse

        internal static ChosenInlineResultResponse Parse(JsonData data)
        {
            if (data == null || !data.Has("result_id") || !data.Has("from") || !data.Has("query"))
            {
                return null;
            }

            return new ChosenInlineResultResponse
            {
                ResultId = data.Get<string>("result_id"),
                From = UserResponse.Parse(data.GetJson("from")),
                Query = data.Get<string>("query")
            };
        }
开发者ID:LouisMT,项目名称:TeleBotDotNet,代码行数:14,代码来源:ChosenInlineResultResponse.cs

示例4: Parse

        internal static GetFileResponse Parse(JsonData data)
        {
            if (data == null)
            {
                return null;
            }

            return new GetFileResponse
            {
                Ok = data.Get<bool>("ok"),
                ErrorCode = data.Get<int?>("error_code"),
                Description = data.Get<string>("description"),
                Result = FileResponse.Parse(data.GetJson("result"))
            };
        }
开发者ID:johannesheesterman,项目名称:TeleBotDotNet,代码行数:15,代码来源:GetFileResponse.cs

示例5: Parse

        public static SendPhotoResponse Parse(JsonData data)
        {
            if (data == null)
            {
                return null;
            }

            return new SendPhotoResponse
            {
                Ok = data.Get<bool>("ok"),
                ErrorCode = data.Get<int?>("error_code"),
                Description = data.Get<string>("description"),
                Result = MessageResponse.Parse(data.GetJson("result"))
            };
        }
开发者ID:YekanPedia,项目名称:RoboTele,代码行数:15,代码来源:SendPhotoResponse.cs

示例6: Parse

        public static GetUserProfilePhotosResponse Parse(JsonData data)
        {
            if (data == null)
            {
                return null;
            }

            return new GetUserProfilePhotosResponse
            {
                Ok = data.Get<bool>("ok"),
                ErrorCode = data.Get<int?>("error_code"),
                Description = data.Get<string>("description"),
                Result = UserProfilePhotosResponse.Parse(data.GetJson("result"))
            };
        }
开发者ID:YekanPedia,项目名称:RoboTele,代码行数:15,代码来源:GetUserProfilePhotosResponse.cs

示例7: Parse

        internal static InlineQueryResponse Parse(JsonData data)
        {
            if (data == null || !data.Has("id") || !data.Has("from") || !data.Has("query") || !data.Has("offset"))
            {
                return null;
            }

            return new InlineQueryResponse
            {
                Id = data.Get<string>("id"),
                From = UserResponse.Parse(data.GetJson("from")),
                Query = data.Get<string>("query"),
                Offset = data.Get<string>("offset")
            };
        }
开发者ID:LouisMT,项目名称:TeleBotDotNet,代码行数:15,代码来源:InlineQueryResponse.cs

示例8: Parse

        public static DocumentResponse Parse(JsonData data)
        {
            if (data == null || !data.Has("file_id"))
            {
                return null;
            }

            return new DocumentResponse
            {
                FileId = data.Get<string>("file_id"),
                Thumb = PhotoSizeResponse.Parse(data.GetJson("thumb")),
                FileName = data.Get<string>("file_name"),
                MimeType = data.Get<string>("mime_type"),
                FileSize = data.Get<int?>("file_size")
            };
        }
开发者ID:YekanPedia,项目名称:RoboTele,代码行数:16,代码来源:DocumentResponse.cs

示例9: Parse

        internal static StickerResponse Parse(JsonData data)
        {
            if (data == null || !data.Has("file_id") || !data.Has("width") || !data.Has("height"))
            {
                return null;
            }

            return new StickerResponse
            {
                FileId = data.Get<string>("file_id"),
                Width = data.Get<int>("width"),
                Height = data.Get<int>("height"),
                Thumb = PhotoSizeResponse.Parse(data.GetJson("thumb")),
                FileSize = data.Get<int?>("file_size")
            };
        }
开发者ID:johannesheesterman,项目名称:TeleBotDotNet,代码行数:16,代码来源:StickerResponse.cs

示例10: Parse

        internal static VideoResponse Parse(JsonData data)
        {
            if (data == null || !data.Has("file_id") || !data.Has("width") || !data.Has("height") || !data.Has("duration"))
            {
                return null;
            }

            return new VideoResponse
            {
                FileId = data.Get<string>("file_id"),
                Width = data.Get<int>("width"),
                Height = data.Get<int>("height"),
                Duration = data.Get<int>("duration"),
                Thumb = PhotoSizeResponse.Parse(data.GetJson("thumb")),
                MimeType = data.Get<string>("mime_type"),
                FileSize = data.Get<int?>("file_size")
            };
        }
开发者ID:LouisMT,项目名称:TeleBotDotNet,代码行数:18,代码来源:VideoResponse.cs

示例11: Parse

        public static MessageResponse Parse(JsonData data)
        {
            if (data == null || !data.Has("message_id") || !data.Has("from") || !data.Has("date") || !data.Has("chat"))
            {
                return null;
            }

            var messageResponse = new MessageResponse
            {
                MessageId = data.Get<int>("message_id"),
                From = UserResponse.Parse(data.GetJson("from")),
                Date = data.GetDateTime("date"),
                Chat = ChatResponse.Parse(data.GetJson("chat")),
                ForwardFrom = UserResponse.Parse(data.GetJson("forward_from")),
                ForwardDate = data.GetDateTime("forward_date"),
                ReplyToMessage = Parse(data.GetJson("reply_to_message")),
                Text = data.Get<string>("text"),
                Audio = AudioResponse.Parse(data.GetJson("audio")),
                Document = DocumentResponse.Parse(data.GetJson("document")),
                Sticker = StickerResponse.Parse(data.GetJson("sticker")),
                Video = VideoResponse.Parse(data.GetJson("video")),
                Voice = VoiceResponse.Parse(data.GetJson("voice")),
                Caption = data.Get<string>("caption"),
                Contact = ContactResponse.Parse(data.GetJson("contact")),
                Location = LocationResponse.Parse(data.GetJson("location")),
                NewChatParticipant = UserResponse.Parse(data.GetJson("new_chat_participant")),
                LeftChatParticipant = UserResponse.Parse(data.GetJson("left_chat_participant")),
                NewChatTitle = data.Get<string>("new_chat_title"),
                DeleteChatPhoto = data.Get<bool?>("delete_chat_photo"),
                GroupChatCreated = data.Get<bool?>("group_chat_created")
            };

            if (data.Has("photo"))
            {
                foreach (var photo in data.GetJsonList("photo"))
                {
                    messageResponse.Photo.Add(PhotoSizeResponse.Parse(photo));
                }
            }
            if (data.Has("new_chat_photo"))
            {
                foreach (var photo in data.GetJsonList("new_chat_photo"))
                {
                    messageResponse.NewChatPhoto.Add(PhotoSizeResponse.Parse(photo));
                }
            }

            return messageResponse;
        }
开发者ID:YekanPedia,项目名称:RoboTele,代码行数:49,代码来源:MessageResponse.cs


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