本文整理汇总了C#中LinqToTwitter.List.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# List.Contains方法的具体用法?C# List.Contains怎么用?C# List.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinqToTwitter.List
的用法示例。
在下文中一共展示了List.Contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueryAccountsFromCache
private List<Domain.Model.Account> QueryAccountsFromCache(List<string> Ids)
{
return (from x in this.accountCache
where Ids.Contains(x.Key)
select (Domain.Model.Account)x.Value).ToList();
}
示例2: GetTweets
private List<ITweet> GetTweets(string screenname, bool includeRelevantScreenNames, List<ulong> excludeStatusIDs = null)
{
List<string> screenNames = null;
var user = UsersCollection.Single(screenname);
if (includeRelevantScreenNames)
screenNames = GetRelevantScreenNames(screenname);
else
screenNames = new List<string> { screenname.ToLower() };
int RetweetThreshold = UsersCollection.PrimaryUser().RetweetThreshold;
Expression<Func<Tweet, bool>> where = t =>
//If there are any IDs we want to filter out
(excludeStatusIDs == null || !excludeStatusIDs.Contains(t.StatusID)) &&
//Should everything be displayed or do you only want content
(user.OnlyTweetsWithLinks == false || (t.Links != null && t.Links.Count > 0)) &&
//Minumum threshold applied so we get results worth seeing (if it is your own tweet it gets a pass on this step)
((t.RetweetCount >= RetweetThreshold /*&& t.CreatedAt > DateTime.Now.AddHours(-48)*/) || t.User.Identifier.ScreenName.ToLower() == screenname.ToLower());
var tweets = screenNames
//For each screen name (i.e. - you and your friends if included) select the most recent tweets
.SelectMany(x => Repository<Tweet>.Instance.Query(x + TWEETS, limit: Repository<Tweet>.Limit.Limit100, where: where) ?? new List<Tweet>())
//Order all tweets based on rank
.OrderByDescending(t => t.TweetRank)
.Distinct(Tweet.GetTweetTextComparer())
.ToList();
if(!string.IsNullOrEmpty(UsersCollection.PrimaryUser().Track))
tweets.AddRange(Repository<Tweet>.Instance.Query(TRACKER + TWEETS, limit: Repository<Tweet>.Limit.Limit1000, where: where) ?? new List<Tweet>());
return tweets.Cast<ITweet>().ToList();
}