Example #1
0
        //============================================================================
        //! OKボタンが押された
        private void _ClickOKButton(object iSender, RoutedEventArgs iArgs)
        {
            //チェック
            var tweet = TweetTextBox.Text.Trim();

            if (tweet.Length == 0)
            {
                System.Media.SystemSounds.Hand.Play();
                MessageBox.Show("ツイートが入力されて居ません", "エラー", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            tweet += "\n\n#FCあどみぃ!";

            //ツイート
            try
            {
                var manager = SystemManager.GetInstance();
                var service = new TweetSharp.TwitterService(manager.GetTwitterAPICKey(), manager.GetTwitterAPICSecret());
                var info    = manager.GetSystemInfo();
                service.AuthenticateWith(info.mAccessToken.mToken, info.mAccessToken.mTokenSecret);
                var responce = service.SendTweet(new TweetSharp.SendTweetOptions {
                    Status = tweet
                });

                System.Media.SystemSounds.Asterisk.Play();
                MessageBox.Show("ツイートに成功しました!", "確認", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            catch (System.Exception iException)
            {
                SystemUtility.DisplayErrorDialog("ツイートに失敗しました\n\n" + iException.Message);
            }

            Close();
        }
Example #2
0
 public void SendTwitterMessage(string message)
 {
     TweetSharp.TwitterService service = new TweetSharp.TwitterService(Constants.App_ConsumerKey, Constants.App_ConsumerSecret);
     service.AuthenticateWith(Constants.accessToken, Constants.tokenSecret);
     service.SendTweet(new TweetSharp.SendTweetOptions {
         Status = message
     });
 }
Example #3
0
 public void SendTwitterMessage(string message)
 {
     TweetSharp.TwitterService service = new TweetSharp.TwitterService(Constants.App_ConsumerKey, Constants.App_ConsumerSecret);
     service.AuthenticateWith(Constants.accessToken, Constants.tokenSecret);
     service.SendTweet(new TweetSharp.SendTweetOptions { Status = message});
 }