Exemplo n.º 1
0
        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); }
        }
Exemplo n.º 2
0
        //設定画面へデフォルト値を送る
        public MenuSettingData GetDefaultMenuSettingData()
        {
            var set = new MenuSettingData();

            set.EasyMenuItems   = MC.GetDefEasyMenuSetting();
            set.ManualMenuItems = GetManualMenuSetting(DefCtxmData);
            //編集メニュー初期値の設定、差し替え
            set.ManualMenuItems.RemoveAll(item => item.ctxmCode == CtxmCode.EditChgMenu);
            set.ManualMenuItems.Add(new CtxmSetting(GetDefaultChgSubMenuCtxmData()));
            return(set);
        }
Exemplo n.º 3
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);
         }
     }
 }
Exemplo n.º 4
0
 private void button_Initialize_Click(object sender, RoutedEventArgs e)
 {
     if (Keyboard.Modifiers == ModifierKeys.Shift)
     {
         mm.SetDefaultGestures(info);
     }
     else
     {
         info = mm.GetDefaultMenuSettingData();
     }
     SetData();
 }
Exemplo n.º 5
0
 protected static void CopyData(MenuSettingData src, MenuSettingData dest)
 {
     dest.IsManualAssign       = src.IsManualAssign.ToList();
     dest.NoMessageKeyGesture  = src.NoMessageKeyGesture;
     dest.NoMessageDeleteAll   = src.NoMessageDeleteAll;
     dest.NoMessageDelete2     = src.NoMessageDelete2;
     dest.NoMessageAdjustRes   = src.NoMessageAdjustRes;
     dest.CancelAutoAddOff     = src.CancelAutoAddOff;
     dest.AutoAddFazySerach    = src.AutoAddFazySerach;
     dest.AutoAddSerachToolTip = src.AutoAddSerachToolTip;
     dest.OpenParentFolder     = src.OpenParentFolder;
     dest.Keyword_Trim         = src.Keyword_Trim;
     dest.CopyTitle_Trim       = src.CopyTitle_Trim;
     dest.CopyContentBasic     = src.CopyContentBasic;
     dest.SearchTitle_Trim     = src.SearchTitle_Trim;
     dest.SearchURI            = src.SearchURI;
     dest.NoMessageNotKEY      = src.NoMessageNotKEY;
     dest.EasyMenuItems        = src.EasyMenuItems.Clone();
     dest.ManualMenuItems      = src.ManualMenuItems.Clone();
 }
Exemplo n.º 6
0
        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); }
        }
Exemplo n.º 7
0
 //設定画面へデフォルト値を送る
 public MenuSettingData GetDefaultMenuSettingData()
 {
     var set = new MenuSettingData();
     set.EasyMenuItems = MC.GetDefEasyMenuSetting();
     set.ManualMenuItems = GetManualMenuSetting(DefCtxmData);
     //編集メニュー初期値の設定、差し替え
     set.ManualMenuItems.RemoveAll(item => item.ctxmCode == CtxmCode.EditChgMenu);
     set.ManualMenuItems.Add(new CtxmSetting(GetDefaultChgSubMenuCtxmData()));
     return set;
 }
Exemplo n.º 8
0
 private void button_Initialize_Click(object sender, RoutedEventArgs e)
 {
     info = mm.GetDefaultMenuSettingData();
     SetData();
 }
Exemplo n.º 9
0
 public static List <MenuSettingData> Clone(this IEnumerable <MenuSettingData> src)
 {
     return(MenuSettingData.Clone(src));
 }
Exemplo n.º 10
0
 protected static void CopyData(MenuSettingData src, MenuSettingData dest)
 {
     dest.IsManualMenu = src.IsManualMenu;
     dest.NoMessageKeyGesture = src.NoMessageKeyGesture;
     dest.NoMessageDeleteAll = src.NoMessageDeleteAll;
     dest.NoMessageDelete2 = src.NoMessageDelete2;
     dest.NoMessageAdjustRes = src.NoMessageAdjustRes;
     dest.CancelAutoAddOff = src.CancelAutoAddOff;
     dest.Keyword_Trim = src.Keyword_Trim;
     dest.CopyTitle_Trim = src.CopyTitle_Trim;
     dest.CopyContentBasic = src.CopyContentBasic;
     dest.SearchTitle_Trim = src.SearchTitle_Trim;
     dest.SearchURI = src.SearchURI;
     dest.NoMessageNotKEY = src.NoMessageNotKEY;
     dest.EasyMenuItems = src.EasyMenuItems.Clone();
     dest.ManualMenuItems = src.ManualMenuItems.Clone();
 }
Exemplo n.º 11
0
 protected static void CopyData(MenuSettingData src, MenuSettingData dest)
 {
     dest.IsManualAssign = src.IsManualAssign.ToList();
     dest.NoMessageKeyGesture = src.NoMessageKeyGesture;
     dest.NoMessageDeleteAll = src.NoMessageDeleteAll;
     dest.NoMessageDelete2 = src.NoMessageDelete2;
     dest.NoMessageAdjustRes = src.NoMessageAdjustRes;
     dest.CancelAutoAddOff = src.CancelAutoAddOff;
     dest.AutoAddFazySerach = src.AutoAddFazySerach;
     dest.AutoAddSerachToolTip = src.AutoAddSerachToolTip;
     dest.OpenParentFolder = src.OpenParentFolder;
     dest.Keyword_Trim = src.Keyword_Trim;
     dest.CopyTitle_Trim = src.CopyTitle_Trim;
     dest.CopyContentBasic = src.CopyContentBasic;
     dest.SearchTitle_Trim = src.SearchTitle_Trim;
     dest.SearchURI = src.SearchURI;
     dest.NoMessageNotKEY = src.NoMessageNotKEY;
     dest.EasyMenuItems = src.EasyMenuItems.Clone();
     dest.ManualMenuItems = src.ManualMenuItems.Clone();
 }
Exemplo n.º 12
0
 private void button_Initialize_Click(object sender, RoutedEventArgs e)
 {
     info = mm.GetDefaultMenuSettingData();
     SetData();
 }