本文整理汇总了C#中RedditSharp.Reddit.UnixTimeStampToDateTime方法的典型用法代码示例。如果您正苦于以下问题:C# Reddit.UnixTimeStampToDateTime方法的具体用法?C# Reddit.UnixTimeStampToDateTime怎么用?C# Reddit.UnixTimeStampToDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RedditSharp.Reddit
的用法示例。
在下文中一共展示了Reddit.UnixTimeStampToDateTime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Post
public Post(Reddit reddit, JToken post)
: base(reddit, post)
{
Reddit = reddit;
var data = post["data"];
AuthorName = data["author"].Value<string>();
AuthorFlairClass = data["author_flair_css_class"].Value<string>();
AuthorFlairText = data["author_flair_text"].Value<string>();
Created = Reddit.UnixTimeStampToDateTime(data["created"].Value<double>());
Domain = data["domain"].Value<string>();
Downvotes = data["downs"].Value<int>();
Edited = data["edited"].Value<bool>();
IsSelfPost = data["is_self"].Value<bool>();
LinkFlairClass = data["link_flair_css_class"].Value<string>();
LinkFlairText = data["link_flair_text"].Value<string>();
CommentCount = data["num_comments"].Value<int>();
NSFW = data["over_18"].Value<bool>();
Permalink = data["permalink"].Value<string>();
Saved = data["saved"].Value<bool>();
Score = data["score"].Value<int>();
SelfText = data["selftext"].Value<string>();
SelfTextHtml = data["selftext_html"].Value<string>();
Subreddit = data["subreddit"].Value<string>();
Thumbnail = data["thumbnail"].Value<string>();
Title = HttpUtility.HtmlDecode(data["title"].Value<string>());
Upvotes = data["ups"].Value<int>();
Url = data["url"].Value<string>();
Name = data["name"].Value<string>().Replace("t3_", "");
}
示例2: CreatedThing
public CreatedThing(Reddit reddit, JToken json)
: base(json)
{
Reddit = reddit;
var data = json["data"];
Created = Reddit.UnixTimeStampToDateTime(data["created"].Value<double>());
}
示例3: PrivateMessage
public PrivateMessage(Reddit reddit, JToken json)
: base(json)
{
Reddit = reddit;
var data = json["data"];
Body = data["body"].Value<string>();
IsComment = data["was_comment"].Value<bool>();
Sent = Reddit.UnixTimeStampToDateTime(data["created"].Value<double>());
Destination = data["dest"].Value<string>();
Author = data["author"].Value<string>();
BodyHtml = data["body_html"].Value<string>();
Subreddit = data["subreddit"].Value<string>();
Unread = data["new"].Value<bool>();
Subject = data["subject"].Value<string>();
}
示例4: Subreddit
protected internal Subreddit(Reddit reddit, JToken json)
{
Reddit = reddit;
var data = json["data"];
Created = Reddit.UnixTimeStampToDateTime(data["created"].Value<double>());
Description = data["description"].Value<string>();
DisplayName = data["display_name"].Value<string>();
HeaderImage = data["header_img"].Value<string>();
HeaderTitle = data["header_title"].Value<string>();
Id = data["name"].Value<string>();
NSFW = data["over18"].Value<bool>();
PublicDescription = data["public_description"].Value<string>();
Subscribers = data["subscribers"].Value<int>();
Title = data["title"].Value<string>();
Url = data["url"].Value<string>();
ActiveUsers = data["accounts_active"].Value<int?>();
Name = Url;
if (Name.StartsWith("/r/"))
Name = Name.Substring(3);
if (Name.StartsWith("r/"))
Name = Name.Substring(2);
Name = Name.TrimEnd('/');
}