private void OkButton_Click(object sender, EventArgs e) { TwitterConnection twitterConnection = new TwitterConnection(); twitterConnection.ConsumerKey = consumerKeyTextBox.Text; twitterConnection.ConsumerSecret = consumerSecretTextBox.Text; twitterConnection.UserAccessToken = userAccessTokenTextBox.Text; twitterConnection.UserAccessSecret = userAccessSecretTextBox.Text; try { twitterConnection.Connect(); if (RememberCheckBox.Checked) { twitterConnection.SaveCredentialsToReqistry(); } else { twitterConnection.ResetCredentialsToReqistry(); } this.DialogResult = DialogResult.OK; } catch (Exception ex) { MessageBox.Show("Wrong Credentials Or Connection Error :-(" + Environment.NewLine + ex.ToString()); } }
private void MainForm_Load(object sender, EventArgs e) { DisableStandardToolbar(); try { Dac dac = new Dac(); dac.LoadDatabaseFileLocationFromReqistry(); DatabaseFileLocationToolStripStatusLabel.Text = "Database : " + Dac.Current.DatabaseFileLocation; } catch { DatabaseFileLocationToolStripStatusLabel.Text = "Database Connection Error !!!"; } try { TwitterConnection twitterConnection = new TwitterConnection(); twitterConnection.LoadCredentialsFromReqistry(); twitterConnection.Connect(); TwitterUserToolStripStatusLabel.Text = "Twitter User : "******"Twitter Connection Error !!!"; } }
private void TestButton_Click(object sender, EventArgs e) { TwitterConnection twitterConnection = new TwitterConnection(); twitterConnection.ConsumerKey = consumerKeyTextBox.Text; twitterConnection.ConsumerSecret = consumerSecretTextBox.Text; twitterConnection.UserAccessToken = userAccessTokenTextBox.Text; twitterConnection.UserAccessSecret = userAccessSecretTextBox.Text; try { twitterConnection.Connect(); MessageBox.Show("Connection Ok :-)" + Environment.NewLine + "User : "******"Connection Error :-(" + Environment.NewLine + ex.ToString()); } }