Ejemplo n.º 1
0
        private void button_recFolderChg_Click(object sender, RoutedEventArgs e)
        {
            if (listView_recFolder.SelectedItem == null)
            {
                listView_recFolder.SelectedIndex = 0;
            }
            var selectInfo = listView_recFolder.SelectedItem as RecFileSetInfoView;

            if (selectInfo != null)
            {
                var setting = new RecFolderWindow {
                    Owner = CommonUtil.GetTopWindow(this)
                };
                setting.SetDefSetting(selectInfo);
                if (setting.ShowDialog() == true)
                {
                    setting.GetSetting(selectInfo);
                    listView_recFolder.Items.Refresh();
                    listView_recFolder.FitColumnWidth();
                }
            }
            else
            {
                button_recFolderAdd_Click(null, null);
            }
        }
Ejemplo n.º 2
0
 private void button_recFolderChg_Click(object sender, RoutedEventArgs e)
 {
     if (listView_recFolder.SelectedItem == null)
     {
         if (listView_recFolder.Items.Count != 0)
         {
             listView_recFolder.SelectedIndex = 0;
         }
     }
     if (listView_recFolder.SelectedItem != null)
     {
         var setting = new RecFolderWindow();
         setting.Owner = CommonUtil.GetTopWindow(this);
         var selectInfo = ((RecFileSetInfoView)listView_recFolder.SelectedItem).Info;
         setting.SetDefSetting(selectInfo);
         setting.SetPartialMode(((RecFileSetInfoView)listView_recFolder.SelectedItem).PartialRec);
         if (setting.ShowDialog() == true)
         {
             setting.GetSetting(ref selectInfo);
         }
         listView_recFolder.Items.Refresh();
     }
     else
     {
         recFolderAdd(false);
     }
 }
Ejemplo n.º 3
0
        private void button_searchKey_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new SetDefSearchSettingWindow();

            dlg.Owner = CommonUtil.GetTopWindow(this);
            EpgSearchKeyInfo setKey = searchKey.Clone();

            if (checkBox_searchServiceFromView.IsChecked == true)
            {
                setKey.serviceList = listBox_serviceView.Items.OfType <ChSet5Item>().Select(ch => (long)ch.Key).ToList();
            }
            dlg.SetDefSetting(setKey);
            if (dlg.ShowDialog() == true)
            {
                searchKey = dlg.GetSetting();
                if (checkBox_searchServiceFromView.IsChecked == true)
                {
                    var oldList    = listBox_serviceView.Items.OfType <object>().ToList();
                    var searchList = new List <object>();
                    foreach (ulong sv in searchKey.serviceList)
                    {
                        if (ChSet5.ChList.ContainsKey(sv) == true)
                        {
                            searchList.Add(ChSet5.ChList[sv]);
                        }
                    }
                    listBox_serviceView.UnselectAll();
                    listBox_serviceView.Items.RemoveItems(oldList.Where(sv => searchList.Contains(sv) == false));
                    listBox_serviceView.Items.AddItems(searchList.Where(sv => oldList.Contains(sv) == false));
                }
            }
        }
Ejemplo n.º 4
0
        private void button_chg_preset_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (comboBox_preSet.SelectedItem != null)
                {
                    var item = comboBox_preSet.SelectedItem as RecPresetItem;

                    if (item.IsCustom == true)
                    {
                        MessageBox.Show("このプリセットは変更できません");
                        return;
                    }

                    var setting = new AddPresetWindow();
                    setting.Owner = CommonUtil.GetTopWindow(this);
                    setting.SetMode(true);
                    setting.SetName(item.DisplayName);
                    if (setting.ShowDialog() == true)
                    {
                        item.DisplayName             = setting.GetName();
                        item.RecPresetData           = GetRecSetting();
                        comboBox_preSet.SelectedItem = null;
                        comboBox_preSet.SelectedItem = item;
                        SavePreset();
                    }
                }
            }
            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();

                //個別設定画面用の設定
                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.º 6
