當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。