本文整理汇总了C#中JsonData.Get方法的典型用法代码示例。如果您正苦于以下问题:C# JsonData.Get方法的具体用法?C# JsonData.Get怎么用?C# JsonData.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonData
的用法示例。
在下文中一共展示了JsonData.Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
internal static LocationResponse Parse(JsonData data)
{
if (data == null || !data.Has("longitude") || !data.Has("latitude"))
{
return null;
}
return new LocationResponse
{
Longitude = data.Get<float>("longitude"),
Latitude = data.Get<float>("latitude")
};
}
示例2: Parse
public static LocationResponse Parse(JsonData data)
{
if (data == null || !data.Has("longitude") || !data.Has("latitude"))
{
return null;
}
return new LocationResponse
{
Longitude = data.Get<decimal>("longitude"),
Latitude = data.Get<decimal>("latitude")
};
}
示例3: Parse
internal static GroupChatResponse Parse(JsonData data)
{
if (data == null || !data.Has("id") || !data.Has("title"))
{
return null;
}
return new GroupChatResponse
{
Id = data.Get<int>("id"),
Title = data.Get<string>("title")
};
}
示例4: 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")
};
}
示例5: Parse
internal static SendChatActionResponse Parse(JsonData data)
{
if (data == null)
{
return null;
}
return new SendChatActionResponse
{
Ok = data.Get<bool>("ok"),
ErrorCode = data.Get<int?>("error_code"),
Description = data.Get<string>("description")
};
}
示例6: Parse
internal static FileResponse Parse(JsonData data)
{
if (data == null || !data.Has("file_id"))
{
return null;
}
return new FileResponse
{
FileId = data.Get<string>("file_id"),
FileSize = data.Get<int?>("file_size"),
FilePath = data.Get<string>("file_path")
};
}
示例7: Parse
internal static AnswerInlineQueryResponse Parse(JsonData data)
{
if (data == null)
{
return null;
}
return new AnswerInlineQueryResponse
{
Ok = data.Get<bool>("ok"),
ErrorCode = data.Get<int?>("error_code"),
Description = data.Get<string>("description")
};
}
示例8: Parse
public static SetWebhookResponse Parse(JsonData data)
{
if (data == null)
{
return null;
}
return new SetWebhookResponse
{
Ok = data.Get<bool>("ok"),
ErrorCode = data.Get<int?>("error_code"),
Description = data.Get<string>("description")
};
}
示例9: 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"))
};
}
示例10: Parse
public static VoiceResponse Parse(JsonData data)
{
if (data == null || !data.Has("file_id") || !data.Has("duration"))
{
return null;
}
return new VoiceResponse
{
FileId = data.Get<string>("file_id"),
Duration = data.Get<int>("duration"),
MimeType = data.Get<string>("mime_type"),
FileSize = data.Get<int?>("file_size")
};
}
示例11: 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")
};
}
示例12: Parse
public static PhotoSizeResponse Parse(JsonData data)
{
if (data == null || !data.Has("file_id") || data.Has("width") || data.Has("height"))
{
return null;
}
return new PhotoSizeResponse
{
FileId = data.Get<string>("file_id"),
Width = data.Get<int>("width"),
Height = data.Get<int>("height"),
FileSize = data.Get<int?>("file_size")
};
}
示例13: Parse
internal static UserResponse Parse(JsonData data)
{
if (data == null || !data.Has("id") || !data.Has("first_name"))
{
return null;
}
return new UserResponse
{
Id = data.Get<int>("id"),
FirstName = data.Get<string>("first_name"),
LastName = data.Get<string>("last_name"),
UserName = data.Get<string>("username")
};
}
示例14: 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"))
};
}
示例15: 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"))
};
}