private void button_search_Click(object sender, ExecutedRoutedEventArgs e) { SearchPg(true); if (Settings.Instance.UseLastSearchKey == true) { Settings.Instance.DefSearchKey = GetSearchKey(); SettingWindow.UpdatesInfo("検索/キーワード予約ダイアログの前回検索条件変更"); } StatusManager.StatusNotifySet(true, "検索を実行"); }
protected virtual void mc_MenuSetting(object sender, ExecutedRoutedEventArgs e) { var dlg = new SetContextMenuWindow(Owner, Settings.Instance.MenuSet); if (dlg.ShowDialog() == true) { Settings.Instance.MenuSet = dlg.info.DeepClone(); Settings.SaveToXmlFile();//メニュー設定の保存 SettingWindow.UpdatesInfo("右クリックメニューの変更"); mainWindow.RefreshMenu(); } }
private void EpgTabMove() { if (dragUid == null) { return; } Point pt = Mouse.GetPosition(tabControl); pt.X = Math.Min(pt.X, tabControl.DesiredSize.Width - 5);//右範囲外の処理。 var trg = tabControl.GetPlacementItem(pt) as EpgTabItem; if (trg == null || trg.Uid == dragUid) { return; } EpgTabItem tab = Tabs.FirstOrDefault(t => t.Uid == dragUid); int pos = tabControl.Items.IndexOf(trg); if (tab == null || pos < 0) { return; } OnMoveTab = true; tabControl.Items.Remove(tab); tabControl.Items.Insert(pos, tab); tabControl.SelectedItem = tab; OnMoveTab = false; //設定更新 Func <List <CustomEpgTabInfo>, bool> updatesList = (list) => { CustomEpgTabInfo info = list.Find(ti => ti.ID == tab.Info.ID); int idx = list.FindIndex(ti => ti.ID == trg.Info.ID); if (info != null && idx >= 0) { list.Remove(info); list.Insert(idx, info); } return(info != null && idx >= 0); }; if (updatesList(tabInfo) && Settings.Instance.UseCustomEpgView && updatesList(Settings.Instance.CustomEpgTabList)) { SettingWindow.UpdatesInfo("番組表関連の変更"); } }
private void PresetEdited(List <RecPresetItem> list, PresetEdit mode) { Settings.Instance.RecPresetList = list; SettingWindow.UpdatesInfo("録画プリセット変更"); if (CommonManager.Instance.NWMode == false) { CommonManager.CreateSrvCtrl().SendNotifyProfileUpdate(); ViewUtil.MainWindow.RefreshAllViewsReserveInfo(MainWindow.UpdateViewMode.ReserveInfoNoTuner); } SetCustomPresetDisplayName(); if (mode == PresetEdit.Set) { preEdit.ChangeSelect(MatchPresetOrDefault() ?? preEdit.Items.Last(), PresetSelectMode.SelectOnly); } SelectedPreset_Changed(false); }
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; }
void SettingCmd() { SettingWindow setting = new SettingWindow(); PresentationSource topWindow = PresentationSource.FromVisual(this); if (topWindow != null) { setting.Owner = (Window)topWindow.RootVisual; } if (setting.ShowDialog() == true) { if (setting.ServiceStop == false) { CommonManager.Instance.DB.SetNoAutoReloadEPG(Settings.Instance.NgAutoEpgLoadNW); epgView.UpdateSetting(); cmd.SendReloadSetting(); ResetButtonView(); ResetTaskMenu(); } } if (setting.ServiceStop == true) { MessageBox.Show("サービスの状態を変更したため終了します。"); initExe = false; closeFlag = true; Close(); return; } ChSet5.LoadFile(); }
private void MenuCmdsExecute(object sender, RoutedEventArgs e) { try { string selectID = null; List <bool> infoBack = tabInfo.Select(info => info.IsVisible).ToList(); var menu = sender as MenuItem; if (menu.Tag is RoutedUICommand) { EpgTabItem tab = Tabs.FirstOrDefault(ti => ti.Uid == menu.Uid); if (tab != null && tab.view != null) { (menu.Tag as RoutedUICommand).Execute(menu.CommandParameter, tab.view); } return; } switch (menu.Tag as edvCmds?) { case edvCmds.Setting: ViewUtil.MainWindow.OpenSettingDialog(SettingWindow.SettingMode.EpgSetting, menu.Uid); return; case edvCmds.ResetAll: this.UpdateSetting(true); return; case edvCmds.ModeChange: Settings.Instance.UseCustomEpgView = !Settings.Instance.UseCustomEpgView; SettingWindow.UpdatesInfo("番組表関連の変更"); this.UpdateSetting(true); return; case edvCmds.All: tabInfo.ForEach(ti => ti.IsVisible = true); break; case edvCmds.DeleteAll: tabInfo.ForEach(ti => ti.IsVisible = false); break; //case edvCmds.Delete://現在のところVisibleChangeと同じになる case edvCmds.VisibleChange: if (Settings.Instance.EpgTabMoveCheckEnabled == true || tabControl.Items.Count == 0) { selectID = menu.Uid; } var info = get_tabInfo(menu.Uid); if (info != null) { info.IsVisible = !info.IsVisible; } break; case edvCmds.NameTabChange: EpgTabItem tab = Tabs.FirstOrDefault(ti => ti.Uid == menu.Uid); if (tab != null) { tab.IsSelected = true; } return; case edvCmds.NameTabVisible: Settings.Instance.EpgNameTabEnabled = !Settings.Instance.EpgNameTabEnabled; SettingWindow.UpdatesInfo("番組表関連の変更"); TabModeSet(); return; case edvCmds.ViewModeTabVisible: Settings.Instance.EpgViewModeTabEnabled = !Settings.Instance.EpgViewModeTabEnabled; SettingWindow.UpdatesInfo("番組表関連の変更"); TabModeSet(); return; case edvCmds.MoveCheckedTab: Settings.Instance.EpgTabMoveCheckEnabled = !Settings.Instance.EpgTabMoveCheckEnabled; SettingWindow.UpdatesInfo("番組表関連の変更"); return; } if (Settings.Instance.UseCustomEpgView == true) { List <bool> infoNew = tabInfo.Select(info => info.IsVisible).ToList(); if (infoBack.Count != infoNew.Count || infoBack.Zip(infoNew, (v1, v2) => v1 ^ v2).Any(v => v) == true) { SettingWindow.UpdatesInfo("番組表関連の変更"); } } int pos = 0; foreach (var info in tabInfo) { EpgTabItem tab = Tabs.FirstOrDefault(ti => ti.Uid == info.Uid); if (info.IsVisible == false) { tabControl.Items.Remove(tab); } else { if (tab == null) { tabControl.Items.Insert(pos, new EpgTabItem(info, selectID)); } pos++; } } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
private void epgView_ViewSettingClick(EpgViewBase sender, int param) { try { EpgTabItem tab = Tabs.FirstOrDefault(ti => ti.view == sender); if (tab == null) { return; } if (param < -2 || 2 < param) { return; } CustomEpgTabInfo info = null; if (param == -1) { //表示設定変更ダイアログから var dlg = new EpgDataViewSettingWindow(tab.Info); dlg.Owner = CommonUtil.GetTopWindow(this); dlg.SetTryMode(Settings.Instance.UseCustomEpgView == false); if (dlg.ShowDialog() == false) { return; } info = dlg.GetSetting(); if (info.Uid != tab.Uid) { return; //保険 } //設定の保存。 if (Settings.Instance.UseCustomEpgView == true && Settings.Instance.TryEpgSetting == false && info.ID >= 0 && info.ID < tabInfo.Count && info.ID < Settings.Instance.CustomEpgTabList.Count) { tabInfo[info.ID] = info; Settings.Instance.CustomEpgTabList[info.ID] = info; Settings.SaveToXmlFile(); SettingWindow.UpdatesInfo("番組表関連の変更"); } if (info.IsVisible == false) { tabControl.Items.Remove(tab); return; } } else if (param == -2) { info = tabInfo.Find(tinfo => tinfo.ID == tab.Info.ID); if (info == null) { return; } } //選択用タブの選択を切り替え。 tab_viewMode_Change(info != null ? info.ViewMode : param); tab.UpdateContent(info, param); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
void OpenSettingDialog() { SaveViewData(); var setting = new SettingWindow(); setting.Owner = CommonUtil.GetTopWindow(this); if (setting.ShowDialog() == true) { if (setting.ServiceStop == false) { if (CommonManager.Instance.NWMode == true) { if (setting.setBasicView.IsChangeSettingPath == true) { IniFileHandler.UpdateSrvProfileIniNW(); } CommonManager.Instance.DB.SetNoAutoReloadEPG(Settings.Instance.NgAutoEpgLoadNW); } else { cmd.SendReloadSetting(); cmd.SendNotifyProfileUpdate(); } infoWindowViewModel.IsDisabledReserveItemVisible = Settings.Instance.InfoWindowDisabledReserveItemVisible; //StatusbarReset();//ステータスバーリセット //ChkTimerWork();//タイマーリセット reserveView.UpdateInfo(); infoWindowViewModel.UpdateInfo(); tunerReserveView.UpdateInfo(); recInfoView.UpdateInfo(); autoAddView.UpdateInfo(); epgView.UpdateSetting(); SearchWindow.UpdatesInfo(false); ResetMainView(); CommonManager.Instance.StatusNotifySet("設定変更に伴う画面再構築を実行"); } } if (setting.ServiceStop == true) { DisconnectServer(); OpenConnectDialog(); } }
void SettingCmd() { SaveViewData(); SettingWindow setting = new SettingWindow(); PresentationSource topWindow = PresentationSource.FromVisual(this); if (topWindow != null) { setting.Owner = (Window)topWindow.RootVisual; } if (setting.ShowDialog() == true) { if (setting.ServiceStop == false) { if (CommonManager.Instance.NWMode == true) { CommonManager.Instance.DB.SetNoAutoReloadEPG(Settings.Instance.NgAutoEpgLoadNW); ChkRegistTCPTimerWork(); } else { cmd.SendReloadSetting(); cmd.SendNotifyProfileUpdate(); } reserveView.UpdateInfo(); infoWindowViewModel.UpdateInfo(); tunerReserveView.UpdateInfo(); recInfoView.UpdateInfo(); autoAddView.UpdateAutoAddInfo(); epgView.UpdateSetting(); SearchWindow.UpdatesInfo(true); ResetButtonView(); ResetTaskMenu(); RefreshMenu(false); } } if (setting.ServiceStop == true) { DisconnectServer(); ConnectCmd(true); } }
private void SaveSearchLogSettings(ComboBox box, List <string> log) { log.Clear(); log.AddRange(box.Items.OfType <string>().Take(30)); SettingWindow.UpdatesInfo("検索/キーワード予約ダイアログの検索語履歴変更/クリア"); }
private void epgView_ViewSettingClick(int param) { try { var tab = tabControl.SelectedItem as EpgTabItem; if (tab == null) { return; } if (param < -2 || 2 < param) { return; } CustomEpgTabInfo info = null; if (param == -1) { //表示設定変更ダイアログから var dlg = new EpgDataViewSettingWindow(tab.Info); dlg.Owner = CommonUtil.GetTopWindow(this); dlg.SetTryMode(Settings.Instance.UseCustomEpgView == false); if (dlg.ShowDialog() == false) { return; } info = dlg.GetSetting(); if (info.Uid != tab.Uid) { return; //保険 } //設定の保存。 if (Settings.Instance.UseCustomEpgView == true && Settings.Instance.TryEpgSetting == false) { int idx1 = tabInfo.FindIndex(ti => ti.ID == info.ID); int idx2 = Settings.Instance.CustomEpgTabList.FindIndex(ti => ti.ID == info.ID); if (idx1 >= 0 && idx2 >= 0) { tabInfo[idx1] = info; Settings.Instance.CustomEpgTabList[idx2] = info; Settings.SaveToXmlFile(); SettingWindow.UpdatesInfo("番組表関連の変更"); } } if (info.IsVisible == false) { tabControl.Items.Remove(tab); return; } } else if (param == -2) { info = get_tabInfo(tab.Uid); if (info == null) { return; } } //選択用タブの選択を切り替え。 tab_viewMode_ChangeTabOnly(info != null ? info.ViewMode : param); tab.ChangeContent(info, param); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }