Exemplo n.º 1
0
        public static Library SearchInLibrary(Library library, SearchObject so)
        {
            Library newLibrary = new Library("Résultats - " + DateTime.Now.ToString());

            if (so != null)
            {
                List<Music> musics = library.Search(so);

                foreach (Music music in musics)
                    newLibrary.AddLibraryObject(music);
            }

            return newLibrary;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Genere la librairie pour son affichage dans la boite mainLib
        /// </summary>
        /// <param name="actualLibrary"></param>
        /// <returns></returns>
        public TreeNode Generate_Library(Library actualLibrary)
        {
            TreeNode treeNode = new TreeNode();

            foreach (LibraryObject objet in actualLibrary.MasterList)
            {
                if (objet is Library)
                {
                    treeNode.Nodes.Add(Generate_Library((Library)objet));
                    treeNode.LastNode.Text = ((Library)(objet)).name;
                    treeNode.LastNode.Tag = (Library)objet;
                }
                else if (objet is Music)
                {
                    treeNode.Nodes.Add(((Music)(objet)).GetPath());
                    treeNode.LastNode.Text = ((Music)(objet)).GetPath();
                    treeNode.LastNode.Tag = (Music)objet;
                }
            }

            return treeNode;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Premier chargement du logiciel
 /// </summary>
 public TreeNode load_init_interface()
 {
     mainLibrary = new Library("MainLibrary");
     return Generate_Library(mainLibrary);
 }