Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void postTweet()
- {
- IsolatedStorageSettings mysetting = IsolatedStorageSettings.ApplicationSettings;
- try
- {
- mysetting.TryGetValue("twitter_token", out value);
- mysetting.TryGetValue("twitter_tokensecret", out value2);
- }
- catch
- {
- }
- if (value == null)
- {
- NavigationService.Navigate(new Uri("/TwitterAuthPage.xaml", UriKind.Relative));
- }
- else
- {
- service = new TwitterService("consumerkey", "consumersecret", value, value2);
- service.SendTweet(new SendTweetOptions { Status = "Testing..." },
- (statuses, response) =>
- {
- if (response.StatusCode == HttpStatusCode.OK)
- {
- dispatcher.BeginInvoke(() =>
- {
- MessageBox.Show("Tweet sent!");
- }
- );
- }
- else
- {
- throw new Exception(response.StatusCode.ToString());
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement