예제 #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();
        }
예제 #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
     });
 }
예제 #3
0
 public static void Setup()
 {
     // Setup the Ioc container
     Ioc.Register <TweetSharp.TwitterService>(() => {
         var service = new TweetSharp.TwitterService(SettingHelper.ConsumerKey, SettingHelper.ConsumerSecret);
         service.AuthenticateWith(SettingHelper.Token, SettingHelper.TokenSecret);
         return(service);
     });
 }
예제 #4
0
파일: Main.cs 프로젝트: hfukada/IRCQwitter
 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});
 }