Exemplo n.º 1
0
        private void PopulateGenreTree()
        {
            GenreTreeController.Clear();
            GenreTree.Clear();

            foreach (Genre genre in m_DataModel.Database.Genres.Values)
            {
                HierarchicalLibraryItem genreNode = new HierarchicalLibraryItem(genre, GenreTreeController);
                GenreTree.Add(genreNode);

                foreach (LibraryItem album in m_DataModel.Database.Expand(genre))
                {
                    HierarchicalLibraryItem albumNode = new HierarchicalLibraryItem(album, genreNode);

                    foreach (LibraryItem song in m_DataModel.Database.Expand(album))
                    {
                        new HierarchicalLibraryItem(song, albumNode);
                    }
                }
            }

            GenreTreeController.ResetNodeIds();
        }
Exemplo n.º 2
0
        private void PopulateArtistTree()
        {
            ArtistTreeController.Clear();
            ArtistTree.Clear();

            foreach (Artist artist in m_DataModel.Database.Artists.Values)
            {
                HierarchicalLibraryItem artistNode = new HierarchicalLibraryItem(artist, ArtistTreeController);
                ArtistTree.Add(artistNode);

                foreach (LibraryItem album in m_DataModel.Database.Expand(artist))
                {
                    HierarchicalLibraryItem albumNode = new HierarchicalLibraryItem(album, artistNode);

                    foreach (LibraryItem song in m_DataModel.Database.Expand(album))
                    {
                        new HierarchicalLibraryItem(song, albumNode);
                    }
                }
            }

            ArtistTreeController.ResetNodeIds();
        }