Beispiel #1
0
        public void SetWorkCmdOptions()
        {
            //ショートカット有効とメニュー連動有効を設定から読み込む
            WorkCmdOptions = new Dictionary <ICommand, CmdData>();
            foreach (var item in DefCmdOptions)
            {
                CmdData cmdData = item.Value.Copy();
                MenuSettingData.CmdSaveData cmdSave = Settings.Instance.MenuSet.EasyMenuItems.Find(data => data.GetCommand() == item.Key);
                if (cmdSave != null)
                {
                    cmdData.IsMenuEnabled    = cmdSave.IsMenuEnabled;
                    cmdData.IsGestureEnabled = cmdData.IsMenuEnabled;
                    cmdData.IsGesNeedMenu    = cmdSave.IsGesNeedMenu;

                    var gesSave = cmdSave.GetGestuers();
                    if (gesSave.Count != 0)
                    {
                        //入出力はキージェスチャだけなので、それだけ入れ替える。(キージェスチャ以外はそのまま)
                        var delList = cmdData.Gestures.OfType <KeyGesture>().ToList();
                        delList.ForEach(gs => cmdData.Gestures.Remove(gs));
                        cmdData.Gestures.AddRange(gesSave);
                        cmdData.IsGestureEnabled = cmdSave.IsGestureEnabled;
                    }
                }
                WorkCmdOptions.Add(item.Key, cmdData);
            }
        }
Beispiel #2
0
        private void button_OK_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (comboBoxViewSelect.SelectedValue != null)
                {
                    var code = (CtxmCode)this.comboBoxViewSelect.SelectedValue;
                    editMenu.FindData(code).Items = this.listBox_Setting.Items.Cast <StringItem>().ValueList();
                }

                for (int i = 0; i < SettingTable.Count; i++)
                {
                    SettingTable[i].ForEach(icmd =>
                    {
                        MenuSettingData.CmdSaveData trg = info.EasyMenuItems.Find(item => item.GetCommand() == icmd);
                        trg.IsMenuEnabled    = stackItems_menu[i].IsChecked == true;
                        trg.IsGestureEnabled = stackItems_ges1[i].IsChecked == true;
                        trg.IsGesNeedMenu    = stackItems_ges2[i].IsChecked == false;
                    });
                }

                info.IsManualAssign  = IsManualChkBox.Where(c => c.IsChecked == true).Select(c => (CtxmCode)c.Tag).ToList();
                info.ManualMenuItems = editMenu.DeepClone();

                DialogResult = true;
                return;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
            DialogResult = false;
        }
        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); }
        }
Beispiel #4
0
        public bool IsGestureDisableOnView(ICommand icmd, CtxmCode code)
        {
            if (icmd == null)
            {
                return(false);
            }

            MenuSettingData.CmdSaveData cmdData = Settings.Instance.MenuSet.EasyMenuItems.Find(data => data.GetCommand() == icmd);
            return(cmdData != null && cmdData.IsGestureEnabled == false || WorkDelGesCmdList[code].Contains(icmd));
        }
Beispiel #5
0
 //ショートカットをデフォルト値に戻す
 public void SetDefaultGestures(MenuSettingData info)
 {
     foreach (MenuCmds.CmdData item in MC.DefCmdOptions.Values.Where(item => item.IsSaveSetting == true))
     {
         MenuSettingData.CmdSaveData data = info.EasyMenuItems.Find(d => d.GetCommand() == item.Command);
         if (data != null)
         {
             data.SetGestuers(item.Gestures);
         }
     }
 }
Beispiel #6
0
        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); }
        }
        private void button_OK_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (comboBoxViewSelect.SelectedValue != null)
                {
                    var code = (CtxmCode)this.comboBoxViewSelect.SelectedValue;
                    editMenu.FindData(code).Items = this.listBox_Setting.Items.Cast <StringItem>().ValueList();
                }

                for (int i = 0; i < SettingTable.Count; i++)
                {
                    SettingTable[i].ForEach(icmd =>
                    {
                        MenuSettingData.CmdSaveData trg = info.EasyMenuItems.Find(item => item.GetCommand() == icmd);
                        trg.IsMenuEnabled    = stackItems_menu[i].IsChecked == true;
                        trg.IsGestureEnabled = stackItems_ges1[i].IsChecked == true;
                        trg.IsGesNeedMenu    = stackItems_ges2[i].IsChecked == false;
                    });
                }

                info.IsManualAssign       = IsManualChkBox.Where(c => c.IsChecked == true).Select(c => (CtxmCode)c.Tag).ToList();
                info.NoMessageKeyGesture  = (checkBox_NoMessageKeyGesture.IsChecked == true);
                info.NoMessageDeleteAll   = (checkBox_NoMessageDeleteAll.IsChecked == true);
                info.NoMessageDelete2     = (checkBox_NoMessageDelete2.IsChecked == true);
                info.NoMessageAdjustRes   = (checkBox_NoMessageAdjustRes.IsChecked == true);
                info.CancelAutoAddOff     = (checkBox_CancelAutoAddOff.IsChecked == true);
                info.AutoAddFazySerach    = (checkBox_AutoAddFazySerach.IsChecked == true);
                info.AutoAddSerachToolTip = (checkBox_AutoAddSerachToolTip.IsChecked == true);
                info.ManualMenuItems      = editMenu.Clone();
                info.Keyword_Trim         = (checkBox_EpgKeyword_Trim.IsChecked == true);
                info.CopyTitle_Trim       = (checkBox_CopyTitle_Trim.IsChecked == true);
                info.CopyContentBasic     = (checkBox_CopyContentBasic.IsChecked == true);
                info.SearchTitle_Trim     = (checkBox_SearchTtile_Trim.IsChecked == true);
                info.SearchURI            = textBox_SearchURI.Text;
                info.NoMessageNotKEY      = (checkBox_NoMessageNotKEY.IsChecked == true);
                info.OpenParentFolder     = (checkBox_OpenParentFolder.IsChecked == true);

                DialogResult = true;
                return;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
            DialogResult = false;
        }