コード例 #1
0
        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());
            }
        }
コード例 #2
0
        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 !!!";
            }
        }
コード例 #3
0
        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());
            }
        }