Ejemplo n.º 1
0
        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); }
        }
Ejemplo n.º 2
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); }
        }
Ejemplo n.º 3
0
 private void button_allDefault_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         editMenu = mm.GetDefaultMenuSettingData().ManualMenuItems;
         if (comboBoxViewSelect.SelectedValue != null)
         {
             var code = (CtxmCode)this.comboBoxViewSelect.SelectedValue;
             this.listBox_Setting.Items.Clear();
             this.listBox_Setting.Items.AddItems(StringItem.Items(editMenu.FindData(code).Items));
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
 }
Ejemplo n.º 4
0
        private void comboBoxViewSelect_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                if (comboBoxViewSelect.SelectedIndex == -1)
                {
                    return;
                }

                if (this.listBox_Default.ItemsSource != null)
                {
                    CtxmCode oldcode = ((ComboItem)e.RemovedItems[0]).Key;
                    editMenu.FindData(oldcode).Items = this.listBox_Setting.Items.Cast <StringItem>().ValueList();
                }
                CtxmCode newcode = ((ComboItem)e.AddedItems[0]).Key;
                this.listBox_Default.ItemsSource = StringItem.Items(defaultMenu.FindData(newcode).Items);
                this.listBox_Setting.Items.Clear();
                this.listBox_Setting.Items.AddItems(StringItem.Items(editMenu.FindData(newcode).Items));

                switch (newcode)
                {
                case CtxmCode.EpgView:
                    textblocExp.Text = "・「番組表(標準モード)へジャンプ」は標準モードでは非表示になります。";
                    break;

                case CtxmCode.EditChgMenu:
                    textblocExp.Text = "・[編集]サブメニューは「表示項目は個別設定を使用する」の設定に関わらず、常にこの個別設定が反映されます。\r\n\r\n"
                                       + "・「自動登録有効」「予約モード変更」「まとめてジャンル絞り込みを変更」は該当画面のみ表示されます。\r\n\r\n"
                                       + "・「イベントリレー追従」「ぴったり(?)録画」は、プログラム自動予約登録画面では表示されません。";
                    break;

                default:
                    textblocExp.Text = "";
                    break;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Ejemplo n.º 5
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); }
        }