本文整理汇总了C#中IUserSession.GetMyListsUserIsMemberOf方法的典型用法代码示例。如果您正苦于以下问题:C# IUserSession.GetMyListsUserIsMemberOf方法的具体用法?C# IUserSession.GetMyListsUserIsMemberOf怎么用?C# IUserSession.GetMyListsUserIsMemberOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUserSession
的用法示例。
在下文中一共展示了IUserSession.GetMyListsUserIsMemberOf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoListsTest
public async Task<bool> DoListsTest(IUserSession session, List<int> testSeq)
{
var successStatus = true;
var twList = new TwitterList();
try
{
// 1
if (testSeq.Contains(1))
{
ConsoleOutput.PrintMessage("10.1 Lists\\GetLists", ConsoleColor.Gray);
var lists1 = await session.GetLists(screenName:"NickHodgeMSFT");
if (lists1.OK)
{
foreach (var lst in lists1)
{
ConsoleOutput.PrintMessage(
String.Format("ID: {5} // Slug: {0} // Name: {1} // {2} // {3} // {4}", lst.Slug, lst.Name, lst.CreatedTime,lst.MemberCount,lst.Mode,lst.Id));
twList = lst;
}
}
else
{
TwitterLiveFireUserAuth.PrintTwitterErrors(lists1.twitterControlMessage);
successStatus = false;
}
}
// 2
if (testSeq.Contains(2))
{
ConsoleOutput.PrintMessage("10.2 Lists\\GetListTimeline", ConsoleColor.Gray);
var lists2 = await session.GetListTimeline(listId: twList.Id, slug:twList.Slug);
if (lists2.OK)
{
foreach (var tweet in lists2)
{
ConsoleOutput.PrintMessage(
String.Format("From: {0} // Message: {1}", tweet.User.ScreenName, tweet.Text));
}
}
else
{
TwitterLiveFireUserAuth.PrintTwitterErrors(lists2.twitterControlMessage);
successStatus = false;
}
}
// 3
if (testSeq.Contains(3))
{
ConsoleOutput.PrintMessage("10.3 Lists\\GetMyListsUserIsMemberOf - Cursored", ConsoleColor.Gray);
long nextcursor = -1;
var listCount = 0;
do
{
var lists3 =
await session.GetMyListsUserIsMemberOf(screenName: "shiftkey", cursor: nextcursor);
if (lists3.twitterFaulted)
{
TwitterLiveFireUserAuth.PrintTwitterErrors(lists3.twitterControlMessage);
successStatus = false;
break;
}
nextcursor = lists3.next_cursor;
ConsoleOutput.PrintMessage(String.Format("Previous cursor: {0} Next cursor: {1}",
lists3.previous_cursor, lists3.next_cursor), ConsoleColor.Magenta);
foreach (var lst in lists3.lists)
{
listCount++;
ConsoleOutput.PrintMessage(
String.Format("ID: {5} // Slug: {0} // Name: {1} // {2} // {3} // {4}", lst.Slug, lst.Name, lst.CreatedTime, lst.MemberCount, lst.Mode, lst.Id));
}
} while (nextcursor != 0);
ConsoleOutput.PrintMessage(String.Format("List Membership Count: {0}",
listCount));
}
// 4
if (testSeq.Contains(4))
{
ConsoleOutput.PrintMessage("10.4 Lists\\GetMembersOnList - Cursored", ConsoleColor.Gray);
long nextcursor = -1;
do
{
var lists4 =
await session.GetMembersOnList(listId: 52908745, slug: "autechheads", ownerId: 800364, ownerScreenName: "NickHodgeMSFT", cursor: nextcursor);
if (lists4.twitterFaulted)
{
successStatus = false;
TwitterLiveFireUserAuth.PrintTwitterErrors(lists4.twitterControlMessage);
//.........这里部分代码省略.........