Beispiel #1
0
        public EpgListMainView()
        {
            InitializeComponent();

            //リストビュー関連の設定
            var list_columns = Resources["ReserveItemViewColumns"] as GridViewColumnList;

            list_columns.AddRange(Resources["RecSettingViewColumns"] as GridViewColumnList);

            lstCtrl = new ListViewController <SearchItem>(this);
            lstCtrl.SetSavePath(CommonUtil.NameOf(() => Settings.Instance.EpgListColumn)
                                , CommonUtil.NameOf(() => Settings.Instance.EpgListColumnHead)
                                , CommonUtil.NameOf(() => Settings.Instance.EpgListSortDirection));
            lstCtrl.SetViewSetting(listView_event, gridView_event, true, true, list_columns);
            lstCtrl.SetSelectedItemDoubleClick(EpgCmds.ShowDialog);

            //ステータス変更の設定
            lstCtrl.SetSelectionChangedEventHandler((sender, e) => this.UpdateStatus(1));

            //過去番組移動ボタン関係
            SetControlsPeriod(timeJumpView, timeMoveView, button_now);

            base.InitCommand();

            //コマンド集の初期化の続き
            mc.SetFuncGetSearchList(isAll => (isAll == true ? lstCtrl.dataList.ToList() : lstCtrl.GetSelectedItemsList()));
            mc.SetFuncSelectSingleSearchData((noChange) => lstCtrl.SelectSingleItem(noChange));
            mc.SetFuncReleaseSelectedData(() => listView_event.UnselectAll());

            //コマンド集に無いもの
            mc.AddReplaceCommand(EpgCmds.ChgOnOffCheck, (sender, e) => lstCtrl.ChgOnOffFromCheckbox(e.Parameter, EpgCmds.ChgOnOff));

            //コマンド集からコマンドを登録
            mc.ResetCommandBindings(this, listView_event.ContextMenu);

            //コンテキストメニューの設定
            listView_event.ContextMenu.Tag     = (int)2;//setViewInfo.ViewMode;
            listView_event.ContextMenu.Opened += new RoutedEventHandler(mc.SupportContextMenuLoading);

            //その他の設定
            SelectableItem.Set_CheckBox_PreviewChanged(listBox_service, listBox_service_Click_SelectChange);
            this.IsVisibleChanged += (sender, e) => { if (IsVisible)
                                                      {
                                                          lastActivateClass = this.GetHashCode();
                                                      }
            };
        }
