Exemple #1
0
 public void LoadDefault()
 {
     XDocument xDoc = XDocument.Parse(Resource.music);
     MusicList.Clear();
     foreach (var e in xDoc.Element("music").Elements("track"))
     {
         Music m = new Music();
         m.LoadFromElement(e);
         MusicList.Add(m);
     }
 }
Exemple #2
0
        public bool LoadMusic(string filename)
        {
            if (!File.Exists(filename)) return false;

            XDocument xDoc = XDocument.Load(filename);
            MusicList.Clear();
            foreach (var e in xDoc.Element("music").Elements("track"))
            {
                Music m = new Music();
                m.LoadFromElement(e);
                MusicList.Add(m);
            }

            return true;
        }