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); } }
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; }