Пример #1
0
        private void Twitter_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            //throw new NotImplementedException();
            if (e.Error != null)
            {
                MessageBox.Show("Usuario inexistente.");
                return;
            }

            XElement xmlTweets = XElement.Parse(e.Result);

            if (xmlTweets.IsEmpty)
            {
                MessageBox.Show("El usuario no ha escrito nuevos tweets.");
            }
            listbox.ItemsSource = from Tweet in xmlTweets.Descendants("status")
                                  select new TwitterItem
            {
                imageSource = Tweet.Element("user").Element("profile_image_url").Value,
                username    = Tweet.Element("user").Element("name").Value,
                tuit        = Tweet.Element("text").Value,
                created_at  = Tweet.Element("created_at").Value
            };
        }