public static Configuration GetConfiguration() { Configuration config = new Configuration("Configuration"); var soundList = DataBaseService.Current.Db.Table<SoundInfo>().ToList(); int maxId = -1; foreach (SoundInfo sound in soundList) { Player p = new Player(new Uri(sound.Uri, UriKind.Relative)); config._mappings.Add(sound.Id, p); config._soundsInfo.Add(sound); if (sound.Id > maxId) { maxId = sound.Id; } } SoundService.Current.SetLastSoundId(maxId + 1); return config; }
private void LoadConfiguration() { Configuration.CheckNewSoundInConfig(XDocument.Load("Configuration.xml").Root.Elements().First()); _config = Configuration.GetConfiguration(); }