Ejemplo n.º 1
0
        private async void btPinAuth_Click(object sender, RoutedEventArgs e)
        {
            BeamWindow beam = (BeamWindow)Application.Current.MainWindow;

            if (String.IsNullOrEmpty(Properties.Settings.Default.token) || String.IsNullOrEmpty(Properties.Settings.Default.tokenSec))
            {
                try
                {
                    beam.t.AccessTokenGet(beam.t.Token, tbPIN.Text);
                }
                catch
                {
                    MessageBox.Show("Wrong PIN Number!");
                    tbPIN.Text = String.Empty;
                    return;
                }
            }
            else
            {
                beam.t.Token       = Properties.Settings.Default.token;
                beam.t.TokenSecret = Properties.Settings.Default.tokenSec;
            }
            beam.me            = Json.Deserialize <User>(beam.t.oAuthWebRequest(Twitter.Method.GET, "https://api.twitter.com/1.1/account/verify_credentials.json", String.Empty));
            beam.rdMenu.Height = new GridLength(32);
            beam.ChangeView("timeline");
            await beam.startStream();
        }
Ejemplo n.º 2
0
        private void btSignIn_Click(object sender, RoutedEventArgs e)
        {
            BeamWindow beam = (BeamWindow)Application.Current.MainWindow;

            beam.t = new Twitter();
            Uri uri = new Uri(beam.t.AuthorizationLinkGet());

            System.Diagnostics.Process.Start(uri.ToString());
            beam.t.Token = HttpUtility.ParseQueryString(uri.Query)["oauth_token"];
            beam.ChangeView("auth");
        }