• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Reddit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Reddit的典型用法代码示例。如果您正苦于以下问题:C# Reddit类的具体用法?C# Reddit怎么用?C# Reddit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Reddit类属于命名空间,在下文中一共展示了Reddit类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: InitAsync

 public async new Task<AuthenticatedUser> InitAsync(Reddit reddit, JToken json, IWebAgent webAgent)
 {
     CommonInit(reddit, json, webAgent);
     await Task.Factory.StartNew(() => JsonConvert.PopulateObject(json["name"] == null ? json["data"].ToString() : json.ToString(), this,
         reddit.JsonSerializerSettings));
     return this;
 }
开发者ID:j1xwnbsr,项目名称:HFYBotReborn,代码行数:7,代码来源:AuthenticatedUser.cs


示例2: InitAsync

 public async Task<RedditUser> InitAsync(Reddit reddit, JToken json, IWebAgent webAgent)
 {
     CommonInit(reddit, json, webAgent);
     await JsonConvert.PopulateObjectAsync(json["name"] == null ? json["data"].ToString() : json.ToString(), this,
         reddit.JsonSerializerSettings);
     return this;
 }
开发者ID:haroldma,项目名称:RedditSharp,代码行数:7,代码来源:RedditUser.cs


示例3: Init

 public Comment Init(Reddit reddit, JToken json, IWebAgent webAgent, Thing sender)
 {
     var data = CommonInit(reddit, json, webAgent, sender);
     ParseComments(reddit, json, webAgent, sender);
     JsonConvert.PopulateObject(data.ToString(), this, reddit.JsonSerializerSettings);
     return this;
 }
开发者ID:anavaino,项目名称:RedditSharp,代码行数:7,代码来源:Comment.cs


示例4: InitAsync

 public async Task<Comment> InitAsync(Reddit reddit, JToken json, IWebAgent webAgent, Thing sender)
 {
     var data = CommonInit(reddit, json, webAgent, sender);
     await ParseCommentsAsync(reddit, json, webAgent, sender);
     await Task.Factory.StartNew(() => JsonConvert.PopulateObject(data.ToString(), this, reddit.JsonSerializerSettings));
     return this;
 }
开发者ID:anavaino,项目名称:RedditSharp,代码行数:7,代码来源:Comment.cs


示例5: Initialize

 public void Initialize(Settings settings, OfflineService offlineService, Reddit redditService, Dictionary<string, bool> initialFilter)
 {
     _settings = settings;
     _initialFilter = initialFilter;
     _offlineService = offlineService;
     _redditService = redditService;
 }
开发者ID:hippiehunter,项目名称:Baconography,代码行数:7,代码来源:NSFWListingFilter.cs


示例6: Init

 public new AuthenticatedUser Init(Reddit reddit, JToken json, IWebAgent webAgent)
 {
     CommonInit(reddit, json, webAgent);
     JsonConvert.PopulateObject(json["name"] == null ? json["data"].ToString() : json.ToString(), this,
         reddit.JsonSerializerSettings);
     return this;
 }
开发者ID:j1xwnbsr,项目名称:HFYBotReborn,代码行数:7,代码来源:AuthenticatedUser.cs


示例7: SubredditImage

 public SubredditImage(Reddit reddit, SubredditStyle subredditStyle,
     string cssLink, string name)
 {
     Reddit = reddit;
     SubredditStyle = subredditStyle;
     Name = name;
     CssLink = cssLink;
 }
开发者ID:robwwhite,项目名称:RedditSharp,代码行数:8,代码来源:SubredditImage.cs


示例8: SubredditImage

 public SubredditImage(Reddit reddit, SubredditStyle subredditStyle,
     string cssLink, string name, IWebAgent webAgent)
 {
     Reddit = reddit;
     WebAgent = webAgent;
     SubredditStyle = subredditStyle;
     Name = name;
     CssLink = cssLink;
 }
开发者ID:AndreCAndersen,项目名称:RedditSharp,代码行数:9,代码来源:SubredditImage.cs


示例9: GetReddit

 public static Reddit GetReddit()
 {
     if (reddit == null)
     {
         reddit = new Reddit(UserAgent);
         reddit.Login("testjswrapper", "testjswrapper");
     }
     return reddit;
 }
开发者ID:gwely,项目名称:Reddit,代码行数:9,代码来源:Constants.cs


示例10: ParseCommentsAsync

 private async Task ParseCommentsAsync(Reddit reddit, JToken data, IWebAgent webAgent, Thing sender)
 {
     // Parse sub comments
     // TODO: Consider deserializing this properly
     var subComments = new List<Comment>();
     if (data["replies"] != null && data["replies"].Any())
     {
         foreach (var comment in data["replies"]["data"]["children"])
             subComments.Add(await new Comment().InitAsync(reddit, comment, webAgent, sender));
     }
     Comments = subComments.ToArray();            
 }
开发者ID:haroldma,项目名称:RedditSharp,代码行数:12,代码来源:Comment.cs


示例11: ParseCommentsAsync

 private async Task ParseCommentsAsync(Reddit reddit, JToken data, IWebAgent webAgent, Thing sender)
 {
     // Parse sub comments
     var replies = data["data"]["replies"];
     var subComments = new List<Comment>();
     if (replies != null && replies.Count() > 0)
     {
         foreach (var comment in replies["data"]["children"])
             subComments.Add(await new Comment().InitAsync(reddit, comment, webAgent, sender));
     }
     Comments = subComments.ToArray();            
 }
开发者ID:anavaino,项目名称:RedditSharp,代码行数:12,代码来源:Comment.cs


