public static int ReadPlayListSectionCount() { var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); PlayListSection configSection = (PlayListSection)config.GetSection("PlayListSection"); return(configSection.KeyValues.Count); }
public static PlayListSection.TheKeyValue ReadPlayListSection(string key) { var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); PlayListSection configSection = (PlayListSection)config.GetSection("PlayListSection"); var value = (from kv in configSection.KeyValues.Cast <PlayListSection.TheKeyValue>() where kv.Key == key select kv).FirstOrDefault(); return(value); }