private void SetData() { try { ManualMenuCheckboxWorking = true; foreach (var chkbox in IsManualChkBox) { chkbox.IsChecked = info.IsManualAssign.Contains((CtxmCode)chkbox.Tag); } ManualMenuCheckboxWorking = false; checkBox_IsManualMenuCode_Checked(null, null); checkBox_NoMessageKeyGesture.IsChecked = info.NoMessageKeyGesture; checkBox_NoMessageDeleteAll.IsChecked = info.NoMessageDeleteAll; checkBox_NoMessageDelete2.IsChecked = info.NoMessageDelete2; checkBox_NoMessageAdjustRes.IsChecked = info.NoMessageAdjustRes; checkBox_CancelAutoAddOff.IsChecked = info.CancelAutoAddOff; checkBox_AutoAddFazySerach.IsChecked = info.AutoAddFazySerach; checkBox_AutoAddSerachToolTip.IsChecked = info.AutoAddSerachToolTip; checkBox_EpgKeyword_Trim.IsChecked = info.Keyword_Trim; checkBox_CopyTitle_Trim.IsChecked = info.CopyTitle_Trim; checkBox_CopyContentBasic.IsChecked = info.CopyContentBasic; checkBox_SearchTtile_Trim.IsChecked = info.SearchTitle_Trim; textBox_SearchURI.Text = info.SearchURI; checkBox_NoMessageNotKEY.IsChecked = info.NoMessageNotKEY; checkBox_OpenParentFolder.IsChecked = info.OpenParentFolder; defaultMenu = mm.GetDefaultCtxmSettingForEditor(); editMenu = info.ManualMenuItems.Clone(); for (int i = 0; i < SettingTable.Count; i++) { if (SettingTable[i].Count == 0) { continue; } MenuSettingData.CmdSaveData src = info.EasyMenuItems.Find(item => item.GetCommand() == SettingTable[i][0]); stackItems_menu[i].IsChecked = src.IsMenuEnabled; stackItems_ges1[i].IsChecked = src.IsGestureEnabled; stackItems_ges2[i].IsChecked = !src.IsGesNeedMenu; stackItems_ges1[i].Content = MenuBinds.GetInputGestureText(src.GetGestuers()) ?? ""; stackItems_ges2[i].Content = "使用する"; stackItems_ges1[i].Visibility = string.IsNullOrEmpty(stackItems_ges1[i].Content as string) ? Visibility.Hidden : Visibility.Visible; stackItems_ges2[i].Visibility = stackItems_ges1[i].Visibility; } this.listBox_Default.ItemsSource = null; this.listBox_Setting.ItemsSource = null; //初期化ボタンでSetData()使うとき用のリセット。 this.comboBoxViewSelect.ItemsSource = MenuCodeToTitle; this.comboBoxViewSelect.SelectedIndex = -1; //初期化ボタンでSetData()使うとき用のリセット。 this.comboBoxViewSelect.SelectedIndex = 7; //これでSelectionChanged発生する } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
private void SetData() { try { this.DataContext = info; ManualMenuCheckboxWorking = true; foreach (var chkbox in IsManualChkBox) { chkbox.IsChecked = info.IsManualAssign.Contains((CtxmCode)chkbox.Tag); } ManualMenuCheckboxWorking = false; checkBox_IsManualMenuCode_Checked(null, null); defaultMenu = mm.GetDefaultCtxmSettingForEditor(); editMenu = info.ManualMenuItems.DeepClone(); editMenu.ForEach(m => m.Items = m.Items.FindAll(i => defaultMenu.FindData(m.ctxmCode).Items.Contains(i))); for (int i = 0; i < SettingTable.Count; i++) { if (SettingTable[i].Count == 0) { continue; } MenuSettingData.CmdSaveData src = info.EasyMenuItems.Find(item => item.GetCommand() == SettingTable[i][0]); stackItems_menu[i].IsChecked = src.IsMenuEnabled; stackItems_ges1[i].IsChecked = src.IsGestureEnabled; stackItems_ges2[i].IsChecked = !src.IsGesNeedMenu; stackItems_ges1[i].Content = MenuBinds.GetInputGestureText(src.GetGestuers()) ?? ""; stackItems_ges2[i].Content = "使用する"; stackItems_ges1[i].Visibility = string.IsNullOrEmpty(stackItems_ges1[i].Content as string) ? Visibility.Hidden : Visibility.Visible; stackItems_ges2[i].Visibility = stackItems_ges1[i].Visibility; } this.listBox_Default.ItemsSource = null; this.listBox_Setting.ItemsSource = null; //初期化ボタンでSetData()使うとき用のリセット。 this.comboBoxViewSelect.ItemsSource = MenuCodeToTitle; this.comboBoxViewSelect.SelectedIndex = -1; //初期化ボタンでSetData()使うとき用のリセット。 this.comboBoxViewSelect.SelectedIndex = this.comboBoxViewSelect.Items.Count - 1; //これでSelectionChanged発生する } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
public void CtxmGenerateOpenFolderItems(MenuItem menu, RecSettingData recSetting = null, string additionalPath = null, bool isGestureString = true) { CtxmClearItemMenu(menu); //ツールチップのクリアがあるので先 if (menu.IsEnabled == false) { return; } bool defOutPutted = false; recSetting = recSetting == null ? new RecSettingData() : recSetting.DeepClone(); if (string.IsNullOrEmpty(additionalPath) == false) { recSetting.RecFolderList.Add(new RecFileSetInfo { RecFolder = additionalPath }); } var addFolderList = new Action <List <RecFileSetInfo>, bool, string>((fldrs, recflg, header_exp) => { //ワンセグ出力未チェックでも、フォルダ設定があれば表示する。 //ただし、デフォルトフォルダは1回だけ展開して表示する。 if (defOutPutted == false && (recflg && fldrs.Count == 0 || fldrs.Any(info => info.RecFolder == "!Default"))) { defOutPutted = true; Settings.Instance.DefRecFolders.ForEach(folder => CtxmGenerateOpenFolderItem(menu, folder, header_exp + "(デフォルト) ")); } foreach (var info in fldrs.Where(info => info.RecFolder != "!Default")) { CtxmGenerateOpenFolderItem(menu, info.RecFolder, header_exp); } }); addFolderList(recSetting.RecFolderList, true, ""); addFolderList(recSetting.PartialRecFolder, recSetting.PartialRecFlag != 0, "(ワンセグ) "); //候補が一つの時は直接メニューを実行出来るようにする CtxmPullUpSubMenu(menu); if (isGestureString && MC.WorkCmdOptions[EpgCmds.OpenFolder].IsGestureEnabled) { menu.InputGestureText = MenuBinds.GetInputGestureText(EpgCmds.OpenFolder); } }
private void CtxmConvertToMenuItems(List <CtxmItemData> src, ItemCollection dest, CtxmCode code, bool shortcutTextforListType) { dest.Clear(); src.ForEach(data => { Control item; if (data.Command == EpgCmdsEx.Separator) { item = new Separator(); } else { var menu = new MenuItem(); menu.Header = data.Header; menu.Command = (EpgCmdsEx.IsDummyCmd(data.Command) ? null : data.Command); if (menu.Command != null) { if ((shortcutTextforListType == true || (MC.WorkCmdOptions[data.Command].GesTrg & MenuCmds.GestureTrg.ToView) == MenuCmds.GestureTrg.ToView) && (MC.WorkCmdOptions.ContainsKey(data.Command) == false || MC.WorkCmdOptions[data.Command].IsGestureEnabled == true) && data.ID == 0) { menu.InputGestureText = MenuBinds.GetInputGestureText(data.Command); } } menu.CommandParameter = new EpgCmdParam(typeof(MenuItem), code, data.ID); if (data.Items.Count != 0) { CtxmConvertToMenuItems(data.Items, menu.Items, code, shortcutTextforListType); } item = menu; } item.Tag = data.Command; item.ToolTip = GetCtxmTooltip(data.Command); ToolTipService.SetShowOnDisabled(item, true); dest.Add(item); }); }
public void TabContextMenuOpen(object sender, MouseButtonEventArgs e) { var ctxm = new ContextMenuEx { IsOpen = true }; e.Handled = true; var menu = new MenuItem { Header = "自動登録画面の画面設定(_O)..." }; menu.Click += (s2, e2) => CommonManager.MainWindow.OpenSettingDialog(SettingWindow.SettingMode.ReserveSetting); ctxm.Items.Add(menu); //非表示の時は設定画面のみ if (this.IsVisible == false) { return; } ctxm.Items.Add(new Separator()); menu = new MenuItem { Header = "並びを保存する(_S)", IsEnabled = dragMover.NotSaved, InputGestureText = MenuBinds.GetInputGestureText(EpgCmds.SaveOrder) }; menu.Click += (s2, e2) => EpgCmds.SaveOrder.Execute(null, dragMover); ctxm.Items.Add(menu); menu = new MenuItem { Header = "並びを元に戻す(_Z)", IsEnabled = dragMover.NotSaved, InputGestureText = MenuBinds.GetInputGestureText(EpgCmds.RestoreOrder) }; menu.Click += (s2, e2) => EpgCmds.RestoreOrder.Execute(null, dragMover); ctxm.Items.Add(menu); }