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()); } }
protected void SetViewMode(AutoAddMode mode) { winMode = mode; SetWindowTitle(); if (mode != AutoAddMode.Change) { dataID = 0; } }
private static bool?OpenEpgAutoAddDialog(EpgAutoAddData Data, AutoAddMode mode) { try { new SearchWindow(Data, mode).Show(); return(true); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } return(null); }
public static bool?OpenManualAutoAddDialog(ManualAutoAddData Data, AutoAddMode mode) { try { new AddManualAutoAddWindow(Data, mode).Show(); return(true); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } return(null); }
public AutoAddWindow(S data = null, AutoAddMode mode = AutoAddMode.Find) { this.Loaded += (sender, e) => { SetData(data); SetViewMode(data != null && DataID == 0 ? AutoAddMode.NewAdd : mode); UpdateViewSelection(); }; }
} //デザイナ用 public SearchWindowBase(EpgAutoAddData data = null, AutoAddMode mode = AutoAddMode.Find) : base(data, mode) { }
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 AddManualAutoAddWindowBase(ManualAutoAddData data = null, AutoAddMode mode = AutoAddMode.Find) : base(data, mode) { }