0
 public static void KeyDown_Escape_Close(object sender, KeyEventArgs e)
 {
     if (e.Handled == false && e.Key == Key.Escape && e.IsRepeat == false)
     {
         e.Handled = true;
         var win = CommonUtil.GetTopWindow(sender as Visual);
         if (win != null)
         {
             win.Close();
         }
     }
 }
Ejemplo n.º 7
0
 public static void KeyDown_Escape_Close(object sender, KeyEventArgs e)
 {
     if (e.Handled == false && Keyboard.Modifiers == ModifierKeys.None && e.Key == Key.Escape)
     {
         e.Handled = true;
         var win = CommonUtil.GetTopWindow(sender as Visual);
         if (win != null)
         {
             win.Close();
         }
     }
 }
Ejemplo n.º 8
0
        private void button_recFolderAdd_Click(object sender, RoutedEventArgs e)
        {
            var setting = new RecFolderWindow {
                Owner = CommonUtil.GetTopWindow(this)
            };

            if (setting.ShowDialog() == true)
            {
                listView_recFolder.ScrollIntoViewLast(setting.GetSetting());
                listView_recFolder.FitColumnWidth();
            }
        }
Ejemplo n.º 9
0
 public static bool?OpenRecInfoDialog(RecFileInfo info, Control Owner)
 {
     try
     {
         var dlg = new RecInfoDescWindow();
         dlg.Owner = CommonUtil.GetTopWindow(Owner);
         cmd.SendGetRecInfo(info.ID, ref info);//***
         dlg.SetRecInfo(info);
         return(dlg.ShowDialog());
     }
     catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
     return(null);
 }
Ejemplo n.º 10
0
 public static bool?OpenEpgReserveDialog(EpgEventInfo Data, Control Owner, byte epgInfoOpenMode = 0)
 {
     try
     {
         var dlg = new AddReserveEpgWindow();
         dlg.Owner = CommonUtil.GetTopWindow(Owner);
         dlg.SetEventInfo(Data);
         dlg.SetOpenMode(epgInfoOpenMode);
         return(dlg.ShowDialog());
     }
     catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
     return(null);
 }
Ejemplo n.º 11
0
        protected virtual void mc_MenuSetting(object sender, ExecutedRoutedEventArgs e)
        {
            var dlg = new SetContextMenuWindow();

            dlg.Owner = CommonUtil.GetTopWindow(Owner);
            dlg.info  = Settings.Instance.MenuSet.Clone();

            if (dlg.ShowDialog() == true)
            {
                Settings.Instance.MenuSet = dlg.info.Clone();
                Settings.SaveToXmlFile();//メニュー設定の保存
                mainWindow.RefreshMenu();
            }
        }
