void PopulateDvbCombo(ComboBox combo, DvbTuningInfoPropertyGetter property_getter) { combo.Items.Clear(); foreach (int property_value in GetLineupDvbPropertyValues(SelectedLineup, property_getter)) { combo.Items.Add(property_value); } }
private static List<int> GetLineupDvbPropertyValues(Lineup lineup, DvbTuningInfoPropertyGetter property_getter) { List<int> values = new List<int>(); foreach (Channel ch in lineup.GetChannels()) if (ch.TuningInfos != null) foreach (TuningInfo ti in ch.TuningInfos) if (ti is DvbTuningInfo) values.Add(property_getter((DvbTuningInfo)ti)); values = values.Distinct().ToList(); values.Sort(); return values; }
static private List <int> GetLineupDvbPropertyValues(Lineup lineup, DvbTuningInfoPropertyGetter property_getter) { List <int> values = new List <int>(); foreach (Channel ch in lineup.GetChannels()) { if (ch.TuningInfos != null) { foreach (TuningInfo ti in ch.TuningInfos) { if (ti is DvbTuningInfo) { values.Add(property_getter((DvbTuningInfo)ti)); } } } } values = values.Distinct().ToList(); values.Sort(); return(values); }
void PopulateDvbCombo(ComboBox combo, DvbTuningInfoPropertyGetter property_getter) { combo.Items.Clear(); foreach (int property_value in GetLineupDvbPropertyValues(SelectedLineup, property_getter)) combo.Items.Add(property_value); }