示例12: CommonInit

        private JToken CommonInit(Reddit reddit, JToken json, IWebAgent webAgent, Thing sender)
        {
            base.Init(reddit, webAgent, json);
            var data = json["data"];
            Reddit = reddit;
            WebAgent = webAgent;
            this.Parent = sender;

            // Handle Reddit's API being horrible
            if (data["context"] != null)
            {
                var context = data["context"].Value<string>();
                LinkId = context.Split('/')[4];
            }
         
            return data;
        }
开发者ID:anavaino,项目名称:RedditSharp,代码行数:17,代码来源:Comment.cs


示例13: FinishInit

        protected void FinishInit()
        {
            Current = this;
            _listingFilter = new NSFWListingFilter();
            if (IsInDesignMode)
            {
                _initializationBlob = new InitializationBlob { Settings = new Dictionary<string, string>(), NSFWFilter = new Dictionary<string, bool>() };
            }
            else
            {
                OfflineService = new OfflineService();
                _initializationBlob = OfflineService.LoadInitializationBlob("");
            }
            Settings = new Model.Settings(_initializationBlob.Settings);
            SettingsHub = new SettingsViewModel(Settings);

            RedditUserState = _initializationBlob.DefaultUser ?? new UserState();

            SnooStreamViewModel.ActivityManager.OAuth = SnooStreamViewModel.RedditUserState != null && SnooStreamViewModel.RedditUserState.OAuth != null ?
                    JsonConvert.SerializeObject(SnooStreamViewModel.RedditUserState) : "";

            SnooStreamViewModel.ActivityManager.CanStore = SnooStreamViewModel.RedditUserState != null && SnooStreamViewModel.RedditUserState.IsDefault;

            NotificationService = new Common.NotificationService();
            CaptchaProvider = new CaptchaService();
            RedditService = new Reddit(_listingFilter, RedditUserState, OfflineService, CaptchaProvider, "3m9rQtBinOg_rA", null, "http://www.google.com");
            Login = new LoginViewModel();

            _listingFilter.Initialize(Settings, OfflineService, RedditService, _initializationBlob.NSFWFilter);
            CommandDispatcher = new CommandDispatcher();
            SubredditRiver = new SubredditRiverViewModel(_initializationBlob.Subreddits);
            SelfStream = new SelfStreamViewModel();
            ModStream = new ModStreamViewModel();
            NavMenu = new NavMenu(Enumerable.Empty<LinkRiverViewModel>(), this);
            MessengerInstance.Register<UserLoggedInMessage>(this, OnUserLoggedIn);

            if (RedditUserState.Username != null)
            {
                SelfUser = new AboutUserViewModel(RedditUserState.Username);
            }
        }
开发者ID:hippiehunter,项目名称:Baconography,代码行数:41,代码来源:SnooStreamViewModel.cs


示例14: Init

 protected CreatedThing Init(Reddit reddit, JToken json)
 {
     CommonInit(reddit, json);
     JsonConvert.PopulateObject(json["data"].ToString(), this, reddit.JsonSerializerSettings);
     return this;
 }
开发者ID:j1xwnbsr,项目名称:HFYBotReborn,代码行数:6,代码来源:CreatedThing.cs


示例15: MainPage

 public MainPage()
 {
     InitializeComponent();
     var reddit = new Reddit();
 }
开发者ID:rjb8682,项目名称:RedditClient,代码行数:5,代码来源:MainPage.xaml.cs


示例16: CommonInit

 private void CommonInit(Reddit reddit, JToken json, IWebAgent webAgent)
 {
     base.Init(json);
     Reddit = reddit;
     WebAgent = webAgent;
 }
开发者ID:anavaino,项目名称:RedditSharp,代码行数:6,代码来源:ModAction.cs


示例17: InitAsync

 public async Task<ModAction> InitAsync(Reddit reddit, JToken post, IWebAgent webAgent)
 {
     CommonInit(reddit, post, webAgent);
     await Task.Factory.StartNew(() => JsonConvert.PopulateObject(post["data"].ToString(), this, reddit.JsonSerializerSettings));
     return this;
 }
开发者ID:anavaino,项目名称:RedditSharp,代码行数:6,代码来源:ModAction.cs


示例18: Init

 public ModAction Init(Reddit reddit, JToken json, IWebAgent webAgent)
 {
     CommonInit(reddit, json, webAgent);
     JsonConvert.PopulateObject(json["data"].ToString(), this, reddit.JsonSerializerSettings);
     return this;
 }
开发者ID:anavaino,项目名称:RedditSharp,代码行数:6,代码来源:ModAction.cs


示例19: InitAsync

 protected async Task<VotableThing> InitAsync(Reddit reddit, IWebAgent webAgent, JToken json)
 {
     CommonInit(reddit, webAgent, json);
     await Task.Factory.StartNew(() => JsonConvert.PopulateObject(json["data"].ToString(), this, Reddit.JsonSerializerSettings));
     return this;
 }
开发者ID:gardient,项目名称:RedditRandomNumberGiveawayHelper,代码行数:6,代码来源:VotableThing.cs


示例20: Init

 protected VotableThing Init(Reddit reddit, IWebAgent webAgent, JToken json)
 {
     CommonInit(reddit, webAgent, json);
     JsonConvert.PopulateObject(json["data"].ToString(), this, Reddit.JsonSerializerSettings);
     return this;
 }
开发者ID:gardient,项目名称:RedditRandomNumberGiveawayHelper,代码行数:6,代码来源:VotableThing.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RedisClient类代码示例发布时间:2022-05-24
下一篇:
C# RedBloodDataContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap