//============================================================================ //! 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(); }
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 }); }
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); }); }
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}); }