Exemplo n.º 1
0
        private void button_searchKey_Click(object sender, RoutedEventArgs e)
        {
            CustomEpgTabInfo tabInfo = this.GetSetting();

            var dlg = new SetSearchPresetWindow(this);

            dlg.SetSettingMode("検索条件");
            dlg.DataView.SetSearchKey(tabInfo.GetSearchKeyReloadEpg());
            if (dlg.ShowDialog() == true)
            {
                searchKey = dlg.DataView.GetSearchKey();

                //サービスリストは表示順を保持する
                var oldList = listBox_serviceView.Items.OfType <object>().ToList();
                var newList = searchKey.serviceList.Where(sv => servieceList.ContainsKey((ulong)sv) == true).Select(sv => servieceList[(ulong)sv]).ToList();
                listBox_serviceView.UnselectAll();
                listBox_serviceView.Items.RemoveItems(oldList.Where(sv => newList.Contains(sv) == false));
                listBox_serviceView.Items.AddItems(newList.Where(sv => oldList.Contains(sv) == false));

                //ジャンルリストの同期はオプションによる
                if (tabInfo.SearchGenreNoSyncView == false)
                {
                    var items = searchKey.contentList.Select(data => CommonManager.ContentKindInfoForDisplay(data));
                    listBox_jyanruView.Items.Clear();
                    listBox_jyanruView.Items.AddItems(items);
                    checkBox_notContent.IsChecked = searchKey.notContetFlag != 0;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// デフォルト表示の設定値
        /// </summary>
        /// <param name="setInfo"></param>
        public void SetSetting(CustomEpgTabInfo setInfo)
        {
            DataContext = setInfo.DeepClone();
            searchKey   = setInfo.SearchKey.DeepClone();

            textBox_tabName.Text         = setInfo.TabName;
            checkBox_isVisible.IsChecked = setInfo.IsVisible;
            viewModeRadioBtns.Value      = setInfo.ViewMode;

            listBox_serviceView.Items.AddItems(setInfo.ViewServiceList
                                               .Where(id => servieceList.ContainsKey(id) == true).Select(id => servieceList[id]));
            listBox_jyanruView.Items.AddItems(setInfo.ViewContentList.Select(data => CommonManager.ContentKindInfoForDisplay(data)));
        }
Exemplo n.º 3
0
        public void UpdateView(SearchPresetItem pItem)
        {
            try
            {
                EpgSearchKeyInfo key = pItem.Data ?? Settings.Instance.DefSearchKey;
                if (loadingSetting == true || checkBox_setWithoutSearchKeyWord.IsChecked == false)
                {
                    comboBox_andKey.Text = key.andKey;
                    comboBox_notKey.Text = key.notKey;
                }
                checkBox_regExp.IsChecked      = key.regExpFlag == 1;
                checkBox_aimai.IsChecked       = key.aimaiFlag == 1;
                checkBox_titleOnly.IsChecked   = key.titleOnlyFlag == 1;
                checkBox_case.IsChecked        = key.caseFlag == 1;
                checkBox_keyDisabled.IsChecked = key.keyDisabledFlag == 1;

                listBox_content.Items.Clear();
                key.contentList.ForEach(item => listBox_content.Items.Add(CommonManager.ContentKindInfoForDisplay(item)));
                CheckListBox(listBox_content);
                checkBox_notContent.IsChecked = key.notContetFlag == 1;

                listBox_date.Items.Clear();
                key.dateList.ForEach(info => listBox_date.Items.Add(new DateItem(info)));
                CheckListBox(listBox_date);
                checkBox_notDate.IsChecked = key.notDateFlag == 1;

                var serviceKeyHash = new HashSet <long>(key.serviceList);
                serviceList.ForEach(info => info.IsSelected = serviceKeyHash.Contains((long)info.Key));
                Dispatcher.BeginInvoke(new Action(() => listView_service.ScrollIntoView(serviceList.Find(i => i.IsSelected == true))), System.Windows.Threading.DispatcherPriority.Loaded);

                button_dttv_on.IsEnabled  = serviceList.Any(item => item.ServiceInfo.IsDttv == true);
                button_bs_on.IsEnabled    = serviceList.Any(item => item.ServiceInfo.IsBS == true);
                button_cs_on.IsEnabled    = serviceList.Any(item => item.ServiceInfo.IsCS == true);
                button_sp_on.Visibility   = serviceList.Any(item => item.ServiceInfo.IsSPHD == true) ? Visibility.Visible : Visibility.Collapsed;
                button_1seg_on.Visibility = serviceList.Any(item => item.ServiceInfo.PartialFlag == true) ? Visibility.Visible : Visibility.Collapsed;

                comboBox_free.SelectedIndex            = key.freeCAFlag % 3;
                checkBox_chkRecEnd.IsChecked           = key.chkRecEnd == 1;
                textBox_chkRecDay.Text                 = key.chkRecDay.ToString();
                radioButton_chkRecNoService1.IsChecked = key.chkRecNoService == 0;
                radioButton_chkRecNoService2.IsChecked = key.chkRecNoService != 0;
                textBox_chkDurationMin.Text            = key.chkDurationMin.ToString();
                textBox_chkDurationMax.Text            = key.chkDurationMax.ToString();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
            loadingSetting = false;
        }
Exemplo n.º 4
0
        /// <summary>
        /// デフォルト表示の設定値
        /// </summary>
        /// <param name="setInfo"></param>
        public void SetSetting(CustomEpgTabInfo setInfo)
        {
            info      = setInfo.DeepClone();
            searchKey = setInfo.SearchKey.DeepClone();

            textBox_tabName.Text         = setInfo.TabName;
            checkBox_isVisible.IsChecked = setInfo.IsVisible;
            viewModeRadioBtns.Value      = setInfo.ViewMode;

            checkBox_noTimeView_rate.IsChecked       = setInfo.NeedTimeOnlyBasic;
            checkBox_noTimeView_week.IsChecked       = setInfo.NeedTimeOnlyWeek;
            comboBox_timeH_week.SelectedIndex        = setInfo.StartTimeWeek;
            checkBox_searchMode.IsChecked            = setInfo.SearchMode;
            checkBox_searchServiceFromView.IsChecked = setInfo.SearchGenreNoSyncView;
            checkBox_filterEnded.IsChecked           = (setInfo.FilterEnded == true);

            listBox_serviceView.Items.AddItems(setInfo.ViewServiceList
                                               .Where(id => servieceList.ContainsKey(id) == true).Select(id => servieceList[id]));
            listBox_jyanruView.Items.AddItems(setInfo.ViewContentList.Select(data => CommonManager.ContentKindInfoForDisplay(data)));
            checkBox_notContent.IsChecked = setInfo.ViewNotContentFlag;
        }
        /// <summary>デフォルト表示の設定値</summary>
        public void SetSetting(CustomEpgTabInfo setInfo, List <EpgSetting> setList = null)
        {
            DataContext = setInfo.DeepClone();
            searchKey   = setInfo.SearchKey.DeepClone();

            textBox_tabName.Text         = setInfo.TabName;
            checkBox_isVisible.IsChecked = setInfo.IsVisible;

            SetRecSettingCmbo(setInfo.RecSetting);

            setList = setList ?? Settings.Instance.EpgSettingList;
            cmb_design.SelectedValuePath = CommonUtil.NameOf(() => setList[0].ID);
            cmb_design.DisplayMemberPath = CommonUtil.NameOf(() => setList[0].Name);
            cmb_design.ItemsSource       = setList;
            cmb_design.SelectedIndex     = setList.FindIndex(set => set.ID == setInfo.EpgSettingID);
            if (cmb_design.SelectedIndex < 0)
            {
                cmb_design.SelectedIndex = 0;
            }

            listBox_serviceView.Items.AddItems(setInfo.ViewServiceList.Select(id => new ServiceViewItem(id)));
            listBox_jyanruView.Items.AddItems(setInfo.ViewContentList.Select(data => CommonManager.ContentKindInfoForDisplay(data)));
        }