public SetEpgView() { InitializeComponent(); if (CommonManager.Instance.NWMode == true) { stackPanel_epgArchivePeriod.IsEnabled = false; stackPanel_DropLogThresh.IsEnabled = false; } textBox_des_name.KeyDown += ViewUtil.KeyDown_Enter(btn_des_name); 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(); RadioButtonTagConverter.SetBindingButtons(CommonUtil.NameOf(() => settings.EpgSettingList[0].EpgPopupMode), panel_epgPopup); cmb_design.SelectedValuePath = CommonUtil.NameOf(() => settings.EpgSettingList[0].ID); cmb_design.DisplayMemberPath = CommonUtil.NameOf(() => settings.EpgSettingList[0].Name); RadioButtonTagConverter.SetBindingButtons(CommonUtil.NameOf(() => settings.EpgSettingList[0].EpgChangeBorderMode), panel_EpgBorderColor); RadioButtonTagConverter.SetBindingButtons(CommonUtil.NameOf(() => settings.TunerChangeBorderMode), panel_TunerBorderColor); //カラー関係はまとめてバインドする 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(() => EpgStyle.TitleColor1), comboBox_colorTitle1); setComboColor1(CommonUtil.NameOf(() => EpgStyle.TitleColor2), comboBox_colorTitle2); setComboColors(CommonUtil.NameOf(() => EpgStyle.ContentColorList), grid_EpgColors); setComboColors(CommonUtil.NameOf(() => EpgStyle.EpgResColorList), grid_EpgColorsReserve); setComboColors(CommonUtil.NameOf(() => EpgStyle.EpgEtcColors), grid_EpgTimeColors); setComboColors(CommonUtil.NameOf(() => EpgStyle.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(() => EpgStyle.TitleCustColor1)); SetBindingColorButton(button_colorTitle2, CommonUtil.NameOf(() => EpgStyle.TitleCustColor2)); setButtonColors(CommonUtil.NameOf(() => EpgStyle.ContentCustColorList), grid_EpgColors); setButtonColors(CommonUtil.NameOf(() => EpgStyle.EpgResCustColorList), grid_EpgColorsReserve); setButtonColors(CommonUtil.NameOf(() => EpgStyle.EpgEtcCustColors), grid_EpgTimeColors); setButtonColors(CommonUtil.NameOf(() => EpgStyle.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)); SetBindingColorButton(btn_ListRuledLineColor, CommonUtil.NameOf(() => settings.ListRuledLineCustColor)); 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); setComboColor1(CommonUtil.NameOf(() => settings.ListRuledLineColor), cmb_ListRuledLineColor); 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)を適用します。", SettingPath.ModuleName + ".rd.xaml"); checkBox_ApplyContextMenuStyle.ToolTip = string.Format("チェック時、テーマファイル「{0}」があればそれを、無ければ既定のテーマ(Aero)を適用します。", SettingPath.ModuleName + ".rdcm.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 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); }