Пример #1
0
 private void ShareTweetAction(TweetViewModel tweet)
 {
     if (tweet != null)
     {
         MessageBox.Show(string.Format("share tweet: {0}", tweet.Title));
     }
 }
Пример #2
0
 private void WeblientTwitter_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
 {
     XElement _xml;
     System.Globalization.CultureInfo provider = System.Globalization.CultureInfo.InvariantCulture;
     try
     {
         if (!e.Cancelled)
         {
             _xml = XElement.Parse(e.Result);
             foreach (XElement value in _xml.Elements("status"))
             {
                 TweetViewModel _tweet = new TweetViewModel();
                 _tweet.Avatar = value.Element("user").Element("profile_image_url").Value;
                 _tweet.Title = value.Element("text").Value;
                 _tweet.Published = DateTime.ParseExact(value.Element("created_at").Value, "ddd MMM dd HH:mm:ss zzzzz yyyy", provider);
                 _tweet.Author = value.Element("user").Element("screen_name").Value;
                 TwitterFeed.Add(_tweet);
             }
         }
     }
     catch
     {
         // todo catch exception
     }
 }