Esempio n. 1
0
        public AddManualAutoAddWindow(ManualAutoAddData data = null, AutoAddMode mode = AutoAddMode.NewAdd)
            : base(data, mode)
        {
            InitializeComponent();

            try
            {
                base.SetParam(false, checkBox_windowPinned, checkBox_dataReplace);

                //コマンドの登録
                this.CommandBindings.Add(new CommandBinding(EpgCmds.Cancel, (sender, e) => this.Close()));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.AddInDialog, autoadd_add));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.ChangeInDialog, autoadd_chg, (sender, e) => e.CanExecute   = winMode == AutoAddMode.Change));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.DeleteInDialog, autoadd_del1, (sender, e) => e.CanExecute  = winMode == AutoAddMode.Change));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.Delete2InDialog, autoadd_del2, (sender, e) => e.CanExecute = winMode == AutoAddMode.Change));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.BackItem, (sender, e) => MoveViewNextItem(-1)));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.NextItem, (sender, e) => MoveViewNextItem(1)));

                //ボタンの設定
                mBinds.SetCommandToButton(button_cancel, EpgCmds.Cancel);
                mBinds.SetCommandToButton(button_chg, EpgCmds.ChangeInDialog);
                mBinds.SetCommandToButton(button_add, EpgCmds.AddInDialog);
                mBinds.SetCommandToButton(button_del, EpgCmds.DeleteInDialog);
                mBinds.SetCommandToButton(button_del2, EpgCmds.Delete2InDialog);
                mBinds.SetCommandToButton(button_up, EpgCmds.BackItem);
                mBinds.SetCommandToButton(button_down, EpgCmds.NextItem);
                RefreshMenu();

                //ステータスバーの登録
                this.statusBar.Status.Visibility = Visibility.Collapsed;
                StatusManager.RegisterStatusbar(this.statusBar, this);

                //その他設定
                chbxList = CommonManager.DayOfWeekArray.Select(wd =>
                                                               new CheckBox {
                    Content = wd, Margin = new Thickness(0, 0, 6, 0)
                }).ToList();
                chbxList.ForEach(chbx => stackPanel_week.Children.Add(chbx));

                comboBox_startHH.ItemsSource   = CommonManager.CustomHourList;
                comboBox_startHH.SelectedIndex = 0;
                comboBox_startMM.ItemsSource   = Enumerable.Range(0, 60);
                comboBox_startMM.SelectedIndex = 0;
                comboBox_startSS.ItemsSource   = Enumerable.Range(0, 60);
                comboBox_startSS.SelectedIndex = 0;
                comboBox_endHH.ItemsSource     = CommonManager.CustomHourList;
                comboBox_endHH.SelectedIndex   = 0;
                comboBox_endMM.ItemsSource     = Enumerable.Range(0, 60);
                comboBox_endMM.SelectedIndex   = 0;
                comboBox_endSS.ItemsSource     = Enumerable.Range(0, 60);
                comboBox_endSS.SelectedIndex   = 0;
                ViewUtil.Set_ComboBox_LostFocus_SelectItemUInt(panel_times);

                comboBox_service.ItemsSource   = ChSet5.ChListSelected;
                comboBox_service.SelectedIndex = 0;

                recSettingView.SetViewMode(false);
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); }
        }
