本文整理汇总了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()));
}
示例2: Instance_OnStatusReceived
static void Instance_OnStatusReceived(TwitterStatus obj)
{
Show(new NormalNotificatorViewModel(MetroColors.Cyan,
obj.User, "@" + obj.User.ScreenName, obj.GetEntityAidedText()));
}
示例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);
}
示例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)));
}
示例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);
}