예제 #1
0
        private async void LoginButton_Click(object sender, EventArgs e)
        {
            if (accessToken.Length == 0)
            {
                MessageBox.Show("Please get a key first", "Login");
            }
            else
            {
                if (twitchUser == null)
                {
                    try {
                        twitchUser = await twitchClient.RetrieveUserWithAccessToken(accessToken);

                        Status.Text      = "Logged In!";
                        Status.ForeColor = System.Drawing.Color.Green;
                        timer1.Enabled   = true;
                        timer2.Enabled   = true;
                        Start();
                    }
                    catch
                    {
                        MessageBox.Show("Login failed!", "Login");
                    }
                }
                else
                {
                    MessageBox.Show("Already logged in!", "Login");
                }
            }
        }
예제 #2
0
파일: UserTests.cs 프로젝트: Sinfire/Twixel
 public async void RetrieveUserWithAccessToken()
 {
     User twixelTest = await twixel.RetrieveUserWithAccessToken(accessToken);
     Assert.True(twixelTest.authorizedScopes.Contains(TwitchConstants.Scope.UserRead));
 }