Esempio n. 2
0
        public AddReserveEpgWindow(EpgEventInfo info = null, int epgInfoOpenMode = 0, RecSettingData setInfo = null)
        {
            InitializeComponent();

            base.SetParam(false, checkBox_windowPinned, checkBox_dataReplace);
            recSettingView.PresetResCompare = true;

            //コマンドの登録
            this.CommandBindings.Add(new CommandBinding(EpgCmds.Cancel, (sender, e) => this.Close()));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.AddInDialog, reserve_add, (sender, e) => e.CanExecute    = AddEnabled));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.ChangeInDialog, reserve_chg, (sender, e) => e.CanExecute = KeepWin == true && AddEnabled && chgEnabled));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.DeleteInDialog, reserve_del, (sender, e) => e.CanExecute = KeepWin == true && AddEnabled && chgEnabled));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.BackItem, (sender, e) => MoveViewNextItem(-1), (sender, e) => e.CanExecute = KeepWin == true && (DataView is EpgViewBase || DataViewSearch != null || DataRefList.Any())));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.NextItem, (sender, e) => MoveViewNextItem(1), (sender, e) => e.CanExecute  = KeepWin == true && (DataView is EpgViewBase || DataViewSearch != null || DataRefList.Any())));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.Search, (sender, e) => MoveViewEpgTarget(), (sender, e) => e.CanExecute    = KeepWin == true && DataView is EpgViewBase));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.ShowInDialog, (sender, e) => MenuUtil.OpenRecInfoDialog(MenuUtil.GetRecFileInfo(eventInfo)), (sender, e) => e.CanExecute = button_open_recinfo.Visibility == Visibility.Visible));

            //ボタンの設定
            mBinds.SetCommandToButton(button_cancel, EpgCmds.Cancel);
            mBinds.SetCommandToButton(button_add_reserve, EpgCmds.AddInDialog);
            mBinds.SetCommandToButton(button_chg_reserve, EpgCmds.ChangeInDialog);
            mBinds.SetCommandToButton(button_del_reserve, EpgCmds.DeleteInDialog);
            mBinds.SetCommandToButton(button_up, EpgCmds.BackItem);
            mBinds.SetCommandToButton(button_down, EpgCmds.NextItem);
            mBinds.SetCommandToButton(button_chk, EpgCmds.Search);
            mBinds.SetCommandToButton(button_open_recinfo, EpgCmds.ShowInDialog);
            RefreshMenu();

            //録画設定タブ関係の設定
            recSettingView.SelectedPresetChanged += SetReserveTabHeader;
            reserveTabHeader.MouseRightButtonUp  += recSettingView.OpenPresetSelectMenuOnMouseEvent;
            recSettingView.SetDefSetting(setInfo);

            tabControl.SelectedIndex = epgInfoOpenMode == 1 ? 0 : 1;
            if (KeepWin == true)
            {
                button_cancel.Content = "閉じる";
                //ステータスバーの設定
                this.statusBar.Status.Visibility = Visibility.Collapsed;
                StatusManager.RegisterStatusbar(this.statusBar, this);
            }
            else
            {
                button_chg_reserve.Visibility = Visibility.Collapsed;
                button_del_reserve.Visibility = Visibility.Collapsed;
                button_up.Visibility          = Visibility.Collapsed;
                button_down.Visibility        = Visibility.Collapsed;
                button_chk.Visibility         = Visibility.Collapsed;
            }
            ChangeData(info);
        }
