示例#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;
        }
示例#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;
        }
示例#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;
 }
示例#4
0
 public List<Music> Search(SearchObject so)
 {
     if (so.Compare(this))
         return new List<Music> { this };
     else return new List<Music>();
 }