public override void InitAutoAddView() { //固有設定 mc = new CmdExeEpgAutoAdd(this);//ジェネリックでも処理できるが‥ viewCode = CtxmCode.EpgAutoAddView; ColumnSavePath = CommonUtil.NameOf(() => Settings.Instance.AutoAddEpgColumn); //初期化の続き base.InitAutoAddView(); }
public string GetValuePropertyName(string key) { //ソート用の代替プロパティには"Value"を後ろに付けることにする。 //呼び出し回数多くないのでとりあえずこれで。 if (key == "ID") { return(CommonUtil.NameOf(() => this.DisplayID)); //"DisplayID"を保持しつつ、保存名("ID")はフォーク元に合わせておく。 } PropertyInfo pInfo = this.GetType().GetProperty(key + "Value"); return(pInfo == null ? key : pInfo.Name); }
public ReserveView() { InitializeComponent(); try { //リストビュー関連の設定 var list_columns = Resources["ReserveItemViewColumns"] as GridViewColumnList; list_columns.AddRange(Resources["RecSettingViewColumns"] as GridViewColumnList); lstCtrl = new ListViewController <ReserveItem>(this); lstCtrl.SetSavePath(CommonUtil.NameOf(() => Settings.Instance.ReserveListColumn) , CommonUtil.NameOf(() => Settings.Instance.ResColumnHead) , CommonUtil.NameOf(() => Settings.Instance.ResSortDirection)); lstCtrl.SetViewSetting(listView_reserve, gridView_reserve, true, true, list_columns); lstCtrl.SetSelectedItemDoubleClick(EpgCmds.ShowDialog); //ステータス変更の設定 lstCtrl.SetSelectionChangedEventHandler((sender, e) => this.UpdateStatus(1)); //最初にコマンド集の初期化 mc = new CmdExeReserve(this); mc.SetFuncGetDataList(isAll => (isAll == true ? lstCtrl.dataList : lstCtrl.GetSelectedItemsList()).GetReserveList()); mc.SetFuncSelectSingleData(noChange => { var item = lstCtrl.SelectSingleItem(noChange); return(item == null ? null : item.ReserveInfo); }); mc.SetFuncReleaseSelectedData(() => listView_reserve.UnselectAll()); //コマンド集に無いもの mc.AddReplaceCommand(EpgCmds.ChgOnOffCheck, (sender, e) => lstCtrl.ChgOnOffFromCheckbox(e.Parameter, EpgCmds.ChgOnOff)); //コマンド集からコマンドを登録。多少冗長だが、持っているコマンドは全部登録してしまう。 //フォーカスによってコンテキストメニューからウィンドウにコマンドが繋がらない場合があるので、 //コンテキストメニューにもコマンドを登録する。 mc.ResetCommandBindings(this, listView_reserve.ContextMenu); //ボタンの設定。XML側でコマンド指定しておけば、ループでまとめ処理できるけど、 //インテリセンス効かないし(一応エラーチェックは入る)、コード側に一覧として書き出す。 mBinds.View = CtxmCode.ReserveView; mBinds.SetCommandToButton(button_on_off, EpgCmds.ChgOnOff); mBinds.SetCommandToButton(button_change, EpgCmds.ShowDialog); mBinds.SetCommandToButton(button_del, EpgCmds.Delete); mBinds.SetCommandToButton(button_add_manual, EpgCmds.ShowAddDialog); mBinds.SetCommandToButton(button_timeShiftPlay, EpgCmds.Play); //コンテキストメニューを開く時の設定 listView_reserve.ContextMenu.Opened += new RoutedEventHandler(mc.SupportContextMenuLoading); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
public override void InitAutoAddView() { //固有設定 mc = new CmdExeManualAutoAdd(this); viewCode = CtxmCode.ManualAutoAddView; ColumnSavePath = CommonUtil.NameOf(() => Settings.Instance.AutoAddManualColumn); //録画設定の表示項目を調整 ColumnList.Remove(ColumnList.Find(data => (data.Header as GridViewColumnHeader).Uid == "Tuijyu")); ColumnList.Remove(ColumnList.Find(data => (data.Header as GridViewColumnHeader).Uid == "Pittari")); ColumnList.RenameHeader("SearchCount", "曜日数"); //初期化の続き base.InitAutoAddView(); }
public RecInfoView() { InitializeComponent(); try { //リストビュー関連の設定 lstCtrl = new ListViewController <RecInfoItem>(this); lstCtrl.SetSavePath(CommonUtil.NameOf(() => Settings.Instance.RecInfoListColumn) , CommonUtil.NameOf(() => Settings.Instance.RecInfoColumnHead) , CommonUtil.NameOf(() => Settings.Instance.RecInfoSortDirection)); lstCtrl.SetViewSetting(listView_recinfo, gridView_recinfo, true, true); lstCtrl.SetSelectedItemDoubleClick((sender, e) => { var cmd = Settings.Instance.PlayDClick == true ? EpgCmds.Play : EpgCmds.ShowDialog; cmd.Execute(sender, listView_recinfo); }); //ステータス変更の設定 lstCtrl.SetSelectionChangedEventHandler((sender, e) => this.UpdateStatus(1)); //最初にコマンド集の初期化 mc = new CmdExeRecinfo(this); mc.SetFuncGetDataList(isAll => (isAll == true ? lstCtrl.dataList : lstCtrl.GetSelectedItemsList()).RecInfoList()); mc.SetFuncSelectSingleData((noChange) => { var item = lstCtrl.SelectSingleItem(noChange); return(item == null ? null : item.RecInfo); }); mc.SetFuncReleaseSelectedData(() => listView_recinfo.UnselectAll()); //コマンド集に無いもの mc.AddReplaceCommand(EpgCmds.ChgOnOffCheck, (sender, e) => lstCtrl.ChgOnOffFromCheckbox(e.Parameter, EpgCmds.ProtectChange)); //コマンド集からコマンドを登録 mc.ResetCommandBindings(this, listView_recinfo.ContextMenu); //コンテキストメニューを開く時の設定 listView_recinfo.ContextMenu.Opened += new RoutedEventHandler(mc.SupportContextMenuLoading); //ボタンの設定 mBinds.View = CtxmCode.RecInfoView; mBinds.SetCommandToButton(button_del, EpgCmds.Delete); mBinds.SetCommandToButton(button_delAll, EpgCmds.DeleteAll); mBinds.SetCommandToButton(button_play, EpgCmds.Play); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
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(); } }; }
/// <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))); }
public NotifyLogWindow() { InitializeComponent(); try { base.SetParam(false, checkBox_windowPinned); this.KeyDown += ViewUtil.KeyDown_Escape_Close; this.KeyDown += ViewUtil.KeyDown_Enter(this.button_reload); this.textBox_logMax.Text = Settings.Instance.NotifyLogMax.ToString(); this.button_reload.Click += (sender, e) => ReloadInfoData(); //リストビュー関連の設定 lstCtrl = new ListViewController <NotifySrvInfoItem>(this); lstCtrl.SetInitialSortKey(CommonUtil.NameOf(() => (new NotifySrvInfoItem()).TimeView), ListSortDirection.Descending); lstCtrl.SetViewSetting(listView_log, gridView_log, false, true); //データ読込 ReloadInfoData(); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
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); } }
public EpgDataViewSettingWindow(CustomEpgTabInfo setInfo = null, List <EpgSetting> setList = null) { InitializeComponent(); DataContext = new CustomEpgTabInfo(); button_ok.Click += new RoutedEventHandler((sender, e) => DialogResult = true); button_cancel.Click += new RoutedEventHandler((sender, e) => DialogResult = false); checkBox_tryEpgSetting.Visibility = Visibility.Hidden; comboBox_timeH_week.ItemsSource = Enumerable.Range(0, 24); foreach (var item in ChSet5.ChListSelected.Select(item => new ServiceViewItem(item))) { if (item.ServiceInfo.IsDttv) { listBox_serviceDttv.Items.Add(item); } if (item.ServiceInfo.IsBS) { listBox_serviceBS.Items.Add(item); } if (item.ServiceInfo.IsCS) { listBox_serviceCS.Items.Add(item); } if (item.ServiceInfo.IsSPHD) { listBox_serviceSP.Items.Add(item); } if (item.ServiceInfo.IsOther) { listBox_serviceOther.Items.Add(item); } listBox_serviceAll.Items.Add(item); } int i = 0; var spItems = Enum.GetValues(typeof(EpgServiceInfo.SpecialViewServices)).Cast <ulong>().Select(id => new ServiceViewItem(id)).ToList(); var spItemsOther = spItems.ToList(); foreach (TabItem tab in tab_ServiceList.Items.OfType <TabItem>().Take(4)) { var listbox = (ListView)tab.Content; if (listbox.Items.Count != 0) { listbox.Items.Insert(0, spItems[i]); spItemsOther.Remove(spItems[i]); } tab.Visibility = listbox.Items.Count == 0 ? Visibility.Collapsed : Visibility.Visible; i++; } listBox_serviceOther.Items.InsertItems(0, spItemsOther); listBox_jyanru.ItemsSource = CommonManager.ContentKindList; RadioButtonTagConverter.SetBindingButtons(CommonUtil.NameOf(() => new CustomEpgTabInfo().ViewMode), PanelDisplaySet); listBox_Button_Set(); listBox_serviceView_ContextMenu_Set(); SetSetting(setInfo ?? new CustomEpgTabInfo(), setList); }
public SetContextMenuWindow(Visual owner = null, MenuSettingData data = null) { InitializeComponent(); try { this.Owner = CommonUtil.GetTopWindow(owner); if (data != null) { info = data.DeepClone(); } //共通設定画面用の設定 Action <StackPanel, StackPanel> CopyStackItem = (src, trg) => { foreach (var item in src.Children.OfType <Control>().Where(i => i is Label != true)) { var newItem = (Control)Activator.CreateInstance(item.GetType()); newItem.Style = item.Style; if (item is CheckBox) { newItem.Visibility = Visibility.Hidden; } trg.Children.Add(newItem); } }; CopyStackItem(stackPanel_menu, stackPanel_gesture); CopyStackItem(stackPanel_menu, stackPanel_gesture2); stackItems_menu = stackPanel_menu.Children.OfType <CheckBox>().ToList(); stackItems_ges1 = stackPanel_gesture.Children.OfType <CheckBox>().ToList(); stackItems_ges2 = stackPanel_gesture2.Children.OfType <CheckBox>().ToList(); //個別設定画面用の設定 this.comboBoxViewSelect.DisplayMemberPath = CommonUtil.NameOf(() => new ComboItem().Value); this.comboBoxViewSelect.SelectedValuePath = CommonUtil.NameOf(() => new ComboItem().Key); var bx = new BoxExchangeEditor(this.listBox_Default, this.listBox_Setting, true, true, true, true); bx.AllowDuplication(StringItem.Items(EpgCmdsEx.SeparatorString), StringItem.Cloner, StringItem.Comparator); button_reset.Click += new RoutedEventHandler(bx.button_Reset_Click); button_add.Click += new RoutedEventHandler(bx.button_Add_Click); button_ins.Click += new RoutedEventHandler(bx.button_Insert_Click); button_del.Click += new RoutedEventHandler(bx.button_Delete_Click); button_delAll.Click += new RoutedEventHandler(bx.button_DeleteAll_Click); button_top.Click += new RoutedEventHandler(bx.button_Top_Click); button_up.Click += new RoutedEventHandler(bx.button_Up_Click); button_down.Click += new RoutedEventHandler(bx.button_Down_Click); button_bottom.Click += new RoutedEventHandler(bx.button_Bottom_Click); //その他画面用の設定 foreach (var item in MenuCodeToTitle.Where(i => i.Key != CtxmCode.EditChgMenu)) { var chkbox = new CheckBox(); chkbox.Tag = item.Key; chkbox.Content = item.Value; chkbox.Checked += new RoutedEventHandler(checkBox_IsManualMenuCode_Checked); chkbox.Unchecked += new RoutedEventHandler(checkBox_IsManualMenuCode_Checked); wrapPanel_IsManualMenu.Children.Add(chkbox); } //細かいオプションの設定 checkBox_NoMessageKeyGesture.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.NoMessageKeyGesture)); checkBox_NoMessageDeleteAll.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.NoMessageDeleteAll)); checkBox_NoMessageDelete2.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.NoMessageDelete2)); checkBox_NoMessageAdjustRes.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.NoMessageAdjustRes)); checkBox_SetJunreToAutoAdd.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.SetJunreToAutoAdd)); checkBox_SetJunreContentToAutoAdd.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.SetJunreContentToAutoAdd)); checkBox_CancelAutoAddOff.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.CancelAutoAddOff)); checkBox_AutoAddFazySearch.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.AutoAddFazySearch)); checkBox_AutoAddSearchToolTip.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.AutoAddSearchToolTip)); checkBox_AutoAddSearchSkipSubMenu.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.AutoAddSearchSkipSubMenu)); checkBox_ReserveSearchToolTip.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.ReserveSearchToolTip)); checkBox_EpgKeyword_Trim.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.Keyword_Trim)); checkBox_CopyTitle_Trim.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.CopyTitle_Trim)); checkBox_CopyContentBasic.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.CopyContentBasic)); checkBox_InfoSearchTtile_Trim.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.InfoSearchTitle_Trim)); checkBox_SearchTtile_Trim.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.SearchTitle_Trim)); textBox_SearchURI.SetBinding(TextBox.TextProperty, CommonUtil.NameOf(() => info.SearchURI)); checkBox_NoMessageNotKEY.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.NoMessageNotKEY)); checkBox_OpenParentFolder.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.OpenParentFolder)); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
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); } }