Esempio n. 3
0
        public RecInfoDescWindow(RecFileInfo info = null)
        {
            InitializeComponent();

            try
            {
                base.SetParam(false, checkBox_windowPinned, checkBox_dataReplace);

                //最初にコマンド集の初期化
                mc = new CmdExeRecinfo(this);
                mc.SetFuncGetDataList(isAll => recInfo.IntoList());

                //コマンド集に無いもの,変更するもの
                mc.AddReplaceCommand(EpgCmds.Play, (sender, e) => CommonManager.Instance.FilePlay(recInfo.RecFilePath), (sender, e) => e.CanExecute = recInfo.ID != 0);
                mc.AddReplaceCommand(EpgCmds.Cancel, (sender, e) => this.Close());
                mc.AddReplaceCommand(EpgCmds.BackItem, (sender, e) => MoveViewNextItem(-1));
                mc.AddReplaceCommand(EpgCmds.NextItem, (sender, e) => MoveViewNextItem(1));
                mc.AddReplaceCommand(EpgCmds.Search, (sender, e) => MoveViewRecinfoTarget(), (sender, e) => e.CanExecute = DataView is EpgViewBase);
                mc.AddReplaceCommand(EpgCmds.DeleteInDialog, info_del, (sender, e) => e.CanExecute = recInfo.ID != 0 && recInfo.ProtectFlag == 0);
                mc.AddReplaceCommand(EpgCmds.ChgOnOffCheck, (sender, e) => EpgCmds.ProtectChange.Execute(null, this));

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

                //ボタンの設定
                mBinds.View = CtxmCode.RecInfoView;
                mBinds.SetCommandToButton(button_play, EpgCmds.Play);
                mBinds.SetCommandToButton(button_cancel, EpgCmds.Cancel);
                mBinds.SetCommandToButton(button_up, EpgCmds.BackItem);
                mBinds.SetCommandToButton(button_down, EpgCmds.NextItem);
                mBinds.SetCommandToButton(button_chk, EpgCmds.Search);
                mBinds.SetCommandToButton(button_del, EpgCmds.DeleteInDialog);
                mBinds.AddInputCommand(EpgCmds.ProtectChange);//ショートカット登録
                RefreshMenu();

                button_del.ToolTipOpening += (sender, e) => button_del.ToolTip = (button_del.ToolTip as string +
                                                                                  (IniFileHandler.GetPrivateProfileBool("SET", "RecInfoDelFile", false, SettingPath.CommonIniPath) ?
                                                                                   "\r\n録画ファイルが存在する場合は一緒に削除されます。" : "")).Trim();

                grid_protect.ToolTipOpening += (sender, e) => grid_protect.ToolTip =
                    ("" + MenuBinds.GetInputGestureTextView(EpgCmds.ProtectChange, mBinds.View) + "\r\nプロテクト設定/解除").Trim();

                //ステータスバーの設定
                this.statusBar.Status.Visibility = Visibility.Collapsed;
                StatusManager.RegisterStatusbar(this.statusBar, this);

                ChangeData(info);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Esempio n. 4
0
        public ChgReserveWindow(ReserveData info = null, int epgInfoOpenMode = 0)
        {
            InitializeComponent();

            base.SetParam(false, checkBox_windowPinned, checkBox_dataReplace);

            //コマンドの登録
            this.CommandBindings.Add(new CommandBinding(EpgCmds.Cancel, (sender, e) => this.Close()));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.AddInDialog, reserve_add));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.ChangeInDialog, reserve_chg, (sender, e) => e.CanExecute = addMode == AddMode.Change));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.DeleteInDialog, reserve_del, (sender, e) => e.CanExecute = addMode == AddMode.Change));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.BackItem, (sender, e) => MoveViewNextItem(-1), (sender, e) => e.CanExecute  = KeepWin == true));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.NextItem, (sender, e) => MoveViewNextItem(1), (sender, e) => e.CanExecute   = KeepWin == true));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.Search, (sender, e) => MoveViewReserveTarget(), (sender, e) => e.CanExecute = KeepWin == true && DataView is EpgViewBase || DataView is TunerReserveMainView));

            //ボタンの設定
            mBinds.SetCommandToButton(button_cancel, EpgCmds.Cancel);
            mBinds.SetCommandToButton(button_add_reserve, EpgCmds.AddInDialog);
            mBinds.SetCommandToButton(button_chg_reserve, EpgCmds.ChangeInDialog);
            mBinds.SetCommandToButton(button_del_reserve, EpgCmds.DeleteInDialog);
            mBinds.SetCommandToButton(button_up, EpgCmds.BackItem);
            mBinds.SetCommandToButton(button_down, EpgCmds.NextItem);
            mBinds.SetCommandToButton(button_chk, EpgCmds.Search);
            RefreshMenu();

            //録画設定タブ関係の設定
            recSettingView.SelectedPresetChanged += SetReserveTabHeader;
            reserveTabHeader.MouseRightButtonUp  += recSettingView.OpenPresetSelectMenuOnMouseEvent;

            //その他設定
            //深夜時間関係は、comboBoxの表示だけ変更する手もあるが、
            //オプション変更タイミングなどいろいろ面倒なので、実際の値で処理することにする。
            comboBox_service.ItemsSource = ChSet5.ChListSelected;
            comboBox_sh.ItemsSource      = CommonManager.CustomHourList;
            comboBox_eh.ItemsSource      = CommonManager.CustomHourList;
            comboBox_sm.ItemsSource      = Enumerable.Range(0, 60);
            comboBox_em.ItemsSource      = Enumerable.Range(0, 60);
            comboBox_ss.ItemsSource      = Enumerable.Range(0, 60);
            comboBox_es.ItemsSource      = Enumerable.Range(0, 60);
            ViewUtil.Set_ComboBox_LostFocus_SelectItemUInt(stack_start);
            ViewUtil.Set_ComboBox_LostFocus_SelectItemUInt(stack_end);

            if (info == null)
            {
                info = new ReserveData();
                var sTime = DateTime.UtcNow.AddHours(9).AddMinutes(5);
                info.StartTime      = sTime.AddSeconds(-sTime.Second);
                info.StartTimeEpg   = info.StartTime;
                info.DurationSecond = 1800;
                info.EventID        = 0xFFFF;
                info.RecSetting     = Settings.Instance.RecPresetList[0].Data.DeepClone();
                reserveInfo         = info;
            }
            selectedTab = epgInfoOpenMode == 1 ? 0 : 1;
            if (KeepWin == true)
            {
                button_cancel.Content = "閉じる";
                //ステータスバーの設定
                this.statusBar.Status.Visibility = Visibility.Collapsed;
                StatusManager.RegisterStatusbar(this.statusBar, this);
            }
            else
            {
                button_up.Visibility   = Visibility.Collapsed;
                button_down.Visibility = Visibility.Collapsed;
                button_chk.Visibility  = Visibility.Collapsed;
            }
            ChangeData(info);
            initOpen = false;
            CheckMultiReserve();
        }
