Example #1
0
 public TrendingTopicItem(TweetList list, string searchString, TrendingTopic trendingTopic)
 {
     _list = list;
     _searchString = searchString;
     TrendingTopic = trendingTopic;
     Value = this.GetType().ToString();
 }
Example #2
0
        private void ShowTrends()
        {
            currentSpecialTimeLine = null;
            ChangeCursor(Cursors.WaitCursor);

            SwitchToList("TrendingTopics");
            HistoryItem i = new HistoryItem();
            i.Action = Yedda.Twitter.ActionType.Favorites;  //TODO
            History.Push(i);
            statList.SetSelectedMenu(ViewFavoritesMenuItem);

            //test = LetsBeTrends.GetTrend("GoodNight");

            statList.Clear();

            ArrayList al = LetsBeTrends.GetCurrentTrends();

            foreach (Hashtable a in al)
            {
                TrendingTopic tt = new TrendingTopic();
                tt.Name = (String)a["name"];
                tt.LastTrended = (String)a["last_trended_at"];
                tt.FirstTrended = (String)a["first_trended_at"];
                tt.Query = (String)a["query"];
                try
                {
                    if (a.Contains("description"))
                    {
                        Hashtable h = (Hashtable)a["description"];
                        tt.Description = (String)h["text"];
                    }
                    else
                    {
                        tt.Description = "No description available.";
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error: " + ex.Message);
                    tt.Description = "No description available.";
                }
                statList.AddItem(new TrendingTopicItem(this, null, tt));
            }
            statList.SelectedItem = statList[0];
            statList.YOffset = 0;
            statList.Redraw();
            statList.RerenderPortal();
            statList.Repaint();

            ChangeCursor(Cursors.Default);
        }