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


C# Reddit.UnixTimeStampToDateTime方法代码示例

本文整理汇总了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_", "");
        }
开发者ID:diggforbeer,项目名称:RedditSharpDiggFork,代码行数:30,代码来源:Post.cs

示例2: CreatedThing

        public CreatedThing(Reddit reddit, JToken json)
            : base(json)
        {
            Reddit = reddit;

            var data = json["data"];
            Created = Reddit.UnixTimeStampToDateTime(data["created"].Value<double>());
        }
开发者ID:joeletizia,项目名称:RedditSharp,代码行数:8,代码来源:CreatedThing.cs

示例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>();
        }
开发者ID:joeletizia,项目名称:RedditSharp,代码行数:16,代码来源:PrivateMessage.cs

示例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('/');
 }
开发者ID:diggforbeer,项目名称:RedditSharpDiggFork,代码行数:23,代码来源:Subreddit.cs


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