Esempio n. 5
0
        public SearchWindow(EpgAutoAddData data = null, AutoAddMode mode = AutoAddMode.Find)
            : base(data, mode)
        {
            InitializeComponent();

            try
            {
                buttonID = "検索";
                base.SetParam(true, checkBox_windowPinned, checkBox_dataReplace);

                //スプリッタ位置設定。操作不可能な値をセットしないよう努める。
                if (Settings.Instance.SearchWndTabsHeight > grid_Tabs.Height.Value)
                {
                    grid_Tabs.Height = new GridLength(Math.Min(Settings.Instance.SearchWndTabsHeight, Height));
                }
                if (Settings.Instance.SearchWndJunreHeight >= 0)
                {
                    searchKeyView.grid_Junre.Height = new GridLength(Settings.Instance.SearchWndJunreHeight);
                }

                //リストビュー関連の設定
                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.SearchWndColumn)
                                    , CommonUtil.NameOf(() => Settings.Instance.SearchColumnHead)
                                    , CommonUtil.NameOf(() => Settings.Instance.SearchSortDirection));
                lstCtrl.SetViewSetting(listView_result, gridView_result, true, true, list_columns);
                lstCtrl.SetSelectedItemDoubleClick(EpgCmds.ShowDialog);

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

                //最初にコマンド集の初期化
                mc = new CmdExeSearch(this);
                mc.SetFuncGetSearchList(isAll => (isAll == true ? lstCtrl.dataList.ToList() : lstCtrl.GetSelectedItemsList()));
                mc.SetFuncSelectSingleSearchData((noChange) => lstCtrl.SelectSingleItem(noChange));
                mc.SetFuncReleaseSelectedData(() => listView_result.UnselectAll());
                mc.SetFuncGetRecSetting(() => recSettingView.GetRecSetting());
                mc.SetFuncGetSearchKey(() => searchKeyView.GetSearchKey());

                //コマンド集に無いもの
                mc.AddReplaceCommand(EpgCmds.ReSearch, mc_Research);
                mc.AddReplaceCommand(EpgCmds.ReSearch2, mc_Research);
                mc.AddReplaceCommand(EpgCmds.Search, button_search_Click);
                mc.AddReplaceCommand(EpgCmds.AddInDialog, autoadd_add);
                mc.AddReplaceCommand(EpgCmds.ChangeInDialog, autoadd_chg, (sender, e) => e.CanExecute   = winMode == AutoAddMode.Change);
                mc.AddReplaceCommand(EpgCmds.DeleteInDialog, autoadd_del1, (sender, e) => e.CanExecute  = winMode == AutoAddMode.Change);
                mc.AddReplaceCommand(EpgCmds.Delete2InDialog, autoadd_del2, (sender, e) => e.CanExecute = winMode == AutoAddMode.Change);
                mc.AddReplaceCommand(EpgCmds.BackItem, (sender, e) => MoveViewNextItem(-1));
                mc.AddReplaceCommand(EpgCmds.NextItem, (sender, e) => MoveViewNextItem(1));
                mc.AddReplaceCommand(EpgCmds.Cancel, (sender, e) => this.Close());
                mc.AddReplaceCommand(EpgCmds.ChgOnOffCheck, (sender, e) => lstCtrl.ChgOnOffFromCheckbox(e.Parameter, EpgCmds.ChgOnOff));

                //コマンド集を振り替えるもの
                mc.AddReplaceCommand(EpgCmds.JumpReserve, (sender, e) => mc_JumpTab(CtxmCode.ReserveView));
                mc.AddReplaceCommand(EpgCmds.JumpRecInfo, (sender, e) => mc_JumpTab(lstCtrl.SelectSingleItem(true).IsReserved ? CtxmCode.ReserveView : CtxmCode.RecInfoView));
                mc.AddReplaceCommand(EpgCmds.JumpTuner, (sender, e) => mc_JumpTab(CtxmCode.TunerReserveView));
                mc.AddReplaceCommand(EpgCmds.JumpTable, (sender, e) => mc_JumpTab(CtxmCode.EpgView));

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

                //コンテキストメニューを開く時の設定
                listView_result.ContextMenu.Opened += new RoutedEventHandler(mc.SupportContextMenuLoading);

                //ボタンの設定
                mBinds.View = CtxmCode.SearchWindow;
                mBinds.SetCommandToButton(button_search, EpgCmds.Search);
                mBinds.SetCommandToButton(button_add_reserve, EpgCmds.Add);
                mBinds.SetCommandToButton(button_delall_reserve, EpgCmds.DeleteAll);
                mBinds.SetCommandToButton(button_add_epgAutoAdd, EpgCmds.AddInDialog);
                mBinds.SetCommandToButton(button_chg_epgAutoAdd, EpgCmds.ChangeInDialog);
                mBinds.SetCommandToButton(button_del_epgAutoAdd, EpgCmds.DeleteInDialog);
                mBinds.SetCommandToButton(button_del2_epgAutoAdd, EpgCmds.Delete2InDialog);
                mBinds.SetCommandToButton(button_up_epgAutoAdd, EpgCmds.BackItem);
                mBinds.SetCommandToButton(button_down_epgAutoAdd, EpgCmds.NextItem);
                mBinds.SetCommandToButton(button_cancel, EpgCmds.Cancel);

                //メニューの作成、ショートカットの登録
                RefreshMenu();

                //予約ウィンドウからのリスト検索、ジャンプ関連の対応
                DataListView = new AutoAddWinListView(listView_result);
                this.grid_main.Children.Add(DataListView);

                //その他のショートカット(検索ダイアログ固有の設定)。コマンドだとコンボボックスアイテムの処理と協調しにくいので‥。
                //searchKeyView.InputBindings.Add(new InputBinding(EpgCmds.Search, new KeyGesture(Key.Enter)));
                searchKeyView.KeyUp += (sender, e) =>
                {
                    if (e.Handled == false && Keyboard.Modifiers == ModifierKeys.None && e.Key == Key.Enter && e.IsRepeat == false)
                    {
                        e.Handled = true;
                        button_search_Click(null, null);
                    }
                    ;
                };
                listView_result.PreviewKeyDown += (sender, e) => ViewUtil.OnKeyMoveNextReserve(sender, e, DataListView);

                //録画設定タブ関係の設定
                recSettingView.SelectedPresetChanged   += SetRecSettingTabHeader;
                recSettingTabHeader.MouseRightButtonUp += recSettingView.OpenPresetSelectMenuOnMouseEvent;

                //過去番組検索
                SetSearchPeriod();

                //ステータスバーの登録
                StatusManager.RegisterStatusbar(this.statusBar, this);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Esempio n. 6
