本文整理汇总了C#中LinqToTwitter.List.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# List.Clear方法的具体用法?C# List.Clear怎么用?C# List.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinqToTwitter.List
的用法示例。
在下文中一共展示了List.Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAllFollowersQueryDemo
/// <summary>
/// shows how to query all followers
/// </summary>
/// <remarks>
/// uses the Page property because Twitter doesn't
/// return all followers in a single call; you
/// must page through results until you get all
/// </remarks>
/// <param name="twitterCtx">TwitterContext</param>
private static void GetAllFollowersQueryDemo(TwitterContext twitterCtx)
{
//
// Paging has been deprecated for Friends and Followers
// Please use cursors instead
//
var followerList = new List<User>();
List<User> followers = new List<User>();
int pageNumber = 1;
do
{
followers.Clear();
followers =
(from follower in twitterCtx.User
where follower.Type == UserType.Followers &&
follower.ScreenName == "JoeMayo" &&
follower.Page == pageNumber
select follower)
.ToList();
pageNumber++;
followerList.AddRange(followers);
}
while (followers.Count > 0);
Console.WriteLine("\nFollowers: \n");
foreach (var user in followerList)
{
var status =
user.Protected || user.Status == null ?
"Status Unavailable" :
user.Status.Text;
Console.WriteLine(
"Name: {0}, Last Tweet: {1}\n",
user.Name, status);
}
Console.WriteLine("\nFollower Count: {0}\n", followerList.Count);
}