public void SetUp() { _ns = TweetConverter.NS; _twitterXml = XDocument.Parse( @"<?xml version='1.0' encoding='utf-16'?> <feed xmlns:google='http://base.google.com/ns/1.0' xml:lang='en-US' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns='http://www.w3.org/2005/Atom' xmlns:twitter='http://api.twitter.com/'> <entry> <id>tag:search.twitter.com,2005:11888749530</id> <published>2010-04-09T16:22:00Z</published> <link type='text/html' href='http://twitter.com/lcorneliussen/statuses/11888749530' rel='alternate' /> <title>content from first tweet</title> <updated>2010-04-09T16:22:00Z</updated> <link type='image/png' href='http://twitter.com/user1.jpg' rel='image' /> <author> <name>first twitter user</name> <uri>http://twitter.com/user1</uri> </author> </entry> <entry> <id>tag:search.twitter.com,2005:11882613726</id> <published>2010-04-09T14:15:00Z</published> <link type='text/html' href='http://twitter.com/anoras/statuses/11882613726' rel='alternate' /> <title>content from second tweet</title> <updated>2010-04-09T14:15:00Z</updated> <link type='image/png' href='http://twitter.com/user2.jpg' rel='image' /> <author> <name>second twitter user</name> <uri>http://twitter.com/user2</uri> </author> </entry> </feed>"); var tweetXml = _twitterXml.Descendants(_ns + "entry").First(); _firstTweet = TweetConverter.FromXml(tweetXml); }
private void GetImage(TweetCellController controller, Tweet tweet) { controller.ImageView.Alpha = 0.0f; if (!string.IsNullOrEmpty(tweet.AuthorImageUrl)) { if (_images.ContainsKey(tweet.AuthorImageUrl)) { UIImage imageThumbnail = _images[tweet.AuthorImageUrl]; controller.ImageView.Image = imageThumbnail; controller.ImageView.Alpha = 1.0f; } else { controller.AuthorImageUrl = tweet.AuthorImageUrl; ThreadPool.QueueUserWorkItem(RequestImage, controller); } } }