private void AddAccountButton_Click(object sender, EventArgs e) { using (var d = new AddAccountDialog()) { if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var a = new UserAccount(d.ConsumerKey, d.ConsumerSecret, d.AccessToken, d.AccessTokenSecret, 0, null, null); RefreshAccount(a); UserAccounts.Add(a); } } }
private void StartAuthButton_Click(object sender, EventArgs e) { var consumerKey = ApplicationSettings.TwitterConsumerKey; var consumerSecret = ApplicationSettings.TwitterConsumerSecret; using (var d = new AddAccountDialog(true)) { if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (!string.IsNullOrEmpty(d.ConsumerKey) && !string.IsNullOrEmpty(d.ConsumerSecret)) { consumerKey = d.ConsumerKey; consumerSecret = d.ConsumerSecret; } } } var auth = new Twitter(consumerKey, consumerSecret); var authUrl = PrepareAuth(auth); if (authUrl != null) { var pin = AuthDialog.DoAuth(this, authUrl); if (pin != null) { if (PinAuth(auth, pin)) { CalcApiUsing(); } } } }