Ejemplo 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;
        }
Ejemplo n.º 2
0
        public static SearchObject CreateSearchObject()
        {
            SearchWindow fenetre = new SearchWindow();
            fenetre.ShowDialog();

            if (fenetre.SearchItems.Count == 0)
            {
                return null;
            }

            SearchObject so = new SearchObject();
            foreach(string key in fenetre.SearchItems.Keys)
            {
                so.AddSearchTerm(key, fenetre.SearchItems[key]);
            }

            return so;
        }
Ejemplo n.º 3
0
 public List<Music> Search(SearchObject so)
 {
     List<Music> ListResult = new List<Music>();
     foreach(LibraryObject libObj in MasterList)
     {
         ListResult.AddRange(libObj.Search(so));
     }
     return ListResult;
 }
Ejemplo n.º 4
0
 public List<Music> Search(SearchObject so)
 {
     if (so.Compare(this))
         return new List<Music> { this };
     else return new List<Music>();
 }