public SetEpgView() { InitializeComponent(); if (CommonManager.Instance.NWMode == true) { stackPanel_epgArchivePeriod.IsEnabled = false; } listBox_tab.KeyDown += ViewUtil.KeyDown_Enter(button_tab_chg); SelectableItem.Set_CheckBox_PreviewChanged(listBox_tab); var bx = new BoxExchangeEditor(null, this.listBox_tab, true, true, true); bx.targetBoxAllowDoubleClick(bx.TargetBox, (sender, e) => button_tab_chg.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); button_tab_del.Click += bx.button_Delete_Click; button_tab_del_all.Click += bx.button_DeleteAll_Click; button_tab_up.Click += bx.button_Up_Click; button_tab_down.Click += bx.button_Down_Click; button_tab_top.Click += bx.button_Top_Click; button_tab_bottom.Click += bx.button_Bottom_Click; button_RecInfoDropExceptDefault.Click += (sender, e) => textBox_RecInfoDropExcept.Text = string.Join(", ", Settings.RecInfoDropExceptDefault); var FLanguage = XmlLanguage.GetLanguage("ja-JP"); comboBox_fontTitle.ItemsSource = Fonts.SystemFontFamilies.Select(f => f.FamilyNames.ContainsKey(FLanguage) == true ? f.FamilyNames[FLanguage] : f.Source).OrderBy(s => s).ToList(); //カラー関係はまとめてバインドする var colorReference = typeof(Brushes).GetProperties().Select(p => new ColorComboItem(p.Name, (Brush)p.GetValue(null, null))).ToList(); colorReference.Add(new ColorComboItem("カスタム", this.Resources["HatchBrush"] as VisualBrush)); var setComboColor1 = new Action <string, ComboBox>((path, cmb) => { cmb.ItemsSource = colorReference; SetBindingColorCombo(cmb, path); }); var setComboColors = new Action <string, Panel>((path, pnl) => { foreach (var cmb in pnl.Children.OfType <ComboBox>()) { setComboColor1(path + "[" + (string)cmb.Tag + "]", cmb); } }); setComboColor1(CommonUtil.NameOf(() => settings.TitleColor1), comboBox_colorTitle1); setComboColor1(CommonUtil.NameOf(() => settings.TitleColor2), comboBox_colorTitle2); setComboColors(CommonUtil.NameOf(() => settings.ContentColorList), grid_EpgColors); setComboColors(CommonUtil.NameOf(() => settings.EpgResColorList), grid_EpgColorsReserve); setComboColors(CommonUtil.NameOf(() => settings.EpgEtcColors), grid_EpgTimeColors); setComboColors(CommonUtil.NameOf(() => settings.EpgEtcColors), grid_EpgEtcColors); setComboColors(CommonUtil.NameOf(() => settings.TunerServiceColors), grid_TunerFontColor); setComboColors(CommonUtil.NameOf(() => settings.TunerServiceColors), grid_TunerColors); setComboColors(CommonUtil.NameOf(() => settings.TunerServiceColors), grid_TunerEtcColors); var setButtonColors = new Action <string, Panel>((path, pnl) => { foreach (var btn in pnl.Children.OfType <Button>()) { SetBindingColorButton(btn, path + "[" + (string)btn.Tag + "]"); } }); SetBindingColorButton(button_colorTitle1, CommonUtil.NameOf(() => settings.TitleCustColor1)); SetBindingColorButton(button_colorTitle2, CommonUtil.NameOf(() => settings.TitleCustColor2)); setButtonColors(CommonUtil.NameOf(() => settings.ContentCustColorList), grid_EpgColors); setButtonColors(CommonUtil.NameOf(() => settings.EpgResCustColorList), grid_EpgColorsReserve); setButtonColors(CommonUtil.NameOf(() => settings.EpgEtcCustColors), grid_EpgTimeColors); setButtonColors(CommonUtil.NameOf(() => settings.EpgEtcCustColors), grid_EpgEtcColors); setButtonColors(CommonUtil.NameOf(() => settings.TunerServiceCustColors), grid_TunerFontColor); setButtonColors(CommonUtil.NameOf(() => settings.TunerServiceCustColors), grid_TunerColors); setButtonColors(CommonUtil.NameOf(() => settings.TunerServiceCustColors), grid_TunerEtcColors); //録画済み一覧画面 setButtonColors(CommonUtil.NameOf(() => settings.RecEndCustColors), grid_RecInfoBackColors); setComboColors(CommonUtil.NameOf(() => settings.RecEndColors), grid_RecInfoBackColors); //予約一覧・共通画面 SetBindingColorButton(btn_ListDefFontColor, CommonUtil.NameOf(() => settings.ListDefCustColor)); setButtonColors(CommonUtil.NameOf(() => settings.RecModeFontCustColors), grid_ReserveRecModeColors); setButtonColors(CommonUtil.NameOf(() => settings.ResBackCustColors), grid_ReserveBackColors); setButtonColors(CommonUtil.NameOf(() => settings.StatCustColors), grid_StatColors); setComboColor1(CommonUtil.NameOf(() => settings.ListDefColor), cmb_ListDefFontColor); setComboColors(CommonUtil.NameOf(() => settings.RecModeFontColors), grid_ReserveRecModeColors); setComboColors(CommonUtil.NameOf(() => settings.ResBackColors), grid_ReserveBackColors); setComboColors(CommonUtil.NameOf(() => settings.StatColors), grid_StatColors); button_clearSerchKeywords.ToolTip = SearchKeyView.ClearButtonTooltip; checkBox_NotNoStyle.ToolTip = string.Format("チェック時、テーマファイル「{0}」があればそれを、無ければ既定のテーマ(Aero)を適用します。", System.IO.Path.GetFileName(System.Reflection.Assembly.GetEntryAssembly().Location) + ".rd.xaml"); comboBox_startTab.ItemsSource = new Dictionary <CtxmCode, string> { { CtxmCode.ReserveView, "予約一覧" }, { CtxmCode.TunerReserveView, "使用予定チューナー" }, { CtxmCode.RecInfoView, "録画済み一覧" }, { CtxmCode.EpgAutoAddView, "キーワード自動予約登録" }, { CtxmCode.ManualAutoAddView, "プログラム自動予約登録" }, { CtxmCode.EpgView, "番組表" } }; comboBox_mainViewButtonsDock.ItemsSource = new Dictionary <Dock, string> { { Dock.Bottom, "下" }, { Dock.Top, "上" }, { Dock.Left, "左" }, { Dock.Right, "右" } }; }
public SetBasicView() { InitializeComponent(); if (CommonManager.Instance.NWMode == true) { ViewUtil.SetIsEnabledChildren(grid_folder, false); checkbox_OpenFolderWithFileDialog.IsEnabled = true; label1.IsEnabled = true; textBox_setPath.IsEnabled = true; button_setPath.IsEnabled = true; textBox_exe.SetReadOnlyWithEffect(true); button_exe.IsEnabled = true; textBox_cmdBon.SetReadOnlyWithEffect(true); label_recFolder.ToolTip = "未設定の場合は(EpgTimerSrv側の)「設定関係保存フォルダ」がデフォルトになります"; listBox_recFolder.IsEnabled = true; textBox_recFolder.SetReadOnlyWithEffect(true); button_rec_open.IsEnabled = true; textBox_recInfoFolder.SetReadOnlyWithEffect(true); button_recInfoFolder.IsEnabled = true; listBox_bon.IsEnabled = true; ViewUtil.SetIsEnabledChildren(grid_epg, false); ServiceListHeader.IsEnabled = true; listView_service.IsEnabled = true; listView_time.IsEnabled = true; ViewUtil.SetIsEnabledChildren(grid_ServiceOptions, false); checkBox_showEpgCapServiceOnly.IsEnabled = true; checkBox_SortServiceList.IsEnabled = true; tab_NW.Foreground = SystemColors.GrayTextBrush; ViewUtil.SetIsEnabledChildren(grid_tcpServer, false); ViewUtil.SetIsEnabledChildren(grid_tcpCtrl, false); textBox_tcpAcl.SetReadOnlyWithEffect(true); checkBox_httpServer.IsEnabled = false; ViewUtil.SetIsEnabledChildren(grid_httpCtrl, false); textBox_httpAcl.SetReadOnlyWithEffect(true); ViewUtil.SetIsEnabledChildren(grid_httpfolder, false); textBox_docrootPath.SetReadOnlyWithEffect(true); button_docrootPath.IsEnabled = true; checkBox_httpLog.IsEnabled = false; checkBox_dlnaServer.IsEnabled = false; } //エスケープキャンセルだけは常に有効にする。 var bxr = new BoxExchangeEditor(null, this.listBox_recFolder, true); var bxb = new BoxExchangeEditor(null, this.listBox_bon, true); var bxt = new BoxExchangeEditor(null, this.listView_time, true); new BoxExchangeEditor(null, this.listView_service, true); bxr.TargetBox.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(bxr.TargetBox, textBox_recFolder); bxr.TargetBox.KeyDown += ViewUtil.KeyDown_Enter(button_rec_open); bxr.targetBoxAllowDoubleClick(bxr.TargetBox, (sender, e) => button_rec_open.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); // バージョン文字列を表示 textBlock_versionText.Text = App.VERSION_TEXT != "" ? "バージョン情報 : " + ((AssemblyInformationalVersionAttribute)Attribute.GetCustomAttribute(Assembly.GetEntryAssembly(), typeof(AssemblyInformationalVersionAttribute))).InformationalVersion : ""; if (CommonManager.Instance.NWMode == false) { //録画設定関係 bxr.AllowDragDrop(); bxr.AllowKeyAction(); button_rec_up.Click += bxr.button_Up_Click; button_rec_down.Click += bxr.button_Down_Click; button_rec_del.Click += bxr.button_Delete_Click; button_rec_add.Click += (sender, e) => textBox_recFolder.Text = SettingPath.CheckFolder(textBox_recFolder.Text); button_rec_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_recFolder, textBox_recFolder); textBox_recFolder.KeyDown += ViewUtil.KeyDown_Enter(button_rec_add); //チューナ関係関係 bxb.AllowDragDrop(); button_bon_up.Click += bxb.button_Up_Click; button_bon_down.Click += bxb.button_Down_Click; //EPG取得関係 bxt.AllowDragDrop(); bxt.AllowKeyAction(); button_upTime.Click += bxt.button_Up_Click; button_downTime.Click += bxt.button_Down_Click; button_delTime.Click += bxt.button_Delete_Click; SelectableItem.Set_CheckBox_PreviewChanged(listView_time); SelectableItem.Set_CheckBox_PreviewChanged(listView_service); } //これは即時反映。DataContextとSettings.Instanceを両方書き換える。 checkbox_OpenFolderWithFileDialog.Click += (sender, e) => Settings.Instance.OpenFolderWithFileDialog = checkbox_OpenFolderWithFileDialog.IsChecked == true; button_setPath.Click += ViewUtil.OpenFolderNameDialog(textBox_setPath, "設定関係保存フォルダの選択"); button_exe.Click += ViewUtil.OpenFileNameDialog(textBox_exe, false, "", ".exe", true); button_recInfoFolder.Click += ViewUtil.OpenFolderNameDialog(textBox_recInfoFolder, "録画情報保存フォルダの選択", true); button_rec_open.Click += ViewUtil.OpenFolderNameDialog(textBox_recFolder, "録画フォルダの選択", true); button_docrootPath.Click += ViewUtil.OpenFolderNameDialog(textBox_docrootPath, "WebUI公開フォルダの選択"); combo_bon_num.ItemsSource = Enumerable.Range(0, 100); combo_bon_epgnum.Items.Add("すべて"); combo_bon_epgnum.Items.AddItems(Enumerable.Range(0, 100)); comboBox_wday.ItemsSource = new[] { "毎日" }.Concat(CommonManager.DayOfWeekArray); comboBox_wday.SelectedIndex = 0; comboBox_HH.ItemsSource = Enumerable.Range(0, 24); comboBox_HH.SelectedIndex = 0; comboBox_MM.ItemsSource = Enumerable.Range(0, 60); comboBox_MM.SelectedIndex = 0; }
public SetEpgView() { InitializeComponent(); try { textBox_mouse_scroll.Text = Settings.Instance.ScrollSize.ToString(); textBox_service_width.Text = Settings.Instance.ServiceWidth.ToString(); textBox_minHeight.Text = Settings.Instance.MinHeight.ToString(); textBox_dragScroll.Text = Settings.Instance.DragScroll.ToString(); textBox_minimumHeight.Text = Settings.Instance.MinimumHeight.ToString(); checkBox_epg_popup.IsChecked = Settings.Instance.EpgPopup; checkBox_epg_popup_resOnly.IsEnabled = Settings.Instance.EpgPopup; checkBox_epg_popup_resOnly.IsChecked = Settings.Instance.EpgPopupResOnly; checkBox_title_indent.IsChecked = Settings.Instance.EpgTitleIndent; checkBox_singleOpen.IsChecked = Settings.Instance.EpgInfoSingleClick; checkBox_scrollAuto.IsChecked = Settings.Instance.MouseScrollAuto; checkBox_gradation.IsChecked = Settings.Instance.EpgGradation; checkBox_gradationHeader.IsChecked = Settings.Instance.EpgGradationHeader; checkBox_openInfo.IsChecked = (Settings.Instance.EpgInfoOpenMode != 0); checkBox_displayNotifyChange.IsChecked = Settings.Instance.DisplayNotifyEpgChange; checkBox_reserveBackground.IsChecked = Settings.Instance.ReserveRectBackground; textBox_tuner_mouse_scroll.Text = Settings.Instance.TunerScrollSize.ToString(); textBox_tuner_width.Text = Settings.Instance.TunerWidth.ToString(); textBox_tuner_minHeight.Text = Settings.Instance.TunerMinHeight.ToString(); textBox_tunerDdragScroll.Text = Settings.Instance.TunerDragScroll.ToString(); textBox_tunerMinLineHeight.Text = Settings.Instance.TunerMinimumLine.ToString(); checkBox_tuner_popup.IsChecked = Settings.Instance.TunerPopup; checkBox_tuner_popup_recInfo.IsEnabled = Settings.Instance.TunerPopup; checkBox_tuner_popup_recInfo.IsChecked = Settings.Instance.TunerPopupRecinfo; checkBox_tuner_title_indent.IsChecked = Settings.Instance.TunerTitleIndent; checkBox_tunerSingleOpen.IsChecked = Settings.Instance.TunerInfoSingleClick; checkBox_tuner_scrollAuto.IsChecked = Settings.Instance.TunerMouseScrollAuto; checkBox_tuner_service_nowrap.IsChecked = Settings.Instance.TunerServiceNoWrap; checkBox_tunerColorModeUse.IsChecked = Settings.Instance.TunerColorModeUse; comboBox_tunerFontColorService.IsEnabled = !Settings.Instance.TunerColorModeUse; button_tunerFontCustColorService.IsEnabled = !Settings.Instance.TunerColorModeUse; checkBox_tuner_display_offres.IsChecked = Settings.Instance.TunerDisplayOffReserve; var bx = new BoxExchangeEditor(null, this.listBox_tab, true, true, true); bx.targetBoxAllowDoubleClick(bx.TargetBox, (sender, e) => button_tab_chg.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); button_tab_del.Click += new RoutedEventHandler(bx.button_Delete_Click); button_tab_up.Click += new RoutedEventHandler(bx.button_Up_Click); button_tab_down.Click += new RoutedEventHandler(bx.button_Down_Click); button_tab_top.Click += new RoutedEventHandler(bx.button_Top_Click); button_tab_bottom.Click += new RoutedEventHandler(bx.button_Bottom_Click); radioButton_1_def.IsChecked = (Settings.Instance.UseCustomEpgView == false); radioButton_1_cust.IsChecked = (Settings.Instance.UseCustomEpgView != false); listBox_tab.Items.AddItems(Settings.Instance.CustomEpgTabList); if (listBox_tab.Items.Count > 0) { listBox_tab.SelectedIndex = 0; } XmlLanguage FLanguage = XmlLanguage.GetLanguage("ja-JP"); List <string> fontList = Fonts.SystemFontFamilies .Where(f => f.FamilyNames.ContainsKey(FLanguage) == true) .Select(f => f.FamilyNames[FLanguage]).ToList(); var setCmboFont = new Action <string, ComboBox>((name, cmb) => { cmb.ItemsSource = fontList; cmb.SelectedItem = name; if (cmb.SelectedItem == null) { cmb.SelectedIndex = 0; } }); setCmboFont(Settings.Instance.FontNameTitle, comboBox_fontTitle); setCmboFont(Settings.Instance.FontName, comboBox_font); setCmboFont(Settings.Instance.TunerFontNameService, comboBox_fontTunerService); setCmboFont(Settings.Instance.TunerFontName, comboBox_fontTuner); textBox_fontSize.Text = Settings.Instance.FontSize.ToString(); textBox_fontSizeTitle.Text = Settings.Instance.FontSizeTitle.ToString(); checkBox_fontBoldTitle.IsChecked = Settings.Instance.FontBoldTitle; textBox_fontTunerSize.Text = Settings.Instance.TunerFontSize.ToString(); textBox_fontTunerSizeService.Text = Settings.Instance.TunerFontSizeService.ToString(); checkBox_fontTunerBoldService.IsChecked = Settings.Instance.TunerFontBoldService; var colorReference = ColorDef.ColorTable.ToDictionary (item => item.Key, item => new ColorReferenceViewItem(item.Key, item.Value)); colorReference["カスタム"] = new ColorReferenceViewItem("カスタム", this.Resources["HatchBrush"] as VisualBrush); var setComboColor1 = new Action <string, ComboBox>((name, cmb) => { cmb.ItemsSource = colorReference.Values; cmb.SelectedItem = colorReference.ContainsKey(name) ? colorReference[name] : colorReference["カスタム"]; }); var setButtonColor1 = new Action <uint, Button>((clr, btn) => btn.Background = new SolidColorBrush(ColorDef.FromUInt(clr))); var setColors = new Action <UIElement, List <string>, List <uint> >((ui, stockColors, custColors) => { List <UIElement> uiList = new List <UIElement>(); uiList.Add(ui); for (int n = 0; n < uiList.Count; n++) { foreach (var child in LogicalTreeHelper.GetChildren(uiList[n])) { if (child is Control) { int index = int.Parse((string)(child as Control).Tag ?? "-1"); if (index >= 0) { if (child is ComboBox && index < stockColors.Count) { setComboColor1(stockColors[index], child as ComboBox); } else if (child is Button && index < custColors.Count) { setButtonColor1(custColors[index], child as Button); } } } else if (child is UIElement) { uiList.Add(child as UIElement); } } } }); //番組表のフォント色と予約枠色はSettingsが個別のため個別処理。 //これをまとめて出来るようにSettingsを変えると以前の設定が消える。 // [番組表] - [基本] setComboColor1(Settings.Instance.TitleColor1, comboBox_colorTitle1); setButtonColor1(Settings.Instance.TitleCustColor1, button_colorTitle1); setComboColor1(Settings.Instance.TitleColor2, comboBox_colorTitle2); setButtonColor1(Settings.Instance.TitleCustColor2, button_colorTitle2); // [番組表] - [色1] setColors(groupEpgColors, Settings.Instance.ContentColorList, Settings.Instance.ContentCustColorList); setComboColor1(Settings.Instance.ReserveRectColorNormal, comboBox_reserveNormal); setComboColor1(Settings.Instance.ReserveRectColorNo, comboBox_reserveNo); setComboColor1(Settings.Instance.ReserveRectColorNoTuner, comboBox_reserveNoTuner); setComboColor1(Settings.Instance.ReserveRectColorWarning, comboBox_reserveWarning); setComboColor1(Settings.Instance.ReserveRectColorAutoAddMissing, comboBox_reserveAutoAddMissing); setColors(groupEpgColorsReserve, null, Settings.Instance.ContentCustColorList); // [番組表] - [色2] setColors(groupEpgTimeColors, Settings.Instance.EpgEtcColors, Settings.Instance.EpgEtcCustColors); setColors(groupEpgEtcColors, Settings.Instance.EpgEtcColors, Settings.Instance.EpgEtcCustColors); // [使用予定チューナー] - [基本] setColors(groupTunerFontColor, Settings.Instance.TunerServiceColors, Settings.Instance.TunerServiceCustColors); // [使用予定チューナー] - [色] setColors(groupTunerColors, Settings.Instance.TunerServiceColors, Settings.Instance.TunerServiceCustColors); // [録画済み一覧] checkBox_playDClick.IsChecked = Settings.Instance.PlayDClick; checkBox_recNoYear.IsChecked = Settings.Instance.RecInfoNoYear; checkBox_recNoSecond.IsChecked = Settings.Instance.RecInfoNoSecond; checkBox_recNoDurSecond.IsChecked = Settings.Instance.RecInfoNoDurSecond; checkBox_ChacheOn.IsChecked = Settings.Instance.RecInfoExtraDataCache; checkBox_CacheOptimize.IsChecked = Settings.Instance.RecInfoExtraDataCacheOptimize; checkBox_CacheKeepConnect.IsChecked = Settings.Instance.RecInfoExtraDataCacheKeepConnect; if (CommonManager.Instance.NWMode == false) { checkBox_CacheKeepConnect.IsEnabled = false;//{Binding}を破棄しているので注意 } textBox_dropErrIgnore.Text = Settings.Instance.RecInfoDropErrIgnore.ToString(); textBox_dropWrnIgnore.Text = Settings.Instance.RecInfoDropWrnIgnore.ToString(); textBox_scrambleIgnore.Text = Settings.Instance.RecInfoScrambleIgnore.ToString(); checkBox_recinfo_errCritical.IsChecked = Settings.Instance.RecinfoErrCriticalDrops; setColors(groupRecInfoBackColors, Settings.Instance.RecEndColors, Settings.Instance.RecEndCustColors); // [予約一覧・共通] - [基本] this.ctxmSetInfo = Settings.Instance.MenuSet.Clone(); checkBox_displayAutoAddMissing.IsChecked = Settings.Instance.DisplayReserveAutoAddMissing; textBox_DisplayJumpTime.Text = Settings.Instance.DisplayNotifyJumpTime.ToString(); checkBox_resNoYear.IsChecked = Settings.Instance.ResInfoNoYear; checkBox_resNoSecond.IsChecked = Settings.Instance.ResInfoNoSecond; checkBox_resNoDurSecond.IsChecked = Settings.Instance.ResInfoNoDurSecond; checkBox_LaterTimeUse.IsChecked = Settings.Instance.LaterTimeUse; textBox_LaterTimeHour.Text = (Settings.Instance.LaterTimeHour + 24).ToString(); checkBox_displayPresetOnSearch.IsChecked = Settings.Instance.DisplayPresetOnSearch; checkBox_nekopandaToolTip.IsChecked = Settings.Instance.RecItemToolTip; checkBox_displayStatus.IsChecked = Settings.Instance.DisplayStatus; checkBox_displayStatusNotify.IsChecked = Settings.Instance.DisplayStatusNotify; checkBox_IsVisibleReserveView.IsChecked = Settings.Instance.IsVisibleReserveView; checkBox_IsVisibleRecInfoView.IsChecked = Settings.Instance.IsVisibleRecInfoView; checkBox_IsVisibleAutoAddView.IsChecked = Settings.Instance.IsVisibleAutoAddView; checkBox_IsVisibleAutoAddViewMoveOnly.IsChecked = Settings.Instance.IsVisibleAutoAddViewMoveOnly; foreach (var item in new Dictionary <object, string> { { CtxmCode.ReserveView, "予約一覧" }, { CtxmCode.TunerReserveView, "使用予定チューナ" }, { CtxmCode.RecInfoView, "録画済み一案" }, { CtxmCode.EpgAutoAddView, "キーワード予約登録" }, { CtxmCode.ManualAutoAddView, "プログラム予約登録" }, { CtxmCode.EpgView, "番組表" } }) { wrapPanel_StartTab.Children.Add(new RadioButton { Tag = item.Key, Content = item.Value }); } var rbtn = wrapPanel_StartTab.Children.OfType <RadioButton>() .FirstOrDefault(item => item.Tag as CtxmCode? == Settings.Instance.StartTab); if (rbtn != null) { rbtn.IsChecked = true; } foreach (var item in new Dictionary <object, string> { { Dock.Bottom, "下" }, { Dock.Top, "上" }, { Dock.Left, "左" }, { Dock.Right, "右" } }) { wrapPanel_MainViewButtonsDock.Children.Add(new RadioButton { Tag = item.Key, Content = item.Value }); } rbtn = wrapPanel_MainViewButtonsDock.Children.OfType <RadioButton>() .FirstOrDefault(item => item.Tag as Dock? == Settings.Instance.MainViewButtonsDock); if (rbtn != null) { rbtn.IsChecked = true; } InitializeStyleList(); // [予約一覧・共通] - [色] setComboColor1(Settings.Instance.ListDefColor, cmb_ListDefFontColor); setButtonColor1(Settings.Instance.ListDefCustColor, btn_ListDefFontColor); setColors(groupReserveRecModeColors, Settings.Instance.RecModeFontColors, Settings.Instance.RecModeFontCustColors); setColors(groupReserveBackColors, Settings.Instance.ResBackColors, Settings.Instance.ResBackCustColors); setColors(groupStatColors, Settings.Instance.StatColors, Settings.Instance.StatCustColors); // [予約簡易表示] textBox_iw_refresh_interval.Text = Settings.Instance.InfoWindowRefreshInterval.ToString(); radioButton_iw_based_on_bcst.IsChecked = Settings.Instance.InfoWindowBasedOnBroadcast; radioButton_iw_based_on_rec.IsChecked = !Settings.Instance.InfoWindowBasedOnBroadcast; switch (Settings.Instance.InfoWindowItemFilterLevel) { default: radioButton_All.IsChecked = true; break; case 1: radioButton_Level1.IsChecked = true; break; case 2: radioButton_Level2.IsChecked = true; break; case 3: radioButton_Level3.IsChecked = true; break; case int.MaxValue: radioButton_TopN.IsChecked = true; break; } switch (Settings.Instance.InfoWindowItemProgressBarType) { default: radioButton_ProgressBarOff.IsChecked = true; break; case 1: radioButton_ProgressBarType1.IsChecked = true; break; case 2: radioButton_ProgressBarType2.IsChecked = true; break; } setColors(groupInfoWinItemProgressBarColors, Settings.Instance.InfoWindowItemProgressBarColors, Settings.Instance.InfoWindowItemProgressBarCustColors); checkBox_bgTransparent.IsChecked = Settings.Instance.InfoWindowItemProgressBarTransparent; textBox_TopN.Text = Settings.Instance.InfoWindowItemTopN.ToString(); textBox_iw_item_level1.Text = (Settings.Instance.InfoWindowItemLevel1Seconds / 60.0).ToString(); textBox_iw_item_level2.Text = (Settings.Instance.InfoWindowItemLevel2Seconds / 60.0).ToString(); textBox_iw_item_level3.Text = (Settings.Instance.InfoWindowItemLevel3Seconds / 60.0).ToString(); setColors(groupInfoWinItemBgColors, Settings.Instance.InfoWindowItemBgColors, Settings.Instance.InfoWindowItemBgCustColors); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
public SetAppView() { InitializeComponent(); if (CommonManager.Instance.NWMode == true) { tabItem1.Foreground = SystemColors.GrayTextBrush; grid_AppRecEnd.IsEnabled = false; grid_AppRec.IsEnabled = false; ViewUtil.SetIsEnabledChildren(grid_AppCancelMain, false); ViewUtil.SetIsEnabledChildren(grid_AppCancelMainInput, false); textBox_process.SetReadOnlyWithEffect(true); ViewUtil.SetIsEnabledChildren(grid_AppReserve1, false); ViewUtil.SetIsEnabledChildren(grid_AppReserve2, false); ViewUtil.SetIsEnabledChildren(grid_AppReserveIgnore, false); text_RecInfo2RegExp.SetReadOnlyWithEffect(true); checkBox_autoDel.IsEnabled = false; ViewUtil.SetIsEnabledChildren(grid_App2DelMain, false); listBox_ext.IsEnabled = true; textBox_ext.SetReadOnlyWithEffect(true); grid_App2DelChkFolderText.IsEnabled = true; listBox_chk_folder.IsEnabled = true; textBox_chk_folder.SetReadOnlyWithEffect(true); button_chk_open.IsEnabled = true; grid_recname.IsEnabled = false; checkBox_noChkYen.IsEnabled = false; grid_delReserve.IsEnabled = false; checkBox_wakeReconnect.IsEnabled = true; stackPanel_WoLWait.IsEnabled = true; checkBox_suspendClose.IsEnabled = true; checkBox_keepTCPConnect.IsEnabled = true; grid_srvResident.IsEnabled = false; button_srvSetting.IsEnabled = false; label_shortCutSrv.IsEnabled = false; button_shortCutSrv.IsEnabled = false; checkBox_srvSaveNotifyLog.IsEnabled = false; checkBox_srvSaveDebugLog.IsEnabled = false; grid_tsExt.IsEnabled = false; } //0 全般 button_srvSetting.Click += (sender, e) => CommonManager.OpenSrvSetting(); var SetScButton = new Action <Button, string, string>((btn, baseName, scLinkPath) => { string scPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), baseName + ".lnk"); btn.Content = File.Exists(scPath) ? "削除" : "作成"; btn.Click += (sender, e) => { try { if (File.Exists(scPath)) { File.Delete(scPath); } else { CommonUtil.CreateShortCut(scPath, scLinkPath, ""); } btn.Content = File.Exists(scPath) ? "削除" : "作成"; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }; }); SetScButton(button_shortCut, Path.GetFileNameWithoutExtension(SettingPath.ModuleName), Path.Combine(SettingPath.ModulePath, SettingPath.ModuleName)); SetScButton(button_shortCutSrv, "EpgTimerSrv", Path.Combine(SettingPath.ModulePath, "EpgTimerSrv.exe")); //1 録画動作 RadioButtonTagConverter.SetBindingButtons(CommonUtil.NameOf(() => settings.DefRecEndMode), panel_recEndMode); button_process_open.Click += ViewUtil.OpenFileNameDialog(textBox_process, true, "", ".exe"); comboBox_process.Items.AddItems(new[] { "リアルタイム", "高", "通常以上", "通常", "通常以下", "低" }); var bx = new BoxExchangeEditor(null, listBox_process, true); listBox_process.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(listBox_process, textBox_process); if (CommonManager.Instance.NWMode == false) { bx.AllowKeyAction(); bx.AllowDragDrop(); button_process_del.Click += bx.button_Delete_Click; button_process_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_process, textBox_process); textBox_process.KeyDown += ViewUtil.KeyDown_Enter(button_process_add); } //2 予約管理情報 button_chk_open.Click += ViewUtil.OpenFolderNameDialog(textBox_chk_folder, "自動削除対象フォルダの選択", true); var bxe = new BoxExchangeEditor(null, listBox_ext, true); var bxc = new BoxExchangeEditor(null, listBox_chk_folder, true); listBox_ext.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(listBox_ext, textBox_ext); bxc.TargetBox.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(bxc.TargetBox, textBox_chk_folder); bxc.TargetBox.KeyDown += ViewUtil.KeyDown_Enter(button_chk_open); bxc.targetBoxAllowDoubleClick(bxc.TargetBox, (sender, e) => button_chk_open.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); if (CommonManager.Instance.NWMode == false) { bxe.AllowKeyAction(); bxe.AllowDragDrop(); button_ext_del.Click += bxe.button_Delete_Click; button_ext_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_ext, textBox_ext); bxc.AllowKeyAction(); bxc.AllowDragDrop(); button_chk_del.Click += bxc.button_Delete_Click; button_chk_add.Click += (sender, e) => textBox_chk_folder.Text = SettingPath.CheckFolder(textBox_chk_folder.Text); button_chk_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_chk_folder, textBox_chk_folder); textBox_ext.KeyDown += ViewUtil.KeyDown_Enter(button_ext_add); textBox_chk_folder.KeyDown += ViewUtil.KeyDown_Enter(button_chk_add); } //3 ボタン表示 ボタン表示画面の上下ボタンのみ他と同じものを使用する。 bxb = new BoxExchangeEditor(this.listBox_itemBtn, this.listBox_viewBtn, true); bxt = new BoxExchangeEditor(this.listBox_itemTask, this.listBox_viewTask, true); textblockTimer.Text = CommonManager.Instance.NWMode == true ? "EpgTimerNW側の設定です。" : "録画終了時にスタンバイ、休止する場合は必ず表示されます(ただし、サービス未使用時はこの設定は使用されず15秒固定)。"; //上部表示ボタン関係 bxb.AllowDuplication(StringItem.Items(Settings.ViewButtonSpacer), StringItem.Cloner, StringItem.Comparator); button_btnUp.Click += bxb.button_Up_Click; button_btnDown.Click += bxb.button_Down_Click; button_btnAdd.Click += (sender, e) => button_Add(bxb, buttonItem); button_btnIns.Click += (sender, e) => button_Add(bxb, buttonItem, true); button_btnDel.Click += (sender, e) => button_Dell(bxb, bxt, buttonItem); bxb.sourceBoxAllowKeyAction(listBox_itemBtn, (sender, e) => button_btnAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxb.targetBoxAllowKeyAction(listBox_viewBtn, (sender, e) => button_btnDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxb.sourceBoxAllowDoubleClick(listBox_itemBtn, (sender, e) => button_btnAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxb.targetBoxAllowDoubleClick(listBox_viewBtn, (sender, e) => button_btnDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxb.sourceBoxAllowDragDrop(listBox_itemBtn, (sender, e) => button_btnDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxb.targetBoxAllowDragDrop(listBox_viewBtn, (sender, e) => drag_drop(sender, e, button_btnAdd, button_btnIns)); //タスクアイコン関係 bxt.AllowDuplication(StringItem.Items(Settings.TaskMenuSeparator), StringItem.Cloner, StringItem.Comparator); button_taskUp.Click += bxt.button_Up_Click; button_taskDown.Click += bxt.button_Down_Click; button_taskAdd.Click += (sender, e) => button_Add(bxt, taskItem); button_taskIns.Click += (sender, e) => button_Add(bxt, taskItem, true); button_taskDel.Click += (sender, e) => button_Dell(bxt, bxb, taskItem); bxt.sourceBoxAllowKeyAction(listBox_itemTask, (sender, e) => button_taskAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxt.targetBoxAllowKeyAction(listBox_viewTask, (sender, e) => button_taskDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxt.sourceBoxAllowDoubleClick(listBox_itemTask, (sender, e) => button_taskAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxt.targetBoxAllowDoubleClick(listBox_viewTask, (sender, e) => button_taskDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxt.sourceBoxAllowDragDrop(listBox_itemTask, (sender, e) => button_taskDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxt.targetBoxAllowDragDrop(listBox_viewTask, (sender, e) => drag_drop(sender, e, button_taskAdd, button_taskIns)); //4 カスタムボタン button_exe1.Click += ViewUtil.OpenFileNameDialog(textBox_exe1, false, "", ".exe"); button_exe2.Click += ViewUtil.OpenFileNameDialog(textBox_exe2, false, "", ".exe"); button_exe3.Click += ViewUtil.OpenFileNameDialog(textBox_exe3, false, "", ".exe"); //5 iEpg キャンセルアクションだけは付けておく new BoxExchangeEditor(null, this.listBox_service, true); var bxi = new BoxExchangeEditor(null, this.listBox_iEPG, true); bxi.targetBoxAllowKeyAction(this.listBox_iEPG, (sender, e) => button_del.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxi.TargetBox.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(bxi.TargetBox, textBox_station); textBox_station.KeyDown += ViewUtil.KeyDown_Enter(button_add); }
public SetEpgView() { InitializeComponent(); try { textBox_mouse_scroll.Text = Settings.Instance.ScrollSize.ToString(); textBox_service_width.Text = Settings.Instance.ServiceWidth.ToString(); textBox_minHeight.Text = Settings.Instance.MinHeight.ToString(); textBox_dragScroll.Text = Settings.Instance.DragScroll.ToString(); textBox_minimumHeight.Text = Settings.Instance.MinimumHeight.ToString(); checkBox_epg_popup.IsChecked = Settings.Instance.EpgPopup; checkBox_epg_popup_resOnly.IsEnabled = Settings.Instance.EpgPopup; checkBox_epg_popup_resOnly.IsChecked = Settings.Instance.EpgPopupResOnly; checkBox_title_indent.IsChecked = Settings.Instance.EpgTitleIndent; checkBox_singleOpen.IsChecked = Settings.Instance.EpgInfoSingleClick; checkBox_scrollAuto.IsChecked = Settings.Instance.MouseScrollAuto; checkBox_gradation.IsChecked = Settings.Instance.EpgGradation; checkBox_gradationHeader.IsChecked = Settings.Instance.EpgGradationHeader; checkBox_openInfo.IsChecked = (Settings.Instance.EpgInfoOpenMode != 0); checkBox_displayNotifyChange.IsChecked = Settings.Instance.DisplayNotifyEpgChange; checkBox_reserveBackground.IsChecked = Settings.Instance.ReserveRectBackground; textBox_tuner_mouse_scroll.Text = Settings.Instance.TunerScrollSize.ToString(); textBox_tuner_width.Text = Settings.Instance.TunerWidth.ToString(); textBox_tuner_minHeight.Text = Settings.Instance.TunerMinHeight.ToString(); textBox_tunerDdragScroll.Text = Settings.Instance.TunerDragScroll.ToString(); textBox_tunerMinLineHeight.Text = Settings.Instance.TunerMinimumLine.ToString(); checkBox_tuner_popup.IsChecked = Settings.Instance.TunerPopup; checkBox_tuner_popup_recInfo.IsEnabled = Settings.Instance.TunerPopup; checkBox_tuner_popup_recInfo.IsChecked = Settings.Instance.TunerPopupRecinfo; checkBox_tuner_title_indent.IsChecked = Settings.Instance.TunerTitleIndent; checkBox_tunerSingleOpen.IsChecked = Settings.Instance.TunerInfoSingleClick; checkBox_tuner_scrollAuto.IsChecked = Settings.Instance.TunerMouseScrollAuto; checkBox_tuner_service_nowrap.IsChecked = Settings.Instance.TunerServiceNoWrap; checkBox_tunerColorModeUse.IsChecked = Settings.Instance.TunerColorModeUse; comboBox_tunerFontColorService.IsEnabled = !Settings.Instance.TunerColorModeUse; button_tunerFontCustColorService.IsEnabled = !Settings.Instance.TunerColorModeUse; checkBox_tuner_display_offres.IsChecked = Settings.Instance.TunerDisplayOffReserve; var bx = new BoxExchangeEditor(null, this.listBox_tab, true, true, true); bx.targetBoxAllowDoubleClick(bx.TargetBox, (sender, e) => button_tab_chg.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); button_tab_del.Click += new RoutedEventHandler(bx.button_Delete_Click); button_tab_up.Click += new RoutedEventHandler(bx.button_Up_Click); button_tab_down.Click += new RoutedEventHandler(bx.button_Down_Click); button_tab_top.Click += new RoutedEventHandler(bx.button_Top_Click); button_tab_bottom.Click += new RoutedEventHandler(bx.button_Bottom_Click); radioButton_1_def.IsChecked = (Settings.Instance.UseCustomEpgView == false); radioButton_1_cust.IsChecked = (Settings.Instance.UseCustomEpgView != false); listBox_tab.Items.AddItems(Settings.Instance.CustomEpgTabList); if (listBox_tab.Items.Count > 0) listBox_tab.SelectedIndex = 0; XmlLanguage FLanguage = XmlLanguage.GetLanguage("ja-JP"); List<string> fontList = Fonts.SystemFontFamilies .Where(f => f.FamilyNames.ContainsKey(FLanguage) == true) .Select(f => f.FamilyNames[FLanguage]).ToList(); var setCmboFont = new Action<string, ComboBox>((name, cmb) => { cmb.ItemsSource = fontList; cmb.SelectedItem = name; if (cmb.SelectedItem == null) cmb.SelectedIndex = 0; }); setCmboFont(Settings.Instance.FontNameTitle, comboBox_fontTitle); setCmboFont(Settings.Instance.FontName, comboBox_font); setCmboFont(Settings.Instance.TunerFontNameService, comboBox_fontTunerService); setCmboFont(Settings.Instance.TunerFontName, comboBox_fontTuner); textBox_fontSize.Text = Settings.Instance.FontSize.ToString(); textBox_fontSizeTitle.Text = Settings.Instance.FontSizeTitle.ToString(); checkBox_fontBoldTitle.IsChecked = Settings.Instance.FontBoldTitle; textBox_fontTunerSize.Text = Settings.Instance.TunerFontSize.ToString(); textBox_fontTunerSizeService.Text = Settings.Instance.TunerFontSizeService.ToString(); checkBox_fontTunerBoldService.IsChecked = Settings.Instance.TunerFontBoldService; var colorReference = ColorDef.ColorTable.ToDictionary (item => item.Key, item => new ColorReferenceViewItem(item.Key, item.Value)); colorReference["カスタム"] = new ColorReferenceViewItem("カスタム", this.Resources["HatchBrush"] as VisualBrush); var setComboColor1 = new Action<string, ComboBox>((name, cmb) => { cmb.ItemsSource = colorReference.Values; cmb.SelectedItem = colorReference.ContainsKey(name) ? colorReference[name] : colorReference["カスタム"]; }); var setButtonColor1 = new Action<uint, Button>((clr, btn) => btn.Background = new SolidColorBrush(ColorDef.FromUInt(clr))); var setColors = new Action<UIElement, List<string>, List<uint>>((ui, stockColors, custColors) => { List<UIElement> uiList = new List<UIElement>(); uiList.Add(ui); for (int n = 0; n < uiList.Count; n++) { foreach (var child in LogicalTreeHelper.GetChildren(uiList[n])) { if (child is Control) { int index = int.Parse((string)(child as Control).Tag ?? "-1"); if (index >= 0) { if (child is ComboBox && index < stockColors.Count) { setComboColor1(stockColors[index], child as ComboBox); } else if (child is Button && index < custColors.Count) { setButtonColor1(custColors[index], child as Button); } } } else if (child is UIElement) { uiList.Add(child as UIElement); } } } }); //番組表のフォント色と予約枠色はSettingsが個別のため個別処理。 //これをまとめて出来るようにSettingsを変えると以前の設定が消える。 // [番組表] - [基本] setComboColor1(Settings.Instance.TitleColor1, comboBox_colorTitle1); setButtonColor1(Settings.Instance.TitleCustColor1, button_colorTitle1); setComboColor1(Settings.Instance.TitleColor2, comboBox_colorTitle2); setButtonColor1(Settings.Instance.TitleCustColor2, button_colorTitle2); // [番組表] - [色1] setColors(groupEpgColors, Settings.Instance.ContentColorList, Settings.Instance.ContentCustColorList); setComboColor1(Settings.Instance.ReserveRectColorNormal, comboBox_reserveNormal); setComboColor1(Settings.Instance.ReserveRectColorNo, comboBox_reserveNo); setComboColor1(Settings.Instance.ReserveRectColorNoTuner, comboBox_reserveNoTuner); setComboColor1(Settings.Instance.ReserveRectColorWarning, comboBox_reserveWarning); setComboColor1(Settings.Instance.ReserveRectColorAutoAddMissing, comboBox_reserveAutoAddMissing); setColors(groupEpgColorsReserve, null, Settings.Instance.ContentCustColorList); // [番組表] - [色2] setColors(groupEpgTimeColors, Settings.Instance.EpgEtcColors, Settings.Instance.EpgEtcCustColors); setColors(groupEpgEtcColors, Settings.Instance.EpgEtcColors, Settings.Instance.EpgEtcCustColors); // [使用予定チューナー] - [基本] setColors(groupTunerFontColor, Settings.Instance.TunerServiceColors, Settings.Instance.TunerServiceCustColors); // [使用予定チューナー] - [色] setColors(groupTunerColors, Settings.Instance.TunerServiceColors, Settings.Instance.TunerServiceCustColors); // [録画済み一覧] checkBox_playDClick.IsChecked = Settings.Instance.PlayDClick; checkBox_recNoYear.IsChecked = Settings.Instance.RecInfoNoYear; checkBox_recNoSecond.IsChecked = Settings.Instance.RecInfoNoSecond; checkBox_recNoDurSecond.IsChecked = Settings.Instance.RecInfoNoDurSecond; checkBox_ChacheOn.IsChecked = Settings.Instance.RecInfoExtraDataCache; checkBox_CacheOptimize.IsChecked = Settings.Instance.RecInfoExtraDataCacheOptimize; checkBox_CacheKeepConnect.IsChecked = Settings.Instance.RecInfoExtraDataCacheKeepConnect; if (CommonManager.Instance.NWMode == false) { checkBox_CacheKeepConnect.IsEnabled = false;//{Binding}を破棄しているので注意 } textBox_dropErrIgnore.Text = Settings.Instance.RecInfoDropErrIgnore.ToString(); textBox_dropWrnIgnore.Text = Settings.Instance.RecInfoDropWrnIgnore.ToString(); textBox_scrambleIgnore.Text = Settings.Instance.RecInfoScrambleIgnore.ToString(); checkBox_recinfo_errCritical.IsChecked = Settings.Instance.RecinfoErrCriticalDrops; setColors(groupRecInfoBackColors, Settings.Instance.RecEndColors, Settings.Instance.RecEndCustColors); // [予約一覧・共通] - [基本] this.ctxmSetInfo = Settings.Instance.MenuSet.Clone(); checkBox_displayAutoAddMissing.IsChecked = Settings.Instance.DisplayReserveAutoAddMissing; textBox_DisplayJumpTime.Text = Settings.Instance.DisplayNotifyJumpTime.ToString(); checkBox_resNoYear.IsChecked = Settings.Instance.ResInfoNoYear; checkBox_resNoSecond.IsChecked = Settings.Instance.ResInfoNoSecond; checkBox_resNoDurSecond.IsChecked = Settings.Instance.ResInfoNoDurSecond; checkBox_LaterTimeUse.IsChecked = Settings.Instance.LaterTimeUse; textBox_LaterTimeHour.Text = (Settings.Instance.LaterTimeHour + 24).ToString(); checkBox_displayPresetOnSearch.IsChecked = Settings.Instance.DisplayPresetOnSearch; checkBox_nekopandaToolTip.IsChecked = Settings.Instance.RecItemToolTip; checkBox_displayStatus.IsChecked = Settings.Instance.DisplayStatus; checkBox_displayStatusNotify.IsChecked = Settings.Instance.DisplayStatusNotify; checkBox_IsVisibleReserveView.IsChecked = Settings.Instance.IsVisibleReserveView; checkBox_IsVisibleRecInfoView.IsChecked = Settings.Instance.IsVisibleRecInfoView; checkBox_IsVisibleAutoAddView.IsChecked = Settings.Instance.IsVisibleAutoAddView; checkBox_IsVisibleAutoAddViewMoveOnly.IsChecked = Settings.Instance.IsVisibleAutoAddViewMoveOnly; foreach (var item in new Dictionary<object, string> { { CtxmCode.ReserveView, "予約一覧" },{ CtxmCode.TunerReserveView, "使用予定チューナ" }, { CtxmCode.RecInfoView, "録画済み一案" },{ CtxmCode.EpgAutoAddView, "キーワード予約登録" }, { CtxmCode.ManualAutoAddView, "プログラム予約登録" },{ CtxmCode.EpgView, "番組表" } }) { wrapPanel_StartTab.Children.Add(new RadioButton { Tag = item.Key, Content = item.Value }); } var rbtn = wrapPanel_StartTab.Children.OfType<RadioButton>() .FirstOrDefault(item => item.Tag as CtxmCode? == Settings.Instance.StartTab); if (rbtn != null) rbtn.IsChecked = true; foreach (var item in new Dictionary<object, string> { { Dock.Bottom, "下" },{ Dock.Top, "上" },{ Dock.Left, "左" },{ Dock.Right, "右" } }) { wrapPanel_MainViewButtonsDock.Children.Add(new RadioButton { Tag = item.Key, Content = item.Value }); } rbtn = wrapPanel_MainViewButtonsDock.Children.OfType<RadioButton>() .FirstOrDefault(item => item.Tag as Dock? == Settings.Instance.MainViewButtonsDock); if (rbtn != null) rbtn.IsChecked = true; InitializeStyleList(); // [予約一覧・共通] - [色] setComboColor1(Settings.Instance.ListDefColor, cmb_ListDefFontColor); setButtonColor1(Settings.Instance.ListDefCustColor, btn_ListDefFontColor); setColors(groupReserveRecModeColors, Settings.Instance.RecModeFontColors, Settings.Instance.RecModeFontCustColors); setColors(groupReserveBackColors, Settings.Instance.ResBackColors, Settings.Instance.ResBackCustColors); setColors(groupStatColors, Settings.Instance.StatColors, Settings.Instance.StatCustColors); // [予約簡易表示] textBox_iw_refresh_interval.Text = Settings.Instance.InfoWindowRefreshInterval.ToString(); radioButton_iw_based_on_bcst.IsChecked = Settings.Instance.InfoWindowBasedOnBroadcast; radioButton_iw_based_on_rec.IsChecked = !Settings.Instance.InfoWindowBasedOnBroadcast; switch(Settings.Instance.InfoWindowItemFilterLevel) { default: radioButton_All.IsChecked = true; break; case 1: radioButton_Level1.IsChecked = true; break; case 2: radioButton_Level2.IsChecked = true; break; case 3: radioButton_Level3.IsChecked = true; break; case int.MaxValue: radioButton_TopN.IsChecked = true; break; } switch (Settings.Instance.InfoWindowItemProgressBarType) { default: radioButton_ProgressBarOff.IsChecked = true; break; case 1: radioButton_ProgressBarType1.IsChecked = true; break; case 2: radioButton_ProgressBarType2.IsChecked = true; break; } setColors(groupInfoWinItemProgressBarColors, Settings.Instance.InfoWindowItemProgressBarColors, Settings.Instance.InfoWindowItemProgressBarCustColors); checkBox_bgTransparent.IsChecked = Settings.Instance.InfoWindowItemProgressBarTransparent; textBox_TopN.Text = Settings.Instance.InfoWindowItemTopN.ToString(); textBox_iw_item_level1.Text = (Settings.Instance.InfoWindowItemLevel1Seconds / 60.0).ToString(); textBox_iw_item_level2.Text = (Settings.Instance.InfoWindowItemLevel2Seconds / 60.0).ToString(); textBox_iw_item_level3.Text = (Settings.Instance.InfoWindowItemLevel3Seconds / 60.0).ToString(); setColors(groupInfoWinItemBgColors, Settings.Instance.InfoWindowItemBgColors, Settings.Instance.InfoWindowItemBgCustColors); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
private void listBox_Button_Set() { //ボタン表示画面の上下ボタンのみ他と同じものを使用する。 var bxb = new BoxExchangeEditor(this.listBox_itemBtn, this.listBox_viewBtn, true); var bxt = new BoxExchangeEditor(this.listBox_itemTask, this.listBox_viewTask, true); //上部表示ボタン関係 bxb.AllowDuplication(StringItem.Items("(空白)"), StringItem.Cloner, StringItem.Comparator); button_btnUp.Click += new RoutedEventHandler(bxb.button_Up_Click); button_btnDown.Click += new RoutedEventHandler(bxb.button_Down_Click); button_btnAdd.Click += new RoutedEventHandler((sender, e) => button_Add(bxb, buttonItem)); button_btnIns.Click += new RoutedEventHandler((sender, e) => button_Add(bxb, buttonItem, true)); button_btnDel.Click += new RoutedEventHandler((sender, e) => button_Del(bxb, bxt, buttonItem)); bxb.sourceBoxAllowKeyAction(listBox_itemBtn, (sender, e) => button_btnAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxb.targetBoxAllowKeyAction(listBox_viewBtn, (sender, e) => button_btnDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxb.sourceBoxAllowDoubleClick(listBox_itemBtn, (sender, e) => button_btnAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxb.targetBoxAllowDoubleClick(listBox_viewBtn, (sender, e) => button_btnDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxb.sourceBoxAllowDragDrop(listBox_itemBtn, (sender, e) => button_btnDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxb.targetBoxAllowDragDrop(listBox_viewBtn, (sender, e) => drag_drop(sender, e, button_btnAdd, button_btnIns)); //タスクアイコン関係 bxt.AllowDuplication(StringItem.Items("(セパレータ)"), StringItem.Cloner, StringItem.Comparator); button_taskUp.Click += new RoutedEventHandler(bxt.button_Up_Click); button_taskDown.Click += new RoutedEventHandler(bxt.button_Down_Click); button_taskAdd.Click += new RoutedEventHandler((sender, e) => button_Add(bxt, taskItem)); button_taskIns.Click += new RoutedEventHandler((sender, e) => button_Add(bxt, taskItem, true)); button_taskDel.Click += new RoutedEventHandler((sender, e) => button_Del(bxt, bxb, taskItem)); bxt.sourceBoxAllowKeyAction(listBox_itemTask, (sender, e) => button_taskAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxt.targetBoxAllowKeyAction(listBox_viewTask, (sender, e) => button_taskDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxt.sourceBoxAllowDoubleClick(listBox_itemTask, (sender, e) => button_taskAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxt.targetBoxAllowDoubleClick(listBox_viewTask, (sender, e) => button_taskDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxt.sourceBoxAllowDragDrop(listBox_itemTask, (sender, e) => button_taskDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); bxt.targetBoxAllowDragDrop(listBox_viewTask, (sender, e) => drag_drop(sender, e, button_taskAdd, button_taskIns)); listBox_viewBtn.Items.AddItems(StringItem.Items(Settings.Instance.ViewButtonList)); buttonItem = Settings.Instance.GetViewButtonAllItems(); reLoadButtonItem(bxb, buttonItem); listBox_viewTask.Items.AddItems(StringItem.Items(Settings.Instance.TaskMenuList)); taskItem = Settings.Instance.GetTaskMenuAllItems(); reLoadButtonItem(bxt, taskItem); //iEpg関係、キャンセルアクションだけは付けておく new BoxExchangeEditor(null, this.listBox_service, true); var bxi = new BoxExchangeEditor(null, this.listBox_iEPG, true); bxi.targetBoxAllowKeyAction(this.listBox_iEPG, new KeyEventHandler((sender, e) => button_del.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)))); listBox_iEPG.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(listBox_iEPG, textBox_station); }