public SetContextMenuWindow() { InitializeComponent(); try { //個別設定画面用の設定 this.comboBoxViewSelect.DisplayMemberPath = CommonUtil.GetMemberName(() => new ComboItem().Value); this.comboBoxViewSelect.SelectedValuePath = CommonUtil.GetMemberName(() => 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); } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
public InfoWindow(InfoWindowViewModel dataContext) { InitializeComponent(); notifyIcon.Icon = Properties.Resources.TaskIconInfo; notifyIcon.Text = "予約簡易表示 (EpgTimer)"; notifyIcon.MouseClick += NotifyIcon_MouseClick; notifyIcon.Visible = true; // notify icon用メニューの設定 var menu = new System.Windows.Forms.ContextMenuStrip(); ToolStripMenuItem topmostMenu = new ToolStripMenuItem(); topmostMenu.Text = "最前面に表示"; topmostMenu.Checked = dataContext.IsTopMost; topmostMenu.Click += (s, e) => { dataContext.IsTopMost = !dataContext.IsTopMost; }; menu.Items.Add(topmostMenu); ToolStripMenuItem bottommostMenu = new ToolStripMenuItem(); bottommostMenu.Text = "最背面に表示"; bottommostMenu.Checked = dataContext.IsBottomMost; bottommostMenu.Click += (s, e) => { dataContext.IsBottomMost = !dataContext.IsBottomMost; }; menu.Items.Add(bottommostMenu); ToolStripMenuItem closeMenu = new ToolStripMenuItem(); closeMenu.Text = "消す"; closeMenu.Click += (s, e) => TrueClose(); menu.Items.Add(closeMenu); notifyIcon.ContextMenuStrip = menu; // notify icon用メニュー内の checkbox 更新用イベントハンドラ追加 dataContextChanged = (object sender, PropertyChangedEventArgs e) => { switch (e.PropertyName) { case "IsTopMost": topmostMenu.Checked = dataContext.IsTopMost; break; case "IsBottomMost": bottommostMenu.Checked = dataContext.IsBottomMost; break; } }; dataContext.PropertyChanged += dataContextChanged; //リストビュー関連の設定 //var list_columns = Resources["ReserveItemViewColumns"] as GridViewColumnList; ////list_columns.AddRange(Resources["RecSettingViewColumns"] as GridViewColumnList); var progress_list_columns = Resources["ProgressStatusItemViewColumns"] as GridViewColumnList; lstCtrl = new ListViewController <ReserveItem>(this); lstCtrl.SetSavePath(CommonUtil.GetMemberName(() => Settings.Instance.InfoWindowListColumn)); lstCtrl.SetViewSetting(listView_InfoWindow, girdView_InfoWindow, false, false, progress_list_columns, null, false); MouseLeftButtonDown += (s, e) => { DragMove(); }; UpdateWindowState(); DataContext = dataContext; }
public NotifyLogWindow() { InitializeComponent(); //リストビュー関連の設定 lstCtrl = new ListViewController <NotifySrvInfoItem>(this); lstCtrl.SetInitialSortKey(CommonUtil.GetMemberName(() => (new NotifySrvInfoItem()).Time), ListSortDirection.Descending); lstCtrl.SetViewSetting(listView_log, gridView_log, false, true); }
public override void InitAutoAddView() { //固有設定 mc = new CmdExeEpgAutoAdd(this);//ジェネリックでも処理できるが‥ viewCode = CtxmCode.EpgAutoAddView; ColumnSavePath = CommonUtil.GetMemberName(() => Settings.Instance.AutoAddEpgColumn); //初期化の続き base.InitAutoAddView(); }
private CmdExeReserve mc; //予約系コマンド集 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.GetMemberName(() => Settings.Instance.ReserveListColumn) , CommonUtil.GetMemberName(() => Settings.Instance.ResColumnHead) , CommonUtil.GetMemberName(() => 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); //メニューの作成、ショートカットの登録 //RefreshMenu(); //コンテキストメニューを開く時の設定 listView_reserve.ContextMenu.Opened += new RoutedEventHandler(mc.SupportContextMenuLoading); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
public static new string GetValuePropertyName(string key) { var obj = new AutoAddDataItem(); if (key == CommonUtil.GetMemberName(() => obj.NextReserve)) { return(CommonUtil.GetMemberName(() => obj.NextReserveValue)); } else { return(RecSettingItem.GetValuePropertyName(key)); } }
public RecInfoView() { InitializeComponent(); try { //リストビュー関連の設定 lstCtrl = new ListViewController <RecInfoItem>(this); lstCtrl.SetSavePath(CommonUtil.GetMemberName(() => Settings.Instance.RecInfoListColumn) , CommonUtil.GetMemberName(() => Settings.Instance.RecInfoColumnHead) , CommonUtil.GetMemberName(() => 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); //メニューの作成、ショートカットの登録 //RefreshMenu(); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
public override void InitAutoAddView() { //固有設定 mc = new CmdExeManualAutoAdd(this); viewCode = CtxmCode.ManualAutoAddView; ColumnSavePath = CommonUtil.GetMemberName(() => 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")); //初期化の続き base.InitAutoAddView(); }
public static string GetValuePropertyName(string key) { var obj = new RecInfoItem(); if (key == CommonUtil.GetMemberName(() => obj.StartTime)) { return(CommonUtil.GetMemberName(() => obj.StartTimeValue)); } else if (key == CommonUtil.GetMemberName(() => obj.ProgramDuration)) { return(CommonUtil.GetMemberName(() => obj.ProgramDurationValue)); } else { return(key); } }
public static string GetValuePropertyName(string key) { var obj = new RecSettingItem(); if (key == CommonUtil.GetMemberName(() => obj.MarginStart)) { return(CommonUtil.GetMemberName(() => obj.MarginStartValue)); } else if (key == CommonUtil.GetMemberName(() => obj.MarginEnd)) { return(CommonUtil.GetMemberName(() => obj.MarginEndValue)); } else { return(key); } }
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.GetMemberName(() => Settings.Instance.EpgListColumn) , CommonUtil.GetMemberName(() => Settings.Instance.EpgListColumnHead) , CommonUtil.GetMemberName(() => Settings.Instance.EpgListSortDirection)); lstCtrl.SetViewSetting(listView_event, gridView_event, true, true, list_columns); lstCtrl.SetSelectedItemDoubleClick(EpgCmds.ShowDialog); //ステータス変更の設定 lstCtrl.SetSelectionChangedEventHandler((sender, e) => this.UpdateStatus(1)); InitCommand(); }
public static new string GetValuePropertyName(string key) { var obj = new ManualAutoAddDataItem(); if (key == CommonUtil.GetMemberName(() => obj.StartTime)) { return(CommonUtil.GetMemberName(() => obj.StartTimeValue)); } else if (key == CommonUtil.GetMemberName(() => obj.ProgramDuration)) { return(CommonUtil.GetMemberName(() => obj.ProgramDurationValue)); } else if (key == CommonUtil.GetMemberName(() => obj.DayOfWeek)) { return(CommonUtil.GetMemberName(() => obj.DayOfWeekValue)); } else { return(AutoAddDataItem.GetValuePropertyName(key)); } }
public SearchWindow() { InitializeComponent(); try { //リストビュー関連の設定 var list_columns = Resources["ReserveItemViewColumns"] as GridViewColumnList; list_columns.AddRange(Resources["RecSettingViewColumns"] as GridViewColumnList); lstCtrl = new ListViewController <SearchItem>(this); lstCtrl.SetSavePath(CommonUtil.GetMemberName(() => Settings.Instance.SearchWndColumn) , CommonUtil.GetMemberName(() => Settings.Instance.SearchColumnHead) , CommonUtil.GetMemberName(() => 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 CmdExeReserve(this); mc.SetFuncGetSearchList(isAll => (isAll == true ? lstCtrl.dataList.ToList() : lstCtrl.GetSelectedItemsList())); mc.SetFuncSelectSingleSearchData(lstCtrl.SelectSingleItem); mc.SetFuncReleaseSelectedData(() => listView_result.UnselectAll()); mc.recSettingView = this.recSettingView; //コマンド集に無いもの mc.AddReplaceCommand(EpgCmds.ReSearch, mc_Research); mc.AddReplaceCommand(EpgCmds.ReSearch2, mc_Research); mc.AddReplaceCommand(EpgCmds.Search, (sender, e) => SearchPg(true)); mc.AddReplaceCommand(EpgCmds.AddInDialog, button_add_epgAutoAdd_Click); mc.AddReplaceCommand(EpgCmds.ChangeInDialog, button_chg_epgAutoAdd_Click, (sender, e) => e.CanExecute = winMode == SearchMode.Change); mc.AddReplaceCommand(EpgCmds.DeleteInDialog, button_del_epgAutoAdd_Click, (sender, e) => e.CanExecute = winMode == SearchMode.Change); mc.AddReplaceCommand(EpgCmds.UpItem, (sender, e) => button_up_down_Click(-1)); mc.AddReplaceCommand(EpgCmds.DownItem, (sender, e) => button_up_down_Click(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, true)); mc.AddReplaceCommand(EpgCmds.JumpTuner, (sender, e) => mc_JumpTab(CtxmCode.TunerReserveView, true, Settings.Instance.TunerDisplayOffReserve == false)); 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_up_epgAutoAdd, EpgCmds.UpItem); mBinds.SetCommandToButton(button_down_epgAutoAdd, EpgCmds.DownItem); mBinds.AddInputCommand(EpgCmds.Cancel);//ショートカット登録 //メニューの作成、ショートカットの登録 RefreshMenu(); //その他のショートカット(検索ダイアログ固有の設定) searchKeyView.InputBindings.Add(new InputBinding(EpgCmds.Search, new KeyGesture(Key.Enter))); //録画プリセット変更時の対応 recSettingView.SelectedPresetChanged += new EventHandler(SetRecSettingTabHeader); //ウインドウ位置の復元 if (Settings.Instance.SearchWndTop != -100) { this.Top = Settings.Instance.SearchWndTop; } if (Settings.Instance.SearchWndLeft != -100) { this.Left = Settings.Instance.SearchWndLeft; } if (Settings.Instance.SearchWndWidth > 0) { this.Width = Settings.Instance.SearchWndWidth; } if (Settings.Instance.SearchWndHeight > 0) { this.Height = Settings.Instance.SearchWndHeight; } checkBox_windowPinned.IsChecked = Settings.Instance.SearchWndPinned; SetSearchKey(Settings.Instance.DefSearchKey); SetRecSetting(Settings.Instance.RecPresetList[0].RecPresetData); //notify残ってれば更新。通常残ってないはず。 ViewUtil.ReloadReserveData(); //EPG自動予約登録と、登録された予約、および録画済みファイルとの関連付けを実装 CommonManager.Instance.DB.EpgAutoAddUpdated += DB_EpgAutoAddUpdated; } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }