Exemple #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == null)
     {
         return;
     }
     else
     {
         try
         {
             string Tweet = textBox1.Text;
             Client.Tweet(Tweet, false);
             if (Client.Tweeted == true)
             {
                 MessageBox.Show("Tweeted!");
             }
             else
             {
                 MessageBox.Show("Tweet failed!" + e.ToString());
             }
         }
         catch (WebException)
         {
             MessageBox.Show("You already tweeted that!");
         }
     }
 }
Exemple #2
0
        public void Share(int platformId, string text)
        {
            //1 facebook
            //2 twitter
            //3 vk

            if (platformId == 1)
            {
                Facebook.Facebook fb = new Facebook.Facebook();
                fb.Share(text);
            }
            else if (platformId == 2)
            {
                Twitter.Twitter tw = new Twitter.Twitter();
                tw.Tweet(text);
            }
            else if (platformId == 3)
            {
                VK.VK vk = new VK.VK();
                vk.Post(text);
            }
        }
Exemple #3
0
 void IShare.Share(string text)
 {
     _twitter.Tweet(text);
 }