Ejemplo n.º 12
0
        private void button_Click(PresetEdit mode, object sender, RoutedEventArgs e)
        {
            try
            {
                var item = comboBox_preSet.SelectedItem as S;
                if (mode != PresetEdit.Add && item == null)
                {
                    return;
                }

                var setting = new AddPresetWindow {
                    Owner = CommonUtil.GetTopWindow(this)
                };
                setting.SetMode(mode, this.txt_title.Text);
                if (mode != PresetEdit.Add)
                {
                    setting.SetName(item.DisplayName);
                }
                if (setting.ShowDialog() == true)
                {
                    int index = comboBox_preSet.SelectedIndex;
                    switch (mode)
                    {
                    case PresetEdit.Add:
                        index = Items.Count(it => it.IsCustom == false);
                        var newInfo = new S {
                            DisplayName = setting.GetName(), ID = 0, Data = dView.GetData()
                        };
                        comboBox_preSet.Items.Insert(index, newInfo);
                        break;

                    case PresetEdit.Change:
                        item.DisplayName = setting.GetName();
                        item.Data        = dView.GetData();
                        break;

                    case PresetEdit.Delete:
                        index = Math.Max(0, Math.Min(index, comboBox_preSet.Items.Count - 2));
                        comboBox_preSet.Items.Remove(item);
                        break;
                    }
                    comboBox_preSet.Items.Refresh();
                    ChangeSelect(index, null, true);
                    PresetEdited(mode);
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Ejemplo n.º 13
0
 public static bool?OpenManualAutoAddDialog(ManualAutoAddData Data, Control Owner)
 {
     try
     {
         var dlg = new AddManualAutoAddWindow();
         dlg.Owner = CommonUtil.GetTopWindow(Owner);
         if (Data != null)
         {
             dlg.SetChangeMode(true);
             dlg.SetDefaultSetting(Data);
         }
         return(dlg.ShowDialog());
     }
     catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
     return(null);
 }
Ejemplo n.º 14
0
 public static bool?OpenChgReserveDialog(ReserveData Data, Control Owner, byte epgInfoOpenMode = 0)
 {
     try
     {
         var dlg = new ChgReserveWindow();
         dlg.Owner = CommonUtil.GetTopWindow(Owner);
         if (Data != null)
         {
             dlg.SetReserveInfo(Data);
             dlg.SetOpenMode(epgInfoOpenMode);
         }
         else
         {
             dlg.SetAddReserveMode();
         }
         return(dlg.ShowDialog());
     }
     catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
     return(null);
 }
Ejemplo n.º 15
0
 private void button_add_preset_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var setting = new AddPresetWindow();
         setting.Owner = CommonUtil.GetTopWindow(this);
         if (setting.ShowDialog() == true)
         {
             RecPresetItem preCust     = FindPresetItem(RecPresetItem.CustomID);
             int           insertIndex = comboBox_preSet.Items.Count + (preCust == null ? 0 : -1);
             var           newInfo     = new RecPresetItem(setting.GetName(), 0, GetRecSetting());//IDはSavePresetですぐ割り振られる。
             comboBox_preSet.Items.Insert(insertIndex, newInfo);
             comboBox_preSet.SelectedIndex = insertIndex;
             SavePreset();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
     }
 }
Ejemplo n.º 16
0
        public static bool ChgGenre(List <EpgSearchKeyInfo> infoList, Control owner = null)
        {
            try
            {
                var dlg = new SetDefSearchSettingWindow();
                dlg.Owner = CommonUtil.GetTopWindow(owner);
                dlg.SetDefSetting(infoList[0]);
                dlg.searchKey.searchKeyDescView.SetChangeMode(0);

                if (dlg.ShowDialog() == false)
                {
                    return(false);
                }

                EpgSearchKeyInfo setData = dlg.GetSetting();
                infoList.ForEach(info => info.contentList = setData.contentList.Clone());
                return(true);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
            return(false);
        }
Ejemplo n.º 17
0
        public SetPicUpCustomWindow(Visual owner = null, PicUpTitle set = null)
        {
            InitializeComponent();

            this.Owner = CommonUtil.GetTopWindow(owner);
            SetData(set);

            //テスト入力はキャンセル時も保存
            textbox_TestInput.Text = testString;
            this.Closing          += (sender, e) => testString = textbox_TestInput.Text;
            button_ok.Click       += (sender, e) => DialogResult = true;

            button_ReplaceClear.Click += (sender, e) => textBox_replaceSet.Clear();
            button_ReplaceCopy.Click  += (sender, e) => AddSetData(textBox_replaceSet, PicUpTitle.ReplaceSetDefault);
            button_TitleClear.Click   += (sender, e) => textBox_titleSet.Clear();
            button_TitleCopy.Click    += (sender, e) => AddSetData(textBox_titleSet, PicUpTitle.TitleSetDefault);

            button_TestSample.Click      += (sender, e) => textbox_TestInput.Text = testStringSample;
            button_TestClearInput.Click  += (sender, e) => textbox_TestInput.Clear();
            button_TestClearResult.Click += (sender, e) => textbox_TestResult.Clear();
        }
Ejemplo n.º 18
0
        private void item_ViewSettingClick(object sender, object param)
        {
            try
            {
                if (param == null)
                {
                    var dlg = new EpgDataViewSettingWindow();
                    dlg.Owner = CommonUtil.GetTopWindow(this);
                    dlg.SetDefSetting(this.GetViewMode());
                    dlg.SetTrySetModeEnable();
                    if (Settings.Instance.UseCustomEpgView == false)
                    {
                        dlg.SetTrySetModeOnly();
                    }
                    if (dlg.ShowDialog() == true)
                    {
                        var setInfo = new CustomEpgTabInfo();;
                        dlg.GetSetting(ref setInfo);

                        if (Settings.Instance.UseCustomEpgView == true && Settings.Instance.TryEpgSetting == false)
                        {
                            if (setInfo.ID >= 0 && setInfo.ID <= Settings.Instance.CustomEpgTabList.Count)
                            {
                                Settings.Instance.CustomEpgTabList[setInfo.ID] = setInfo;
                                Settings.SaveToXmlFile();
                            }
                        }

                        this.SetViewMode(setInfo);
                        viewCtrl.UpdateInfo();
                    }
                }
                else
                {
                    CustomEpgTabInfo setInfo = param as CustomEpgTabInfo;
                    this.SetViewMode(setInfo);
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Ejemplo n.º 19
0
        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);
        }
Ejemplo n.º 20
0
        public static bool ChangeBulkSet(List <RecSettingData> infoList, Control owner = null, bool pgAll = false)
        {
            try
            {
                var dlg = new Setting.SetDefRecSettingWindow();
                dlg.Owner = CommonUtil.GetTopWindow(owner);
                dlg.SetSettingMode("まとめて録画設定を変更");
                dlg.recSettingView.SetDefSetting(infoList[0], pgAll == true);
                dlg.recSettingView.SetViewMode(pgAll != true);

                if (dlg.ShowDialog() == false)
                {
                    return(false);
                }

                RecSettingData setData = dlg.recSettingView.GetRecSetting();

                infoList.ForEach(info => setData.CopyTo(info));
                return(true);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
            return(false);
        }
Ejemplo n.º 21
0
        private void recFolderAdd(bool partialRec)
        {
            var setting = new RecFolderWindow();

            setting.Owner = CommonUtil.GetTopWindow(this);
            setting.SetPartialMode(partialRec);
            if (setting.ShowDialog() == true)
            {
                var setInfo = new RecFileSetInfo();
                setting.GetSetting(ref setInfo);
                foreach (RecFileSetInfoView info in listView_recFolder.Items)
                {
                    if (info.PartialRec == partialRec &&
                        String.Compare(setInfo.RecFolder, info.RecFolder, true) == 0 &&
                        String.Compare(setInfo.WritePlugIn, info.WritePlugIn, true) == 0 &&
                        String.Compare(setInfo.RecNamePlugIn, info.RecNamePlugIn, true) == 0)
                    {
                        MessageBox.Show("すでに追加されています");
                        return;
                    }
                }
                listView_recFolder.Items.Add(new RecFileSetInfoView(setInfo, partialRec));
            }
        }
Ejemplo n.º 22
0
        public static bool ChangeMarginValue(List <RecSettingData> infoList, bool start, Control owner = null)
        {
            try
            {
                infoList[0].UseMargineFlag = 1;

                var dlg = new Setting.SetDefRecSettingWindow();
                dlg.Owner = CommonUtil.GetTopWindow(owner);
                dlg.SetSettingMode(start == true ? "開始マージン設定" : "終了マージン設定");
                dlg.recSettingView.SetDefSetting(infoList[0]);
                dlg.recSettingView.SetChangeMode(start == true ? 0 : 1);

                if (dlg.ShowDialog() == false)
                {
                    return(false);
                }

                RecSettingData setData = dlg.recSettingView.GetRecSetting();

                infoList.ForEach(info =>
                {
                    info.UseMargineFlag = 1;
                    if (start == true)
                    {
                        info.StartMargine = setData.StartMargine;
                    }
                    else
                    {
                        info.EndMargine = setData.EndMargine;
                    }
                });
                return(true);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
            return(false);
        }
Ejemplo n.º 23
0
        private void epgView_ViewSettingClick(EpgViewBase sender, int param)
        {
            try
            {
                EpgTabItem tab = Tabs.FirstOrDefault(ti => ti.view == sender);
                if (tab == null)
                {
                    return;
                }

                if (param < -2 || 2 < param)
                {
                    return;
                }

                CustomEpgTabInfo info = null;
                if (param == -1)
                {
                    //表示設定変更ダイアログから
                    var dlg = new EpgDataViewSettingWindow(tab.Info);
                    dlg.Owner = CommonUtil.GetTopWindow(this);
                    dlg.SetTryMode(Settings.Instance.UseCustomEpgView == false);
                    if (dlg.ShowDialog() == false)
                    {
                        return;
                    }

                    info = dlg.GetSetting();
                    if (info.Uid != tab.Uid)
                    {
                        return;                     //保険
                    }
                    //設定の保存。
                    if (Settings.Instance.UseCustomEpgView == true && Settings.Instance.TryEpgSetting == false &&
                        info.ID >= 0 && info.ID < tabInfo.Count && info.ID < Settings.Instance.CustomEpgTabList.Count)
                    {
                        tabInfo[info.ID] = info;
                        Settings.Instance.CustomEpgTabList[info.ID] = info;
                        Settings.SaveToXmlFile();
                        SettingWindow.UpdatesInfo("番組表関連の変更");
                    }

                    if (info.IsVisible == false)
                    {
                        tabControl.Items.Remove(tab);
                        return;
                    }
                }
                else if (param == -2)
                {
                    info = tabInfo.Find(tinfo => tinfo.ID == tab.Info.ID);
                    if (info == null)
                    {
                        return;
                    }
                }

                //選択用タブの選択を切り替え。
                tab_viewMode_Change(info != null ? info.ViewMode : param);

                tab.UpdateContent(info, param);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Ejemplo n.º 24
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); }
        }
Ejemplo n.º 25
0
        private void epgView_ViewSettingClick(int param)
        {
            try
            {
                var tab = tabControl.SelectedItem as EpgTabItem;
                if (tab == null)
                {
                    return;
                }

                if (param < -2 || 2 < param)
                {
                    return;
                }

                CustomEpgTabInfo info = null;
                if (param == -1)
                {
                    //表示設定変更ダイアログから
                    var dlg = new EpgDataViewSettingWindow(tab.Info);
                    dlg.Owner = CommonUtil.GetTopWindow(this);
                    dlg.SetTryMode(Settings.Instance.UseCustomEpgView == false);
                    if (dlg.ShowDialog() == false)
                    {
                        return;
                    }

                    info = dlg.GetSetting();
                    if (info.Uid != tab.Uid)
                    {
                        return;                     //保険
                    }
                    //設定の保存。
                    if (Settings.Instance.UseCustomEpgView == true && Settings.Instance.TryEpgSetting == false)
                    {
                        int idx1 = tabInfo.FindIndex(ti => ti.ID == info.ID);
                        int idx2 = Settings.Instance.CustomEpgTabList.FindIndex(ti => ti.ID == info.ID);
                        if (idx1 >= 0 && idx2 >= 0)
                        {
                            tabInfo[idx1] = info;
                            Settings.Instance.CustomEpgTabList[idx2] = info;
                            Settings.SaveToXmlFile();
                            SettingWindow.UpdatesInfo("番組表関連の変更");
                        }
                    }

                    if (info.IsVisible == false)
                    {
                        tabControl.Items.Remove(tab);
                        return;
                    }
                }
                else if (param == -2)
                {
                    info = get_tabInfo(tab.Uid);
                    if (info == null)
                    {
                        return;
                    }
                }

                //選択用タブの選択を切り替え。
                tab_viewMode_ChangeTabOnly(info != null ? info.ViewMode : param);
                tab.ChangeContent(info, param);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }