Beispiel #1
0
        private void button7_Click(object sender, EventArgs e)
        {
            if (Settings1.Default.bitlyUser.Length == 0 || Settings1.Default.bitlyAPI.Length == 0)
            {
                DialogResult dlgResult = MessageBox.Show("The Bit.ly API settings were not provided, would you like to enter them now?", "Confirmation", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

                if (dlgResult == DialogResult.Yes)
                {
                    bitly mybit = new bitly(); // Open the Biy.ly API Settings dialog
                    mybit.ShowDialog();

                    link mylink = new link(); // Open the Insert Link Dialog
                    mylink.ShowDialog();

                    try
                    {
                        tweetText.AppendText(urlShortner()); //Append the shortened link in the text box
                    }
                    catch (Exception ex)
                    {

                    }

                }

                else if (dlgResult == DialogResult.No)
                {
                    link mylink = new link(); // Open the Insert link dialog box
                    mylink.ShowDialog();

                    tweetText.AppendText(Settings1.Default.link); // Append the link in the text box
                }

                else
                {
                    // Do nothing
                }

            }
            else
            {
                link mylink = new link(); // Open the Insert Link Dialog
                mylink.ShowDialog();

                if (Settings1.Default.link.Length != 0)
                    tweetText.AppendText(urlShortner());
            }
        }
Beispiel #2
0
 private void button11_Click(object sender, EventArgs e)
 {
     bitly mybit = new bitly();
     mybit.ShowDialog();
 }