本文整理汇总了C#中LitJson.JsonData.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# JsonData.GetValue方法的具体用法?C# JsonData.GetValue怎么用?C# JsonData.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LitJson.JsonData
的用法示例。
在下文中一共展示了JsonData.GetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RelatedResults
public RelatedResults(JsonData resultsJson)
{
if (resultsJson == null) return;
ResultAnnotations = new Annotation(resultsJson.GetValue<JsonData>("annotations"));
Score = resultsJson.GetValue<double>("score");
Kind = resultsJson.GetValue<string>("kind");
JsonData value = resultsJson.GetValue<JsonData>("value");
ValueAnnotations = new Annotation(value.GetValue<JsonData>("annotations"));
Retweeted = value.GetValue<bool>("retweeted");
InReplyToScreenName = value.GetValue<string>("in_reply_to_screen_name");
var contributors = value.GetValue<JsonData>("contributors");
Contributors =
contributors == null ?
new List<Contributor>() :
(from JsonData contributor in contributors
select new Contributor(contributor))
.ToList();
Coordinates = new Coordinate(value.GetValue<JsonData>("coordinates"));
Place = new Place(value.GetValue<JsonData>("place"));
User = new User(value.GetValue<JsonData>("user"));
RetweetCount = value.GetValue<int>("retweet_count");
IDString = value.GetValue<string>("id_str");
InReplyToUserID = value.GetValue<ulong>("in_reply_to_user_id");
Favorited = value.GetValue<bool>("favorited");
InReplyToStatusIDString = value.GetValue<string>("in_reply_to_status_id_str");
InReplyToStatusID = value.GetValue<ulong>("in_reply_to_status_id");
Source = value.GetValue<string>("source");
CreatedAt = value.GetValue<string>("created_at").GetDate(DateTime.MaxValue);
InReplyToUserIDString = value.GetValue<string>("in_reply_to_user_id_str");
Truncated = value.GetValue<bool>("truncated");
Geo = new Geo(value.GetValue<JsonData>("geo"));
Text = value.GetValue<string>("text");
}
示例2: Friendship
public Friendship(JsonData friendJson)
{
if (friendJson == null) return;
TargetRelationship = new Relationship(friendJson.GetValue<JsonData>("target"));
SourceRelationship = new Relationship(friendJson.GetValue<JsonData>("source"));
}
示例3: Media
public Media(JsonData media)
{
if (media == null) return;
Image = new MediaImage(media.GetValue<JsonData>("image"));
MediaID = media.GetValue<string>("media_id_string").GetULong(0);
Size = media.GetValue<int>("size");
}
示例4: SavedSearch
public SavedSearch(JsonData searchJson)
{
Query = searchJson.GetValue<string>("query");
Name = searchJson.GetValue<string>("name");
Postition = searchJson.GetValue<int>("position");
IDString = searchJson.GetValue<string>("id_str");
CreatedAt = searchJson.GetValue<string>("created_at").GetDate(DateTime.MaxValue);
}
示例5: Event
public Event(JsonData evt)
{
Target = new User(evt.GetValue<JsonData>("target"));
Source = new User(evt.GetValue<JsonData>("source"));
EventName = evt.GetValue<string>("event");
var targetObj = evt.GetValue<JsonData>("target_object", defaultValue: null);
TargetObject = targetObj == null ? (string)null : targetObj.ToString();
CreatedAt = evt.GetValue<string>("created_at").GetDate(DateTime.MaxValue);
}
示例6: ForUser
public ForUser(JsonData user)
{
UserID = user.GetValue<ulong>("for_user");
var message = user.GetValue<JsonData>("message");
var friends = message.GetValue<JsonData>("friends");
Friends =
friends == null ? new List<ulong>() :
(from JsonData friend in friends
select (ulong)friend)
.ToList();
}
示例7: VideoInfo
public VideoInfo(JsonData videoInfo)
{
AspectRatio = new AspectRatio(videoInfo.GetValue<JsonData>("aspect_ratio"));
Duration = videoInfo.GetValue<int>("duration_millis");
JsonData variants = videoInfo.GetValue<JsonData>("variants");
if (variants != null && variants.Count > 0)
Variants =
(from JsonData variant in videoInfo.GetValue<JsonData>("variants")
select new Variant(variant))
.ToList();
}
示例8: Category
public Category(JsonData catJson)
{
Size = catJson.GetValue<int>("size");
Name = catJson.GetValue<string>("name");
Slug = catJson.GetValue<string>("slug");
var users = catJson.GetValue<JsonData>("users");
if (users != null)
Users =
(from JsonData user in users
select new User(user))
.ToList();
}
示例9: Geometry
internal Geometry(JsonData geometry)
{
if (geometry == null) return;
Type = geometry.GetValue<string>("type");
var coordinates = geometry.GetValue<JsonData>("coordinates");
Coordinates =
(from JsonData outer in coordinates
from JsonData coord in outer
select new Coordinate(coord))
.ToList();
}
示例10: Disconnect
public Disconnect(JsonData json)
{
var disconnect = json.GetValue<JsonData>("disconnect");
Code = disconnect.GetValue<int>("code");
StreamName = disconnect.GetValue<string>("stream_name");
Reason = disconnect.GetValue<string>("reason");
}
示例11: TooManyFollows
public TooManyFollows(JsonData warning)
{
var warn = warning.GetValue<JsonData>("warning");
Code = warn.GetValue<string>("code");
Message = warn.GetValue<string>("message");
UserID = warn.GetValue<ulong>("user_id");
}
示例12: Stall
public Stall(JsonData stall)
{
var warning = stall.GetValue<JsonData>("user_withheld");
Code = warning.GetValue<string>("code");
Message = warning.GetValue<string>("message");
PercentFull = warning.GetValue<int>("percent_full");
}
示例13: Delete
public Delete(JsonData delete)
{
var del = delete.GetValue<JsonData>("delete");
var status = del.GetValue<JsonData>("status");
StatusID = status.GetValue<ulong>("id");
UserID = status.GetValue<ulong>("user_id");
}
示例14: FriendsList
public FriendsList(JsonData friends)
{
Friends =
friends == null ? new List<ulong>() :
(from JsonData friend in friends.GetValue<JsonData>("friends")
select (ulong)friend)
.ToList();
}
示例15: ControlStreamFollow
public ControlStreamFollow(JsonData csJson)
{
var follow = csJson.GetValue<JsonData>("follow");
User = new ControlStreamUser(follow.GetValue<JsonData>("user"));
Friends =
(from JsonData friend in follow.GetValue<JsonData>("friends")
select (ulong)friend)
.ToList();
Cursors = new Cursors(follow);
}