Beispiel #2
0
        public SearchKeyView()
        {
            InitializeComponent();

            Settings.Instance.AndKeyList.ForEach(s => comboBox_andKey.Items.Add(s));
            Settings.Instance.NotKeyList.ForEach(s => comboBox_notKey.Items.Add(s));
            Button_clearAndKey.Click += (sender, e) => ClearSerchLog(comboBox_andKey, Settings.Instance.AndKeyList);
            Button_clearNotKey.Click += (sender, e) => ClearSerchLog(comboBox_notKey, Settings.Instance.NotKeyList);

            comboBox_content.ItemsSource   = CommonManager.ContentKindList;
            comboBox_content.SelectedIndex = 0;
            comboBox_content.KeyUp        += ViewUtil.KeyDown_Enter(button_content_add);

            comboBox_time_sw.ItemsSource   = CommonManager.DayOfWeekArray;
            comboBox_time_sw.SelectedIndex = 0;
            comboBox_time_sh.ItemsSource   = Enumerable.Range(0, 24);
            comboBox_time_sh.SelectedIndex = 0;
            comboBox_time_sm.ItemsSource   = Enumerable.Range(0, 60);
            comboBox_time_sm.SelectedIndex = 0;
            comboBox_time_ew.ItemsSource   = CommonManager.DayOfWeekArray;
            comboBox_time_ew.SelectedIndex = 6;
            comboBox_time_eh.ItemsSource   = Enumerable.Range(0, 24);
            comboBox_time_eh.SelectedIndex = 23;
            comboBox_time_em.ItemsSource   = Enumerable.Range(0, 60);
            comboBox_time_em.SelectedIndex = 59;
            comboBox_week_sh.ItemsSource   = CommonManager.CustomHourList;
            comboBox_week_sh.SelectedIndex = 0;
            comboBox_week_sm.ItemsSource   = Enumerable.Range(0, 60);
            comboBox_week_sm.SelectedIndex = 0;
            comboBox_week_eh.ItemsSource   = CommonManager.CustomHourList;
            comboBox_week_eh.SelectedIndex = 23;
            comboBox_week_em.ItemsSource   = Enumerable.Range(0, 60);
            comboBox_week_em.SelectedIndex = 59;
            ViewUtil.Set_ComboBox_LostFocus_SelectItemUInt(comboBox_time_sh, comboBox_time_sm, comboBox_time_eh, comboBox_time_em);
            ViewUtil.Set_ComboBox_LostFocus_SelectItemUInt(panel_data_week_times);

            new BoxExchangeEdit.BoxExchangeEditor(null, listView_service, true);
            SelectableItem.Set_CheckBox_PreviewChanged(listView_service);
            serviceList = ChSet5.ChListSelected.Select(info => new ServiceViewItem(info)).ToList();
            listView_service.ItemsSource = serviceList;
            listView_service.FitColumnWidth();//他は勝手にフィットするのに‥なぜこれだけ?

            var bxc = new BoxExchangeEdit.BoxExchangeEditor(null, listBox_content, true, true);

            button_content_clear.Click += (sender, e) => { bxc.button_DeleteAll_Click(sender, e); CheckListBox(listBox_content); };
            button_content_del.Click   += (sender, e) => { bxc.button_Delete_Click(sender, e); CheckListBox(listBox_content); };
            button_content_add.Click   += button_content_add_Click;
            bxc.targetBoxAllowKeyAction(listBox_content, (sender, e) => button_content_del.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            listBox_content.Tag = new { ListBoxView = "(全ジャンル)" };
            CheckListBox(listBox_content);

            var bxd = new BoxExchangeEdit.BoxExchangeEditor(null, listBox_date, true, true);

            button_date_clear.Click += (sender, e) => { bxd.button_DeleteAll_Click(sender, e); CheckListBox(listBox_date); };
            button_date_del.Click   += (sender, e) => { bxd.button_Delete_Click(sender, e); CheckListBox(listBox_date); };
            button_date_add.Click   += button_date_add_Click;
            bxd.targetBoxAllowKeyAction(listBox_date, (sender, e) => button_date_del.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            listBox_date.Tag = "(全期間)";
            CheckListBox(listBox_date);

            byte idx = 0;

            chbxWeekList = CommonManager.DayOfWeekArray.Select(wd =>
                                                               new CheckBox {
                Content = wd, Margin = new Thickness(0, 0, 5, 0), Tag = idx++
            }).ToList();
            chbxWeekList.ForEach(chbx => stack_data_week.Children.Add(chbx));

            grid_PresetEdit.Children.Clear();
            grid_PresetEdit.Children.Add(preEdit);
            comboBox_preSet = preEdit.comboBox_preSet;
            preEdit.Set(this,
                        (item, msg) => UpdateView(item),
                        (list, mode) =>
            {
                Settings.Instance.SearchPresetList = list;
                Settings.SaveToXmlFile();
                SettingWindow.UpdatesInfo("検索プリセット変更");
                if (comboBox_preSet.SelectedItem == null)
                {
                    preEdit.ChangeSelect(preEdit.FindPreset(PresetItem.CustomID), null, true);
                }
            },
                        "検索プリセット", SetSearchPresetWindow.SettingWithDialog);
            if (Settings.Instance.UseLastSearchKey == true)
            {
                comboBox_preSet.Items.Add(new SearchPresetItem("前回検索条件", SearchPresetItem.LastID, null));
            }
            checkBox_setWithoutSearchKeyWord.IsChecked = Settings.Instance.SetWithoutSearchKeyWord;
        }