0
        public void InitWindow(InfoSearchSettingData searchInfo, string searchWord = null, bool noSave = false)
        {
            InitializeComponent();

            try
            {
                buttonID = "予約情報検索";
                base.SetParam(false, checkBox_windowPinned);

                //リストビュー関連の設定
                var list_columns = Resources["ReserveItemViewColumns"] as GridViewColumnList;
                list_columns.AddRange(Resources["RecSettingViewColumns"] as GridViewColumnList);
                list_columns.RenameHeader("StartTime", "日時/次の予約");
                list_columns.RenameHeader("EventName", "番組名/ANDキーワード");
                list_columns.RenameHeader("ProgramContent", "番組内容/その他情報");
                list_columns.RenameHeader("IsEnabled", "有効・プロテクト", "有効・無効/プロテクト切替え");
                list_columns.RenameHeader("Comment", "予約/録画状況");
                list_columns.RenameHeader("RecFileName", "予定/録画ファイル名");

                lstCtrl = new ListViewController <InfoSearchItem>(this);
                lstCtrl.SetSavePath(CommonUtil.NameOf(() => Settings.Instance.InfoSearchWndColumn)
                                    , CommonUtil.NameOf(() => Settings.Instance.InfoSearchColumnHead)
                                    , CommonUtil.NameOf(() => Settings.Instance.InfoSearchSortDirection));
                lstCtrl.SetViewSetting(listView_result, gridView_result, true, true, list_columns);
                lstCtrl.SetSelectedItemDoubleClick((sender, e) =>
                {
                    var cmd = (selectedType == typeof(RecFileInfo) && Settings.Instance.PlayDClick == true) ? EpgCmds.Play : EpgCmds.ShowDialog;
                    cmd.Execute(sender, listView_result);
                });

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

                //最初にコマンド集の初期化
                mc = new CmdExe <InfoSearchItem>(this);
                mc.SetFuncGetDataList(isAll => isAll == true ? lstCtrl.dataList : lstCtrl.GetSelectedItemsList());
                mc.SetFuncSelectSingleData((noChange) => lstCtrl.SelectSingleItem(noChange));
                mc.SetFuncReleaseSelectedData(() => listView_result.UnselectAll());

                //コマンド集に無いもの
                mc.AddReplaceCommand(EpgCmds.JumpListView, mc_JumpListView);
                mc.AddReplaceCommand(EpgCmds.ReSearch, mc_ReSearch);
                mc.AddReplaceCommand(EpgCmds.ReSearch2, mc_ReSearch);
                mc.AddReplaceCommand(EpgCmds.Search, mc_Search);
                mc.AddReplaceCommand(EpgCmds.Cancel, (sender, e) => this.Close());
                mc.AddReplaceCommand(EpgCmds.ChgOnOffCheck, (sender, e) => lstCtrl.ChgOnOffFromCheckbox(e.Parameter, EpgCmds.ChgOnOff));

                //コマンド集を振り替えるもの
                mc.AddReplaceCommand(EpgCmds.ShowDialog, mc_ShowDialog);//Enterキーからの実行が無ければ省略できる
                mc.AddReplaceCommand(EpgCmds.ChgOnOff, mc_ChgOnOff);
                mc.AddReplaceCommand(EpgCmds.Delete, mc_Delete);
                mc.AddReplaceCommand(EpgCmds.SetRecTag, mc_SetRecTag);

                //ボタンの設定
                mBinds.View = CtxmCode.InfoSearchWindow;
                mBinds.SetCommandToButton(button_search, EpgCmds.Search);
                mBinds.AddInputCommand(EpgCmds.Cancel);//ショートカット登録

                //コンテキストメニューを開く時の設定
                listView_result.ContextMenu.Opened += (sender, e) => dic_mc[selectedType].SupportContextMenuLoading(sender, e);

                //タイプごとの個別コマンド処理用データの設定
                dic_mc.Add(typeof(InfoSearchItem), mc);
                dic_mc.Add(typeof(ReserveData), new CmdExeReserve(this));
                dic_mc.Add(typeof(RecFileInfo), new CmdExeRecinfo(this));
                dic_mc.Add(typeof(EpgAutoAddData), new CmdExeEpgAutoAdd(this));
                dic_mc.Add(typeof(ManualAutoAddData), new CmdExeManualAutoAdd(this));
                foreach (var data in dic_mc.Values.Skip(1))
                {
                    data.SetFuncGetDataList(isAll =>
                    {
                        return((isAll == true ? lstCtrl.dataList : lstCtrl.GetSelectedItemsList()).Select(d => d.Data));
                    });
                    data.SetFuncSelectSingleData(noChange =>
                    {
                        InfoSearchItem item = lstCtrl.SelectSingleItem(noChange);
                        return(item == null ? null : item.Data);
                    });
                    data.SetFuncReleaseSelectedData(() => listView_result.UnselectAll());
                    data.AddReplaceCommand(EpgCmds.ChgOnOff, mc_ChgOnOff);
                    data.AddReplaceCommand(EpgCmds.JumpReserve, (sender, e) => mc_JumpTab(CtxmCode.ReserveView));
                    data.AddReplaceCommand(EpgCmds.JumpTuner, (sender, e) => mc_JumpTab(CtxmCode.TunerReserveView));
                    data.AddReplaceCommand(EpgCmds.JumpTable, (sender, e) => mc_JumpTab(CtxmCode.EpgView));
                }

                //タイプごとのショートカット情報を登録
                dic_mBinds.Add(typeof(InfoSearchItem), mBinds);
                dic_mBinds.Add(typeof(ReserveData), new MenuBinds {
                    View = CtxmCode.ReserveView
                });
                dic_mBinds.Add(typeof(RecFileInfo), new MenuBinds {
                    View = CtxmCode.RecInfoView
                });
                dic_mBinds.Add(typeof(EpgAutoAddData), new MenuBinds {
                    View = CtxmCode.EpgAutoAddView
                });
                dic_mBinds.Add(typeof(ManualAutoAddData), new MenuBinds {
                    View = CtxmCode.ManualAutoAddView
                });

                //メニューの作成、ショートカットの登録
                this.RefreshMenu();

                //選択状態に合わせてコマンドなどをセットするようにする。
                //lstCtrl.SetSelectionChangedEventHandler()は遅延実行なので使わない。
                this.listView_result.SelectionChanged += (sender, e) => ResetMenu();

                //その他設定
                checkBox_ShowToolTip.IsChecked = Settings.Instance.InfoSearchItemTooltip;
                DataContext = (searchInfo ?? Settings.Instance.InfoSearchData).DeepCloneObj();
                if (searchWord != null)
                {
                    SearchInfo.SearchWord = searchWord;
                }
                startSearch         = searchInfo != null || searchWord != null;
                noSearchSettingSave = noSave;

                //ステータスバーの登録
                StatusManager.RegisterStatusbar(this.statusBar, this);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }