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


C# TwitterStatus.GetEntityAidedText方法代码示例

本文整理汇总了C#中StarryEyes.Anomaly.TwitterApi.DataModels.TwitterStatus.GetEntityAidedText方法的典型用法代码示例。如果您正苦于以下问题:C# TwitterStatus.GetEntityAidedText方法的具体用法?C# TwitterStatus.GetEntityAidedText怎么用?C# TwitterStatus.GetEntityAidedText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StarryEyes.Anomaly.TwitterApi.DataModels.TwitterStatus的用法示例。


在下文中一共展示了TwitterStatus.GetEntityAidedText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Instance_OnMentionReceived

 static void Instance_OnMentionReceived(TwitterStatus obj)
 {
     Show(new NormalNotificatorViewModel(MetroColors.Orange,
         obj.User, "mention from @" + obj.User.ScreenName, obj.GetEntityAidedText()));
 }
开发者ID:Kei-Nanigashi,项目名称:StarryEyes,代码行数:5,代码来源:NormalNotificatorViewModel.cs

示例2: Instance_OnStatusReceived

 static void Instance_OnStatusReceived(TwitterStatus obj)
 {
     Show(new NormalNotificatorViewModel(MetroColors.Cyan,
         obj.User, "@" + obj.User.ScreenName, obj.GetEntityAidedText()));
 }
开发者ID:Kei-Nanigashi,项目名称:StarryEyes,代码行数:5,代码来源:NormalNotificatorViewModel.cs

示例3: StatusModel

 private StatusModel(TwitterStatus status)
 {
     this.Status = status;
     ImageResolver.Resolve(status.GetEntityAidedText(true))
                  .Aggregate(new List<Tuple<Uri, Uri>>(), (l, i) =>
                  {
                      l.Add(i);
                      return l;
                  })
                  .Finally(() =>
                  {
                      var subj = Interlocked.Exchange(ref this._imagesSubject, null);
                      lock (subj)
                      {
                          subj.OnCompleted();
                          // WE SHOULD NOT CALL Dispose METHOD !!!
                          // http://stackoverflow.com/questions/16540853/why-does-subjectt-dispose-does-not-dispose-current-suscriptions
                          // subj.Dispose();
                      }
                  })
                  .Subscribe(l => this.Images = l);
 }
开发者ID:kissge,项目名称:StarryEyes,代码行数:22,代码来源:StatusModel.cs

示例4: ResolveImages

        /// <summary>
        /// Get attached images in status. <para />
        /// Returns tuples of (original_uri, image_uri).
        /// </summary>
        /// <param name="status"></param>
        /// <returns></returns>
        public static IEnumerable<Tuple<Uri, Uri>> ResolveImages(TwitterStatus status)
        {
            var result = new List<Tuple<string, string>>();

            // pick attached images 
            status.Entities.Guard()
                  .Where(e => e.EntityType == EntityType.Media)
                  .ForEach(e => result.Add(Tuple.Create(e.OriginalUrl, e.MediaUrl)));

            // resolve url in status text
            var matches = UrlRegex.Matches(status.GetEntityAidedText(EntityDisplayMode.MediaUri)).Cast<Match>();
            matches.Select(m => m.Value).ForEach(s =>
            {
                if (SupportedExtents.Any(ext => s.EndsWith("." + ext)))
                {
                    result.Add(Tuple.Create(s, s));
                }
                else
                {
                    var key = ResolveTable.Keys.FirstOrDefault(s.StartsWith);
                    Func<string, string> resolver;
                    if (key != null && ResolveTable.TryGetValue(key, out resolver))
                    {
                        result.Add(Tuple.Create(s, resolver(s)));
                    }
                }
            });

            return result.Distinct(t => t.Item2)
                         .Where(t => Uri.IsWellFormedUriString(t.Item1, UriKind.Absolute) &&
                                     Uri.IsWellFormedUriString(t.Item2, UriKind.Absolute))
                         .Select(t => Tuple.Create(new Uri(t.Item1), new Uri(t.Item2)));
        }
开发者ID:ktoku89,项目名称:StarryEyes,代码行数:39,代码来源:ImageResolver.cs

示例5: StatusModel

 private StatusModel(TwitterStatus status)
 {
     this.Status = status;
     ImageResolver.Resolve(status.GetEntityAidedText(true))
                  .Aggregate(new List<Tuple<Uri, Uri>>(), (l, i) =>
                  {
                      l.Add(i);
                      return l;
                  })
                  .Finally(() =>
                  {
                      var subj = Interlocked.Exchange(ref this._imagesSubject, null);
                      lock (subj)
                      {
                          subj.OnCompleted();
                          subj.Dispose();
                      }
                  })
                  .Subscribe(l => this.Images = l);
 }
开发者ID:hosiminn,项目名称:StarryEyes,代码行数:20,代码来源:StatusModel.cs


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