private void buttonFinish_Click(object sender, RoutedEventArgs e)
        {
            AuthSuccessEventArgs eventArgs = new AuthSuccessEventArgs();

            eventArgs.verifyKey    = textBoxOauthPIN.Text.Trim();
            eventArgs.requestToken = requestToken;
            AuthSuccess(this, eventArgs);
            Close();
        }
Exemplo n.º 2
0
        // Consume the success event when the token is retrieved.  --Kris
        public static void C_AuthSuccess(object sender, AuthSuccessEventArgs e)
        {
            Console.Clear();

            Console.WriteLine("Token retrieval successful!");

            Console.WriteLine();

            Console.WriteLine("Access Token: " + e.AccessToken);
            Console.WriteLine("Refresh Token: " + e.RefreshToken);

            Console.WriteLine();

            Console.WriteLine("Press any key to exit....");
        }
Exemplo n.º 3
0
        private async void AuthSuccessEventHandler(object sender, AuthSuccessEventArgs e)
        {
            if (UseDummyNetwork)
            {
                await Launcher.Windows.MainWindow.ShowMainPageAsync().ConfigureAwait(false);

                FriendListManager.Instance.PopulateTestFriends();
                return;
            }

            _overmindSession = new OvermindSession();
            _overmindSession.DisconnectedEvent += DisconnectEventHandler;
            _overmindSession.ErrorEvent        += ErrorEventHandler;
            await _overmindSession.ConnectAsync(ConfigurationManager.AppSettings["overmindHost"], Convert.ToInt32(ConfigurationManager.AppSettings["overmindPort"])).ConfigureAwait(false);

            await Sessions.AddAsync(_overmindSession).ConfigureAwait(false);

            _chatSession = new ChatSession();
            _chatSession.DisconnectedEvent += DisconnectEventHandler;
            _chatSession.ErrorEvent        += ErrorEventHandler;
            await _chatSession.ConnectAsync(ConfigurationManager.AppSettings["chatHost"], Convert.ToInt32(ConfigurationManager.AppSettings["chatPort"])).ConfigureAwait(false);

            await Sessions.AddAsync(_chatSession).ConfigureAwait(false);
        }