public override void LoadFinished()
 {
     base.LoadFinished();
     foreach (Track t in Playlist.Tracks)
     {
         var listViewItem = new Spider.CListView.CListViewItem(t.Name);
         listViewItem.Spawn = this.Spider.Sections["overview"].ListView;
         t.Item = listViewItem;
         t.Item.Track = t;
         this.Spider.Sections["overview"].ListView.AddItem(listViewItem);
     }
 }
Exemple #2
0
 public void Render()
 {
     this.ListView.Items.Clear();
     foreach (Track t in Playlist.Tracks)
     {
         var listViewItem = new Spider.CListView.CListViewItem(t.Name);
         listViewItem.Spawn = this.Spider.Sections["overview"].ListView;
         t.Item = listViewItem;
         t.Item.Track = t;
         this.Spider.Sections["overview"].ListView.AddItem(listViewItem);
     }
     te = new System.Windows.Forms.Timer();
 }
        public override void LoadFinished()
        {
            switch ((string)((string[])Arguments)[0])
            {
                case "home":
                    {
                    }
                    break;
                case "toplist":
                    {
                        try
                        {
                            foreach (Track t in ((TopList)currentResource).TopTracks)
                            {
                                Spider.CListView.CListViewItem item = new Spider.CListView.CListViewItem("");
                                item.Track = t;
                                this.Spider.Sections["toplist"].ListView.Items.Add(item);
                            }
                        }
                        catch (Exception e)
                        {
                        }

                    }
                    break;
                case "playqueue":
                    {
                        if (currentResource != null)
                        {
                            this.Spider.Sections["playqueue"].ListView.Items.Clear();
                            foreach (Track t in (currentResource as PlayQueue).Queue)
                            {

                                Spider.CListView.CListViewItem listViewItem = new Spider.CListView.CListViewItem(t.Name);
                                listViewItem.Spawn = this.Spider.Sections["playqueue"].ListView;
                                t.Item = listViewItem;
                                t.Item.Track = t;

                                this.Spider.Sections["playqueue"].ListView.Items.Add(listViewItem);
                            }
                            this.Spider.Sections["history"].ListView.Items.Clear();
                            foreach (Track t in (currentResource as PlayQueue).History)
                            {

                                Spider.CListView.CListViewItem listViewItem = new Spider.CListView.CListViewItem(t.Name);
                                listViewItem.Spawn = this.Spider.Sections["history"].ListView;
                                t.Item = listViewItem;
                                t.Item.Track = t;

                                this.Spider.Sections["history"].ListView.Items.Add(listViewItem);
                            }
                        }
                    }
                    break;
                case "history":
                   {
                       if (currentResource != null)
                       {
                           this.Spider.Sections["history"].ListView.Items.Clear();
                           foreach (Track t in (currentResource as TrackCollection))
                           {

                               Spider.CListView.CListViewItem listViewItem = new Spider.CListView.CListViewItem(t.Name);
                               listViewItem.Spawn = this.Spider.Sections["history"].ListView;
                               t.Item = listViewItem;
                               t.Item.Track = t;

                               this.Spider.Sections["history"].ListView.Items.Add(listViewItem);
                           }
                       }
                   }

                   break;
                case "own":
                   {
                       foreach (Track t in ((TrackCollection)currentResource).Items)
                       {
                           Spider.CListView.CListViewItem item = new Spider.CListView.CListViewItem("");
                           item.Track = t;
                           t.Item = item;
                           try
                           {
                               item.Spawn = this.Spider.Sections["own"].ListView;
                               t.LoadAsync(null);
                               this.Spider.Sections["own"].ListView.Items.Add(item);
                           }
                           catch (Exception e)
                           {
                           }

                       }
                   }
                   break;
            }
        }