private void button_del_iepg_Click(object sender, RoutedEventArgs e) { if (listBox_iEPG.SelectedItem != null) { IEPGStationInfo item = listBox_iEPG.SelectedItem as IEPGStationInfo; stationList.Remove(item); ReLoadStation(); } }
private void button_add_iepg_Click(object sender, RoutedEventArgs e) { if (listBox_service.SelectedItem != null) { ServiceViewItem item = listBox_service.SelectedItem as ServiceViewItem; foreach (IEPGStationInfo info in stationList) { if (String.Compare(info.StationName, textBox_station.Text) == 0) { MessageBox.Show("すでに登録済みです"); return; } } IEPGStationInfo addItem = new IEPGStationInfo(); addItem.StationName = textBox_station.Text; addItem.Key = item.Key; stationList.Add(addItem); ReLoadStation(); } }
private void button_add_iepg_Click(object sender, RoutedEventArgs e) { if (listBox_service.SelectedItem != null) { ServiceViewItem item = listBox_service.SelectedItem as ServiceViewItem; foreach (IEPGStationInfo info in ((Settings)DataContext).IEpgStationList) { if (string.Compare(info.StationName, textBox_station.Text, new System.Globalization.CultureInfo("ja-JP"), System.Globalization.CompareOptions.IgnoreWidth | System.Globalization.CompareOptions.IgnoreCase) == 0) { MessageBox.Show("すでに登録済みです"); return; } } IEPGStationInfo addItem = new IEPGStationInfo(); addItem.StationName = textBox_station.Text; addItem.Key = item.Key; ((Settings)DataContext).IEpgStationList.Add(addItem); ReLoadStation(); } }