public SetAppCancelWindow() { InitializeComponent(); button_process_del.IsEnabled = IniFileHandler.CanUpdateInifile; label2.IsEnabled = IniFileHandler.CanUpdateInifile; textBox_process.IsEnabled = IniFileHandler.CanUpdateInifile; button_process_add.IsEnabled = IniFileHandler.CanUpdateInifile; button_process_open.IsEnabled = IniFileHandler.CanUpdateInifile; label3.IsEnabled = IniFileHandler.CanUpdateInifile; textBox_ng_min.IsEnabled = IniFileHandler.CanUpdateInifile; label4.IsEnabled = IniFileHandler.CanUpdateInifile; checkBox_ng_fileStreaming.IsEnabled = IniFileHandler.CanUpdateInifile; checkBox_ng_shareFile.IsEnabled = IniFileHandler.CanUpdateInifile; textBox_ng_usePC_min.IsEnabled = IniFileHandler.CanUpdateInifile; label7.IsEnabled = IniFileHandler.CanUpdateInifile; checkBox_ng_usePC.IsEnabled = IniFileHandler.CanUpdateInifile; button_OK.IsEnabled = IniFileHandler.CanUpdateInifile; 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 += new RoutedEventHandler(bx.button_Delete_Click); button_process_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_process, textBox_process); } }
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 SetApp2DelWindow() { InitializeComponent(); button_add.IsEnabled = IniFileHandler.CanUpdateInifile; textBox_ext.IsEnabled = IniFileHandler.CanUpdateInifile; label2.IsEnabled = IniFileHandler.CanUpdateInifile; button_del.IsEnabled = IniFileHandler.CanUpdateInifile; button_chk_del.IsEnabled = IniFileHandler.CanUpdateInifile; button_chk_add.IsEnabled = IniFileHandler.CanUpdateInifile; button_chk_open.IsEnabled = IniFileHandler.CanUpdateInifile; textBox_chk_folder.IsEnabled = IniFileHandler.CanUpdateInifile; button_OK.IsEnabled = IniFileHandler.CanUpdateInifile; 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); listBox_chk_folder.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(listBox_chk_folder, textBox_chk_folder); if (CommonManager.Instance.NWMode == false) { bxe.AllowKeyAction(); bxe.AllowDragDrop(); button_del.Click += new RoutedEventHandler(bxe.button_Delete_Click); button_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_ext, textBox_ext); bxc.AllowKeyAction(); bxc.AllowDragDrop(); button_chk_del.Click += new RoutedEventHandler(bxc.button_Delete_Click); button_chk_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_chk_folder, textBox_chk_folder); } }
public SetContextMenuWindow(Visual owner = null, MenuSettingData data = null) { InitializeComponent(); try { this.Owner = CommonUtil.GetTopWindow(owner); if (data != null) { info = data.DeepClone(); } //共通設定画面用の設定 Action <StackPanel, StackPanel> CopyStackItem = (src, trg) => { foreach (var item in src.Children.OfType <Control>().Where(i => i is Label != true)) { var newItem = (Control)Activator.CreateInstance(item.GetType()); newItem.Style = item.Style; if (item is CheckBox) { newItem.Visibility = Visibility.Hidden; } trg.Children.Add(newItem); } }; CopyStackItem(stackPanel_menu, stackPanel_gesture); CopyStackItem(stackPanel_menu, stackPanel_gesture2); stackItems_menu = stackPanel_menu.Children.OfType <CheckBox>().ToList(); stackItems_ges1 = stackPanel_gesture.Children.OfType <CheckBox>().ToList(); stackItems_ges2 = stackPanel_gesture2.Children.OfType <CheckBox>().ToList(); //個別設定画面用の設定 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); } }
private void reLoadButtonItem(BoxExchangeEditor bx, List <string> src) { var viewlist = bx.TargetBox.Items.OfType <StringItem>().Values(); var diflist = src.Except(viewlist).ToList(); diflist.Insert(0, (bx.DuplicationSpecific.First() as StringItem).Value); bx.SourceBox.ItemsSource = StringItem.Items(diflist.Distinct()); }
public void SetData(Control ow, ListBox listbox, LVDMHelper helper, MenuBinds mbinds = null) { try { Owner = ow; listBox = listbox; hlp = helper; MenuBinds mBinds = mbinds ?? new MenuBinds(); //マウスイベント関係 this.listBox.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(listBox_PreviewMouseLeftButtonUp); this.listBox.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(listBox_PreviewMouseLeftButtonDown); ViewUtil.ResetItemContainerStyle(listbox); listbox.ItemContainerStyle.Setters.Add(new EventSetter(Mouse.MouseEnterEvent, new MouseEventHandler(listBoxItem_MouseEnter))); //移動などのアクションはBoxExchangeEditorのものをそのまま使用する。 bx = new BoxExchangeEditor { TargetBox = listBox }; this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.TopItem, (sender, e) => ItemsAction(() => bx.button_Top_Click(null, null)))); this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.UpItem, (sender, e) => ItemsAction(() => bx.button_Up_Click(null, null)))); this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.DownItem, (sender, e) => ItemsAction(() => bx.button_Down_Click(null, null)))); this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.BottomItem, (sender, e) => ItemsAction(() => bx.button_Bottom_Click(null, null)))); this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.SaveOrder, SaveOrder_handler, (sender, e) => e.CanExecute = NotSaved == true)); this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.RestoreOrder, (sender, e) => hlp.RestoreOrder(), (sender, e) => e.CanExecute = NotSaved == true)); this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.DragCancel, (sender, e) => DragRelease())); mBinds.SetCommandToButton(button_top, EpgCmds.TopItem); mBinds.SetCommandToButton(button_up, EpgCmds.UpItem); mBinds.SetCommandToButton(button_down, EpgCmds.DownItem); mBinds.SetCommandToButton(button_bottom, EpgCmds.BottomItem); mBinds.SetCommandToButton(button_saveItemOrder, EpgCmds.SaveOrder); mBinds.SetCommandToButton(button_reloadItem, EpgCmds.RestoreOrder); mBinds.AddInputCommand(EpgCmds.DragCancel);//アイテムのドラッグキャンセル if (mbinds == null) { mBinds.ResetInputBindings(this.Owner, this.listBox); } //コマンドだと、DragCancelしない場合に、CanExecuteを割り当てても、Handled=falseにしても、 //Keygestureが先へ伝搬してくれないので、対処療法的だけど先に処理してしまうことにする。コマンドの意味無い‥。 listBox.PreviewKeyDown += new KeyEventHandler((sender, e) => { if (e.Handled == false && e.Key == Key.Escape && e.IsRepeat == false && _onDrag == true) { EpgCmds.DragCancel.Execute(null, this); //this.listBox.Items.Refresh();//壊したバインディングを修復する。モタツキ感があるので放置する。 e.Handled = true; } }); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void button_Add(BoxExchangeEditor bx, List<string> src, bool isInsert = false) { int pos = bx.SourceBox.SelectedIndex - bx.SourceBox.SelectedItems.Count; bx.bxAddItems(bx.SourceBox, bx.TargetBox, isInsert); reLoadButtonItem(bx, src); if (bx.SourceBox.Items.Count != 0) { pos = Math.Max(0, Math.Min(pos, bx.SourceBox.Items.Count - 1)); bx.SourceBox.SelectedIndex = pos;//順序がヘンだが、ENTERの場合はこの後に+1処理が入る模様 } }
private void button_Add(BoxExchangeEditor bx, List <string> src, bool isInsert = false) { int pos = bx.SourceBox.SelectedIndex - bx.SourceBox.SelectedItems.Count; bx.bxAddItems(bx.SourceBox, bx.TargetBox, isInsert); reLoadButtonItem(bx, src); if (bx.SourceBox.Items.Count != 0) { pos = Math.Max(0, Math.Min(pos, bx.SourceBox.Items.Count - 1)); bx.SourceBox.SelectedIndex = pos;//順序がヘンだが、ENTERの場合はこの後に+1処理が入る模様 } }
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); }
public RecSettingView() { PresetResCompare = false; InitializeComponent(); if (CommonManager.Instance.NWMode == true) { preEdit.button_add.IsEnabled = false; preEdit.button_chg.IsEnabled = false; preEdit.button_del.IsEnabled = false; preEdit.button_add.ToolTip = "EpgTimerNWからは変更出来ません"; preEdit.button_chg.ToolTip = preEdit.button_add.ToolTip; preEdit.button_del.ToolTip = preEdit.button_add.ToolTip; } recSetting = Settings.Instance.RecPresetList[0].Data.DeepClone(); comboBox_recMode.ItemsSource = CommonManager.RecModeList; comboBox_tuijyu.ItemsSource = CommonManager.YesNoList; comboBox_pittari.ItemsSource = CommonManager.YesNoList; comboBox_priority.ItemsSource = CommonManager.PriorityList; recEndModeRadioBtns = new RadioBtnSelect(radioButton_non, radioButton_standby, radioButton_suspend, radioButton_shutdown); comboBox_tuner.ItemsSource = new List <TunerSelectInfo> { new TunerSelectInfo("自動", 0) } .Concat(CommonManager.Instance.DB.TunerReserveList.Values .Where(info => info.tunerID != 0xFFFFFFFF) .Select(info => new TunerSelectInfo(info.tunerName, info.tunerID))); comboBox_tuner.SelectedIndex = 0; stackPanel_PresetEdit.Children.Clear(); stackPanel_PresetEdit.Children.Add(preEdit); preEdit.Set(this, PresetSelectChanged, PresetEdited, "録画プリセット", SetRecPresetWindow.SettingWithDialog); comboBox_preSet = preEdit.comboBox_preSet; var bx = new BoxExchangeEditor(null, listView_recFolder, true, true, true); bx.TargetBox.KeyDown += ViewUtil.KeyDown_Enter(button_recFolderChg); bx.targetBoxAllowDoubleClick(bx.TargetBox, (sender, e) => button_recFolderChg.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); button_recFolderDel.Click += new RoutedEventHandler(bx.button_Delete_Click); button_bat.Click += ViewUtil.OpenFileNameDialog(textBox_bat, false, "", ".bat", true); }
private void listBox_Button_Set() { bxs = new BoxExchangeEditor(null, this.listBox_serviceView, true, true, true, true); bxs.ItemComparer = ServiceViewItem.Comparator; //サービス選択関係はソースの ListView が複数あるので、全ての ListViewItem にイベントを追加する。 foreach (TabItem tab in tab_ServiceList.Items) { var box = tab.Content as ListView; bxs.sourceBoxAllowCancelAction(box); bxs.sourceBoxAllowDragDrop(box); bxs.sourceBoxAllowKeyAction(box); bxs.sourceBoxAllowDoubleClick(box); } //ソースのリストボックスは複数あるので、リストボックスが選択されたときに SourceBox の登録を行う tab_ServiceList.SelectionChanged += (sender, e) => { try { bxs.SourceBox = ((sender as TabControl).SelectedItem as TabItem).Content as ListView; } catch { bxs.SourceBox = null; } }; button_service_addAll.Click += (sender, e) => button_AddAll(); button_service_add.Click += new RoutedEventHandler(bxs.button_Add_Click); button_service_ins.Click += new RoutedEventHandler(bxs.button_Insert_Click); button_service_del.Click += new RoutedEventHandler(bxs.button_Delete_Click); button_service_delAll.Click += new RoutedEventHandler(bxs.button_DeleteAll_Click); button_service_top.Click += new RoutedEventHandler(bxs.button_Top_Click); button_service_up.Click += new RoutedEventHandler(bxs.button_Up_Click); button_service_down.Click += new RoutedEventHandler(bxs.button_Down_Click); button_service_bottom.Click += new RoutedEventHandler(bxs.button_Bottom_Click); //ジャンル選択関係 var bxj = new BoxExchangeEditor(this.listBox_jyanru, this.listBox_jyanruView, true, true, true, true); button_jyanru_addAll.Click += new RoutedEventHandler(bxj.button_AddAll_Click); button_jyanru_add.Click += new RoutedEventHandler(bxj.button_Add_Click); button_jyanru_ins.Click += new RoutedEventHandler(bxj.button_Insert_Click); button_jyanru_del.Click += new RoutedEventHandler(bxj.button_Delete_Click); button_jyanru_delAll.Click += new RoutedEventHandler(bxj.button_DeleteAll_Click); button_jyanru_top.Click += new RoutedEventHandler(bxj.button_Top_Click); button_jyanru_up.Click += new RoutedEventHandler(bxj.button_Up_Click); button_jyanru_down.Click += new RoutedEventHandler(bxj.button_Down_Click); button_jyanru_bottom.Click += new RoutedEventHandler(bxj.button_Bottom_Click); }
private void button_Dell(BoxExchangeEditor bx, BoxExchangeEditor bx_other, List <string> src) { if (bx.TargetBox.SelectedItem == null) { return; } // var item1 = bx.TargetBox.SelectedItems.OfType <StringItem>().FirstOrDefault(item => item.Value == "設定"); var item2 = bx_other.TargetBox.Items.OfType <StringItem>().FirstOrDefault(item => item.Value == "設定"); if (item1 != null && item2 == null) { MessageBox.Show("設定は上部表示ボタンか右クリック表示項目のどちらかに必要です"); return; } bx.bxDeleteItems(bx.TargetBox); reLoadButtonItem(bx, src); }
public SetPresetWindow(Visual owner = null, IEnumerable <S> presetlist = null) { InitializeComponent(); this.Owner = CommonUtil.GetTopWindow(owner); this.Loaded += (sender, e) => { if (presetlist != null) { SetPresetList(presetlist); } }; button_add.Click += (sender, e) => listBox_preset.ScrollIntoViewLast(new S { DisplayName = textBox_preset.Text, ID = 0, Data = DataView.GetData() }); button_iniLoad.Click += (sender, e) => SetPresetList(DataView.DefPresetList().OfType <S>()); listBox_preset.SelectionChanged += listBox_preset_SelectionChanged; textBox_preset.TextChanged += textBox_preset_TextChanged; button_cancel.Click += (sender, e) => DialogResult = false; button_ok.Click += (sender, e) => { listBox_preset.SelectedIndex = -1;//listBox_preset_SelectionChanged()を走らせる DialogResult = true; }; //リストボックスの設定 var bx = new BoxExchangeEditor(null, listBox_preset, true, true, true); button_up.Click += bx.button_Up_Click; button_down.Click += bx.button_Down_Click; button_top.Click += bx.button_Top_Click; button_bottom.Click += bx.button_Bottom_Click; button_del.Click += bx.button_Delete_Click; //ビューを登録,簡易編集用のバーを非表示に grid_Data.Children.Add(DataView); SetSettingMode(null, int.MaxValue); }
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); } }
private void reLoadButtonItem(BoxExchangeEditor bx, List<string> src) { var viewlist = bx.TargetBox.Items.OfType<string>().ToList(); var diflist = src.Except(viewlist).ToList(); diflist.Insert(0, bx.DuplicationSpecific.OfType<string>().ElementAt(0)); var newlist = diflist.Distinct().ToList(); bx.SourceBox.ItemsSource = newlist; }
public void SetData(Control ow, ListBox listbox, IList list, LVDMHelper helper, MenuBinds mbinds = null) { try { Owner = ow; listBox = listbox; dataList = list ?? listbox.Items; hlp = helper; MenuBinds mBinds = mbinds ?? new MenuBinds(); //マウスイベント関係 this.listBox.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(listBox_PreviewMouseLeftButtonUp); this.listBox.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(listBox_PreviewMouseLeftButtonDown); ViewUtil.ResetItemContainerStyle(listbox); listbox.ItemContainerStyle.Setters.Add(new EventSetter(Mouse.MouseEnterEvent, new MouseEventHandler(listBoxItem_MouseEnter))); //移動などのアクションはBoxExchangeEditorのものをそのまま使用する。 bx = new BoxExchangeEditor { TargetBox = listBox, TargetItemsSource = dataList }; this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.TopItem, (sender, e) => ItemsAction(() => bx.button_Top_Click(null, null)))); this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.UpItem, (sender, e) => ItemsAction(() => bx.button_Up_Click(null, null)))); this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.DownItem, (sender, e) => ItemsAction(() => bx.button_Down_Click(null, null)))); this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.BottomItem, (sender, e) => ItemsAction(() => bx.button_Bottom_Click(null, null)))); this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.SaveOrder, SaveOrder_handler, (sender, e) => e.CanExecute = NotSaved == true)); this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.RestoreOrder, (sender, e) => hlp.RestoreOrder(), (sender, e) => e.CanExecute = NotSaved == true)); this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.DragCancel, (sender, e) => DragRelease())); mBinds.SetCommandToButton(button_top, EpgCmds.TopItem); mBinds.SetCommandToButton(button_up, EpgCmds.UpItem); mBinds.SetCommandToButton(button_down, EpgCmds.DownItem); mBinds.SetCommandToButton(button_bottom, EpgCmds.BottomItem); mBinds.SetCommandToButton(button_saveItemOrder, EpgCmds.SaveOrder); mBinds.SetCommandToButton(button_reloadItem, EpgCmds.RestoreOrder); mBinds.AddInputCommand(EpgCmds.DragCancel);//アイテムのドラッグキャンセル if (mbinds == null) { mBinds.ResetInputBindings(this.Owner, this.listBox); } //コマンドだと、DragCancelしない場合に、CanExecuteを割り当てても、Handled=falseにしても、 //Keygestureが先へ伝搬してくれないので、対処療法的だけど先に処理してしまうことにする。コマンドの意味無い‥。 listBox.PreviewKeyDown += new KeyEventHandler((sender, e) => { if (Keyboard.Modifiers == ModifierKeys.None) { switch (e.Key) { case Key.Escape: if (_onDrag == true) { EpgCmds.DragCancel.Execute(null, null); //this.listBox.Items.Refresh();//壊したバインディングを修復する。モタツキ感があるので放置する。 e.Handled = true; } break; } } }); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
private void drag_drop(object sender, DragEventArgs e, Button add, Button ins) { var handler = (BoxExchangeEditor.GetDragHitItem(sender, e) == null ? add : ins); handler.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); }
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 SetContextMenuWindow(Visual owner = null, MenuSettingData data = null) { InitializeComponent(); try { this.Owner = CommonUtil.GetTopWindow(owner); if (data != null) { info = data.DeepClone(); } //共通設定画面用の設定 Action <StackPanel, StackPanel> CopyStackItem = (src, trg) => { foreach (var item in src.Children.OfType <Control>().Where(i => i is Label != true)) { var newItem = (Control)Activator.CreateInstance(item.GetType()); newItem.Style = item.Style; if (item is CheckBox) { newItem.Visibility = Visibility.Hidden; } trg.Children.Add(newItem); } }; CopyStackItem(stackPanel_menu, stackPanel_gesture); CopyStackItem(stackPanel_menu, stackPanel_gesture2); stackItems_menu = stackPanel_menu.Children.OfType <CheckBox>().ToList(); stackItems_ges1 = stackPanel_gesture.Children.OfType <CheckBox>().ToList(); stackItems_ges2 = stackPanel_gesture2.Children.OfType <CheckBox>().ToList(); //個別設定画面用の設定 this.comboBoxViewSelect.DisplayMemberPath = CommonUtil.NameOf(() => new ComboItem().Value); this.comboBoxViewSelect.SelectedValuePath = CommonUtil.NameOf(() => 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); } //細かいオプションの設定 checkBox_NoMessageKeyGesture.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.NoMessageKeyGesture)); checkBox_NoMessageDeleteAll.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.NoMessageDeleteAll)); checkBox_NoMessageDelete2.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.NoMessageDelete2)); checkBox_NoMessageAdjustRes.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.NoMessageAdjustRes)); checkBox_SetJunreToAutoAdd.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.SetJunreToAutoAdd)); checkBox_SetJunreContentToAutoAdd.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.SetJunreContentToAutoAdd)); checkBox_CancelAutoAddOff.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.CancelAutoAddOff)); checkBox_AutoAddFazySearch.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.AutoAddFazySearch)); checkBox_AutoAddSearchToolTip.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.AutoAddSearchToolTip)); checkBox_AutoAddSearchSkipSubMenu.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.AutoAddSearchSkipSubMenu)); checkBox_ReserveSearchToolTip.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.ReserveSearchToolTip)); checkBox_EpgKeyword_Trim.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.Keyword_Trim)); checkBox_CopyTitle_Trim.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.CopyTitle_Trim)); checkBox_CopyContentBasic.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.CopyContentBasic)); checkBox_InfoSearchTtile_Trim.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.InfoSearchTitle_Trim)); checkBox_SearchTtile_Trim.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.SearchTitle_Trim)); textBox_SearchURI.SetBinding(TextBox.TextProperty, CommonUtil.NameOf(() => info.SearchURI)); checkBox_NoMessageNotKEY.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.NoMessageNotKEY)); checkBox_OpenParentFolder.SetBinding(CheckBox.IsCheckedProperty, CommonUtil.NameOf(() => info.OpenParentFolder)); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
private void button_Del(BoxExchangeEditor bx, BoxExchangeEditor bx_other, List<string> src) { if (bx.TargetBox.SelectedItem == null) return; // var item1 = bx.TargetBox.SelectedItems.OfType<StringItem>().FirstOrDefault(item => item.Value == "設定"); var item2 = bx_other.TargetBox.Items.OfType<StringItem>().FirstOrDefault(item => item.Value == "設定"); if (item1 != null && item2 == null) { MessageBox.Show("設定は上部表示ボタンか右クリック表示項目のどちらかに必要です"); return; } bx.bxDeleteItems(bx.TargetBox); reLoadButtonItem(bx, src); }
private void reLoadButtonItem(BoxExchangeEditor bx, List<string> src) { var viewlist = bx.TargetBox.Items.OfType<StringItem>().Values(); var diflist = src.Except(viewlist).ToList(); diflist.Insert(0, (bx.DuplicationSpecific.First() as StringItem).Value); bx.SourceBox.ItemsSource = StringItem.Items(diflist.Distinct()); }
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 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 SetEpgView() { InitializeComponent(); if (CommonManager.Instance.NWMode == true) { stackPanel_epgArchivePeriod.IsEnabled = false; } else { checkBox_CacheKeepConnect.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"); }