当前位置: 首页>>代码示例>>C#>>正文


C# IUserSession.GetConfiguration方法代码示例

本文整理汇总了C#中IUserSession.GetConfiguration方法的典型用法代码示例。如果您正苦于以下问题:C# IUserSession.GetConfiguration方法的具体用法?C# IUserSession.GetConfiguration怎么用?C# IUserSession.GetConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IUserSession的用法示例。


在下文中一共展示了IUserSession.GetConfiguration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoUserAccountTest


//.........这里部分代码省略.........
                    if (deleteUserBlock.OK)
                        ConsoleOutput.PrintMessage(String.Format("ScreenName: {0}", deleteUserBlock.ScreenName));
                    else
                        successStatus = false;
                }
                // 7
                if (testSeq.Contains(7))
                {
                    ConsoleOutput.PrintMessage("1.7 UsersExtensions\\GetUsersDetailsFull From Screennames ",
                        ConsoleColor.Gray);
                    var screennames = new List<string> {"shiftkey", "katyperry"};
                    var getUserDetailsFullFromScreenNames = await session.GetUsersDetailsFull(screenNames: screennames);
                    if (getUserDetailsFullFromScreenNames.OK)
                    {
                        ConsoleOutput.PrintMessage(String.Format("Returned: {0}",
                            getUserDetailsFullFromScreenNames.Count()));
                        foreach (var u in getUserDetailsFullFromScreenNames)
                        {
                            ConsoleOutput.PrintMessage(String.Format("User ID: {1} // ScreenName: {0} // Description: {2}",
                                u.Name, u.UserId, u.Description));
                        }
                    }
                    else
                        successStatus = false;
                }
                // 8
                if (testSeq.Contains(8))
                {
                    ConsoleOutput.PrintMessage("1.8 UsersExtensions\\GetUsersDetailsFull From IDs", ConsoleColor.Gray);
                    var usersids = new List<long> { 21447363, 14671135, 4503599627370241};
                    var getUserDetailsFullFromIDs = await session.GetUsersDetailsFull(userIds: usersids);
                    if (getUserDetailsFullFromIDs.OK)
                    {
                        ConsoleOutput.PrintMessage(String.Format("Returned: {0}", getUserDetailsFullFromIDs.Count()));
                        foreach (var u in getUserDetailsFullFromIDs)
                        {
                            ConsoleOutput.PrintMessage(String.Format(
                                "ScreenName: {0} User ID: {1} Description: {2}",
                                u.Name, u.UserId, u.Description));
                        }
                    }
                    else
                        successStatus = false;
                }
                // 9
                if (testSeq.Contains(9))
                {
                    ConsoleOutput.PrintMessage("1.9 UsersExtensions\\SearchForUsers", ConsoleColor.Gray);
                    var q = "troll";
                    var searchForUsers = await session.SearchForUsers(q, 200, 1);
                    if (searchForUsers.OK)
                    {
                        ConsoleOutput.PrintMessage(String.Format("Returned: {0}", searchForUsers.Count()));
                        foreach (var u in searchForUsers)
                        {
                            ConsoleOutput.PrintMessage(String.Format(
                                "ScreenName: {0} User ID: {1} Description: {2}",
                                u.Name, u.UserId, u.Description));
                        }
                    }
                    else
                        successStatus = false;
                }

                // 10
                if (testSeq.Contains(10))
                {
                    ConsoleOutput.PrintMessage("1.10 Get GetConfiguration", ConsoleColor.Gray);
                    var configUser  = await session.GetConfiguration();
                    if (configUser.OK)
                    {
                        ConsoleOutput.PrintMessage(String.Format("Returned for Max Media Per Upload: {0}", configUser.MaxMediaPerUpload));
                        ConsoleOutput.PrintMessage(String.Format("Returned for Max Chars for DM: {0}", configUser.DirectMessageCharacterLimit));
                    }
                    else
                        successStatus = false;
                }

                // 11
                if (testSeq.Contains(11))
                {
                    ConsoleOutput.PrintMessage("1.11 Start ApplicationOnlyAuth", ConsoleColor.Gray);
                    var getAuthToken = await session.StartApplicationOnlyAuth();
                    if (getAuthToken)
                    {
                        ConsoleOutput.PrintMessage(String.Format("Returned: {0}", getAuthToken));
                    }
                    else
                        successStatus = false;
                }


            }
            catch (Exception e)
            {
                ConsoleOutput.PrintError(e.ToString());
                return false;
            }
            return successStatus;
        }
开发者ID:nickhodge,项目名称:BoxKite.Twitter,代码行数:101,代码来源:01UserAccountLiveFireTests.cs


注:本文中的IUserSession.GetConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。