/// <summary> /// ジャンル1つ追加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button_jyanru_add_Click(object sender, RoutedEventArgs e) { try { if (listBox_jyanru.SelectedItem != null) { ContentKindInfo info = listBox_jyanru.SelectedItem as ContentKindInfo; bool find = false; foreach (ContentKindInfo info2 in listBox_jyanruView.Items) { if (info2.ID == info.ID) { find = true; break; } } if (find == false) { listBox_jyanruView.Items.Add(info); } } else { MessageBox.Show("アイテムが選択されていません"); } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
public void setGenre(ContentKindInfo cki0) { var key = cki0.Data.Key; if (listBox_content.Items.OfType <ContentKindInfo>().Any(item => item.Data.Key == key) == true) { return; } listBox_content.ScrollIntoViewLast(cki0); CheckListBox(listBox_content); }
private void button_content_add_Click(object sender, RoutedEventArgs e) { ContentKindInfo select = (ContentKindInfo)comboBox_content.SelectedItem; if (select != null) { EnableContentListBox(true); if (listBox_content.Items.Contains(select)) { MessageBox.Show("すでに追加されています"); return; } listBox_content.Items.Add(select); } }
private void button_content_add_Click(object sender, RoutedEventArgs e) { if (comboBox_content.SelectedItem != null) { foreach (ContentKindInfo info in listBox_content.Items) { ContentKindInfo select = comboBox_content.SelectedItem as ContentKindInfo; if (select.Nibble1 == info.Nibble1 && select.Nibble2 == info.Nibble2) { MessageBox.Show("すでに追加されています"); return; } } listBox_content.Items.Add(comboBox_content.SelectedItem); } }
public void SetSearchKey(EpgSearchKeyInfo key) { comboBox_andKey.Text = Regex.Replace(key.andKey, @"^(?:\^!\{999\})?(?:C!\{999\})?(?:D!\{1[0-9]{8}\})?", ""); comboBox_notKey.Text = key.notKey; checkBox_regExp.IsChecked = key.regExpFlag != 0; checkBox_aimai.IsChecked = key.aimaiFlag != 0; checkBox_titleOnly.IsChecked = key.titleOnlyFlag != 0; var match = Regex.Match(key.andKey, @"^((?:\^!\{999\})?)((?:C!\{999\})?)((?:D!\{1[0-9]{8}\})?)"); checkBox_keyDisabled.IsChecked = match.Groups[1].Value.Length > 0; checkBox_case.IsChecked = match.Groups[2].Value.Length > 0; uint dur = 0; if (match.Groups[3].Value.Length > 0) { dur = uint.Parse(match.Groups[3].Value.Substring(3, 9)); } textBox_chkDurationMin.Text = (dur / 10000 % 10000).ToString(); textBox_chkDurationMax.Text = (dur % 10000).ToString(); EnableContentListBox(true); listBox_content.Items.Clear(); foreach (EpgContentData item in key.contentList) { ushort contentKey = (ushort)(item.content_nibble_level_1 << 8 | item.content_nibble_level_2); ContentKindInfo info = comboBox_content.Items.Cast <ContentKindInfo>().FirstOrDefault(a => a.ID == contentKey); if (info == null) { //未知のジャンル info = new ContentKindInfo() { Nibble1 = item.content_nibble_level_1, Nibble2 = item.content_nibble_level_2 }; } listBox_content.Items.Add(info); } if (listBox_content.Items.Count == 0) { EnableContentListBox(false); } checkBox_notContent.IsChecked = key.notContetFlag != 0; EnableDateListBox(true); listBox_date.Items.Clear(); foreach (EpgSearchDateInfo info in key.dateList) { listBox_date.Items.Add(new Tuple <string, EpgSearchDateInfo>( (new DateTime(2000, 1, 2 + info.startDayOfWeek % 7, info.startHour % 24, info.startMin % 60, 0)).ToString("ddd HH\\:mm") + (new DateTime(2000, 1, 2 + info.endDayOfWeek % 7, info.endHour % 24, info.endMin % 60, 0)).ToString(" ~ ddd HH\\:mm"), info)); } if (listBox_date.Items.Count == 0) { EnableDateListBox(false); } checkBox_notDate.IsChecked = key.notDateFlag != 0; var keySortedServiceList = new List <long>(key.serviceList); keySortedServiceList.Sort(); ServiceItem firstSelected = null; foreach (ServiceItem info in listView_service.Items) { info.IsSelected = keySortedServiceList.BinarySearch((long)info.ID) >= 0; if (firstSelected == null && info.IsSelected) { firstSelected = info; } } if (firstSelected != null) { listView_service.ScrollIntoView(firstSelected); } comboBox_free.SelectedIndex = key.freeCAFlag % 3; checkBox_chkRecEnd.IsChecked = key.chkRecEnd != 0; textBox_chkRecDay.Text = (key.chkRecDay >= 40000 ? key.chkRecDay % 10000 : key.chkRecDay).ToString(); checkBox_chkRecNoService.IsChecked = key.chkRecDay >= 40000; }