Ejemplo n.º 1
0
        private void mc_JumpTab(CtxmCode code, bool reserveOnly = false, bool onReserveOnly = false)
        {
            if (listView_result.SelectedItem != null)
            {
                SearchItem item = lstCtrl.SelectSingleItem();

                reserveOnly |= onReserveOnly;
                if (reserveOnly && item.IsReserved == false)
                {
                    return;
                }
                if (onReserveOnly && item.ReserveInfo.IsEnabled == false)
                {
                    return;
                }

                if (mainWindow.IsVisible == false || mainWindow.WindowState == WindowState.Minimized)
                {
                    mainWindow.RestoreMinimizedWindow();
                }

                mainWindow.Dispatcher.BeginInvoke(new Action(() =>
                {
                    SetHideSearchWindow(this);
                    SearchWindow.MinimizeWindows();

                    BlackoutWindow.SelectedItem = item;
                    mainWindow.moveTo_tabItem(code);
                }));
            }
        }
Ejemplo n.º 2
0
 public EpgCmdParam(Type type, CtxmCode code = CtxmCode.EtcWindow, int id = 0, object data = null)
 {
     SourceType = type;
     Code = code;
     ID = id;
     Data = data;
 }
Ejemplo n.º 3
0
 public EpgCmdParam(Type type, CtxmCode code = CtxmCode.EtcWindow, int id = 0, object data = null)
 {
     SourceType = type;
     Code       = code;
     ID         = id;
     Data       = data;
 }
Ejemplo n.º 4
0
        public override SearchItem GetJumpTabItem(CtxmCode trg_code = CtxmCode.EpgView)
        {
            SearchItem retv   = null;
            var        cmdPrm = new cmdOption((s, e) => retv = mcs_GetJumpTabItem(trg_code), null, cmdExeType.SingleItem);

            GetExecute(cmdPrm)(null, null);
            return(retv);
        }
Ejemplo n.º 5
0
//        public CtxmData(CtxmData data) { CopyData(data, this); }

        //デフォルト定義用
        public CtxmData(CtxmCode code, List <CtxmItemData> data = null)
        {
            ctxmCode = code;
            Items    = new List <CtxmItemData>();
            if (data != null)
            {
                Items.AddRange(data);
            }
        }
Ejemplo n.º 6
0
 private void CtxmGenerateContextMenu(CtxmData data, ContextMenu ctxm, CtxmCode code, bool shortcutTextforListType)
 {
     try
     {
         ctxm.Name = code.ToString();
         CtxmConvertToMenuItems(data.Items, ctxm.Items, code, shortcutTextforListType);
     }
     catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
 }
Ejemplo n.º 7
0
 public static void JumpTab(object target, CtxmCode trg_code)
 {
     if (target == null)
     {
         return;
     }
     BlackoutWindow.SelectedData = target;
     ViewUtil.MainWindow.moveTo_tabItem(trg_code);
 }
Ejemplo n.º 8
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));
        }
Ejemplo n.º 9
0
        private CtxmData GetWorkCtxmDataView(CtxmCode code)
        {
            CtxmData ctxm    = new CtxmData(code);
            CtxmData ctxmDef = DefCtxmData[code];

            //存在するものをコピーしていく。編集メニューは常に個別設定が有効になる。
            if (Settings.Instance.MenuSet.IsManualAssign.Contains(code) == true || code == CtxmCode.EditChgMenu)
            {
                CtxmSetting ctxmEdited = Settings.Instance.MenuSet.ManualMenuItems.FindData(code);
                if (ctxmEdited == null)
                {
                    //編集サブメニューの場合は、初期無効アイテムを削除したデフォルトセッティングを返す。
                    return(code != CtxmCode.EditChgMenu ? ctxmDef.Clone() : GetDefaultChgSubMenuCtxmData());
                }

                ctxmEdited.Items.ForEach(setMenuString =>
                {
                    CtxmItemData item1 = ctxmDef.Items.Find(item => item.Header == setMenuString);
                    if (item1 != null)
                    {
                        ctxm.Items.Add(item1.Clone());
                    }
                });
            }
            else
            {
                ctxmDef.Items.ForEach(item1 =>
                {
                    if (MC.WorkCmdOptions[item1.Command].IsMenuEnabled == true)
                    {
                        ctxm.Items.Add(item1.Clone());
                    }
                });
            }

            //・連続したセパレータの除去
            for (int i = ctxm.Items.Count - 1; i >= 1; i--)
            {
                if (ctxm.Items[i].Command == EpgCmdsEx.Separator && ctxm.Items[i - 1].Command == EpgCmdsEx.Separator)
                {
                    ctxm.Items.RemoveAt(i);
                }
            }
            //・先頭と最後のセパレータ除去
            if (ctxm.Items.Count != 0 && ctxm.Items[ctxm.Items.Count - 1].Command == EpgCmdsEx.Separator)
            {
                ctxm.Items.RemoveAt(ctxm.Items.Count - 1);
            }
            if (ctxm.Items.Count != 0 && ctxm.Items[0].Command == EpgCmdsEx.Separator)
            {
                ctxm.Items.RemoveAt(0);
            }

            return(ctxm);
        }
Ejemplo n.º 10
0
        protected virtual void mcs_JumpTab(CtxmCode trg_code)
        {
            SearchItem item = mcs_GetJumpTabItem(trg_code);

            if (item != null)
            {
                BlackoutWindow.SelectedData = item;
                mainWindow.moveTo_tabItem(trg_code);
            }
            IsCommandExecuted = true;
        }
Ejemplo n.º 11
0
 public void CtxmGenerateContextMenu(ContextMenu ctxm, CtxmCode code, bool shortcutTextforListType)
 {
     try
     {
         ctxm.Name = code.ToString();
         CtxmConvertToMenuItems(WorkCtxmData[code].Items, ctxm.Items, code, shortcutTextforListType);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
     }
 }
Ejemplo n.º 12
0
 protected virtual void JumpTabAndHide(CtxmCode code, object item)
 {
     if (item == null)
     {
         return;
     }
     //
     mainWindow.RestoreMinimizedWindow();
     mainWindow.Dispatcher.BeginInvoke(new Action(() =>
     {
         SetHideWindow(this);
         MinimizeWindows();
         MenuUtil.JumpTab(item, code);
     }));
 }
Ejemplo n.º 13
0
        public static void ICmdTooltip(Object sender, ToolTipEventArgs e)
        {
            if (sender is ICommandSource == false || sender is FrameworkElement == false)
            {
                return;
            }

            ICommand icmd = (sender as ICommandSource).Command;
            CtxmCode code = ((sender as ICommandSource).CommandParameter as EpgCmdParam).Code;
            var      obj  = sender as FrameworkElement;

            obj.ToolTip = GetInputGestureTextView(icmd, code);
            if (obj.ToolTip as string == "")
            {
                e.Handled = true;
            }
        }
Ejemplo n.º 14
0
        protected virtual void JumpTabAndHide(CtxmCode code, object item)
        {
            if (item == null)
            {
                return;
            }
            //
            mainWindow.RestoreMinimizedWindow();
            mainWindow.Dispatcher.BeginInvoke(new Action(() =>
            {
                SetHideWindow(this);
                MinimizeWindows();

                BlackoutWindow.SelectedData = item;
                mainWindow.moveTo_tabItem(code);
            }));
        }
Ejemplo n.º 15
0
        public void CtxmGenerateContextMenuInfoSearch(ContextMenu ctxm, CtxmCode code)
        {
            CtxmData data = WorkCtxmData[code].DeepClone();

            if (code != CtxmCode.InfoSearchWindow)
            {
                //他画面用の簡易検索メニューを削除
                data.Items.Remove(data.Items.FirstOrDefault(d => d.Command == EpgCmds.InfoSearchTitle));

                //簡易検索用のメニューを先頭に追加
                var ISData = WorkCtxmData[CtxmCode.InfoSearchWindow].Items.Select(d => d.Command).ToList();
                data.Items.Insert(0, new CtxmItemData(EpgCmdsEx.SeparatorString, EpgCmdsEx.Separator));
                data.Items.InsertRange(0, AddInfoSearchMenu.Items.Where(item => ISData.Contains(item.Command)));
                SweepSeparators(data);
            }
            CtxmGenerateContextMenu(data, ctxm, code, true);
        }
Ejemplo n.º 16
0
        protected virtual void mcs_JumpTab(CtxmCode code, bool reserveOnly = false, bool onReserveOnly = false)
        {
            ReserveData resinfo = mcs_GetNextReserve();

            reserveOnly |= onReserveOnly;
            if (reserveOnly && resinfo == null)
            {
                return;
            }
            if (onReserveOnly && resinfo.IsEnabled == false)
            {
                return;
            }

            mcs_SetBlackoutWindow(new ReserveItem(resinfo));
            mainWindow.moveTo_tabItem(code);
            IsCommandExecuted = true;
        }
Ejemplo n.º 17
0
        private CtxmData GetWorkCtxmDataView(CtxmCode code)
        {
            CtxmData ctxm    = new CtxmData(code);
            CtxmData ctxmDef = DefCtxmData[code];

            //存在するものをコピーしていく。編集メニューは常に個別設定が有効になる。
            if (Settings.Instance.MenuSet.IsManualAssign.Contains(code) == true || code == CtxmCode.EditChgMenu)
            {
                CtxmSetting ctxmEdited = Settings.Instance.MenuSet.ManualMenuItems.FindData(code);
                if (ctxmEdited == null)
                {
                    //編集サブメニューの場合は、初期無効アイテムを削除したデフォルトセッティングを返す。
                    return(code != CtxmCode.EditChgMenu ? ctxmDef.DeepClone() : GetDefaultChgSubMenuCtxmData());
                }

                ctxmEdited.Items.ForEach(setMenuString =>
                {
                    CtxmItemData item1 = ctxmDef.Items.Find(item => item.Header == setMenuString);
                    if (item1 != null)
                    {
                        ctxm.Items.Add(item1.DeepClone());
                    }
                });
            }
            else
            {
                ctxmDef.Items.ForEach(item1 =>
                {
                    if (MC.WorkCmdOptions[item1.Command].IsMenuEnabled == true)
                    {
                        ctxm.Items.Add(item1.DeepClone());
                    }
                });
            }

            //セパレータの整理
            SweepSeparators(ctxm);

            return(ctxm);
        }
Ejemplo n.º 18
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.º 19
0
        protected virtual SearchItem mcs_GetJumpTabItem(CtxmCode trg_code)
        {
            SearchItem item = mcs_GetSearchItem();

            if (item == null)
            {
                return(null);
            }

            bool reserveOnly   = trg_code == CtxmCode.ReserveView || trg_code == CtxmCode.TunerReserveView;
            bool onReserveOnly = trg_code == CtxmCode.TunerReserveView && Settings.Instance.TunerDisplayOffReserve == false;

            if (reserveOnly && item.IsReserved == false)
            {
                return(null);
            }
            if (onReserveOnly && item.ReserveInfo.IsEnabled == false)
            {
                return(null);
            }

            return(item);
        }
Ejemplo n.º 20
0
 public bool IsGestureEnableOnView(ICommand icmd, CtxmCode code)
 {
     if (icmd == null) return false;
     return WorkDelGesCmdList[code].Contains(icmd);
 }
Ejemplo n.º 21
0
        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;

                dest.Add(item);
            });
        }
Ejemplo n.º 22
0
 public CtxmData(CtxmCode code, List <CtxmItemData> items = null)
 {
     ctxmCode = code;
     Items    = items.DeepClone() ?? new List <CtxmItemData>();
 }
Ejemplo n.º 23
0
 public void CtxmGenerateContextMenu(ContextMenu ctxm, CtxmCode code, bool shortcutTextforListType)
 {
     CtxmGenerateContextMenu(WorkCtxmData[code], ctxm, code, shortcutTextforListType);
 }
Ejemplo n.º 24
0
 public static CtxmSetting FindData(this List<CtxmSetting> list, CtxmCode code)
 {
     return list.Find(data => data.ctxmCode == code);
 }
Ejemplo n.º 25
0
 public List <ICommand> GetWorkGestureCmdList(CtxmCode code)
 {
     return(WorkGestureCmdList[code].ToList());
 }
Ejemplo n.º 26
0
 public List <ICommand> GetViewMenuCmdList(CtxmCode code)
 {
     return(DefCtxmCmdList[code].ToList());
 }
Ejemplo n.º 27
0
 protected virtual void mcs_JumpTab(CtxmCode trg_code)
 {
     MenuUtil.JumpTab(mcs_GetJumpTabItem(trg_code), trg_code);
     IsCommandExecuted = true;
 }
Ejemplo n.º 28
0
 public virtual SearchItem GetJumpTabItem(CtxmCode trg_code = CtxmCode.EpgView)
 {
     return(null);
 }
Ejemplo n.º 29
0
 public void moveTo_tabItem(CtxmCode code)
 {
     TabItem tab;
     switch (code)
     {
         case CtxmCode.ReserveView:
             tab = this.tabItem_reserve;
             break;
         case CtxmCode.TunerReserveView:
             tab = this.tabItem_tunerReserve;
             break;
         default://CtxmCode.EpgView
             tab = this.tabItem_epg;
             break;
     }
     BlackoutWindow.NowJumpTable = true;
     new BlackoutWindow(this).showWindow(tab.Header.ToString());
     this.Focus();//チューナ画面やEPG画面でのフォーカス対策。とりあえずこれで解決する。
     tab.IsSelected = false;//必ずOnVisibleChanged()を発生させるため。
     tab.IsSelected = true;
 }
Ejemplo n.º 30
0
 private void mc_JumpTab(CtxmCode trg_code)
 {
     lstCtrl.SelectSingleItem();
     JumpTabAndHide(trg_code, dic_mc[selectedType].GetJumpTabItem(trg_code));
 }
Ejemplo n.º 31
0
 public static string GetInputGestureTextView(ICommand icmd, CtxmCode code)
 {
     return((mm.IsGestureDisableOnView(icmd, code) == true ? null : GetInputGestureText(icmd)) ?? "");
 }
Ejemplo n.º 32
0
 public MenuBinds()
 {
     View = CtxmCode.EtcWindow;
 }
Ejemplo n.º 33
0
 public List<ICommand> GetWorkGestureCmdList(CtxmCode code)
 {
     return WorkGestureCmdList[code].ToList();
 }
Ejemplo n.º 34
0
 //        public CtxmData(CtxmData data) { CopyData(data, this); }
 //デフォルト定義用
 public CtxmData(CtxmCode code, List<CtxmItemData> data = null)
 {
     ctxmCode= code;
     Items = new List<CtxmItemData>();
     if (data != null) Items.AddRange(data);
 }
Ejemplo n.º 35
0
 private void mc_JumpTab(CtxmCode trg_code)
 {
     lstCtrl.SelectSingleItem();
     JumpTabAndHide(trg_code, mc.GetJumpTabItem(trg_code));
 }
Ejemplo n.º 36
0
        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);
                    CtxmConvertToMenuItems(data.Items, menu.Items, code, shortcutTextforListType);
                    item = menu;
                }
                item.Name = data.Name;
                item.Tag = data.Command;
                item.ToolTip = GetCtxmTooltip(data.Command);
                ToolTipService.SetShowOnDisabled(item, true);

                dest.Add(item);
            });
        }
Ejemplo n.º 37
0
 private void mc_JumpTab(CtxmCode trg_code)
 {
     JumpTabAndHide(trg_code, mc.GetJumpTabItem(trg_code));
 }
Ejemplo n.º 38
0
        private CtxmData GetWorkCtxmDataView(CtxmCode code)
        {
            CtxmData ctxm = new CtxmData(code);
            CtxmData ctxmDef = DefCtxmData[code];

            //存在するものをコピーしていく。編集メニューは常に個別設定が有効になる。
            if (Settings.Instance.MenuSet.IsManualMenu == true || code == CtxmCode.EditChgMenu)
            {
                CtxmSetting ctxmEdited = Settings.Instance.MenuSet.ManualMenuItems.FindData(code);
                if (ctxmEdited == null)
                {
                    //編集サブメニューの場合は、初期無効アイテムを削除したデフォルトセッティングを返す。
                    return code != CtxmCode.EditChgMenu ? ctxmDef.Clone() : GetDefaultChgSubMenuCtxmData();
                }

                ctxmEdited.Items.ForEach(setMenuString =>
                {
                    CtxmItemData item1 = ctxmDef.Items.Find(item => item.Header == setMenuString);
                    if (item1 != null)
                    {
                        ctxm.Items.Add(item1.Clone());
                    }
                });
            }
            else
            {
                ctxmDef.Items.ForEach(item1 =>
                {
                    if (MC.WorkCmdOptions[item1.Command].IsMenuEnabled == true)
                    {
                        ctxm.Items.Add(item1.Clone());
                    }
                });
            }

            //・連続したセパレータの除去
            for (int i = ctxm.Items.Count - 1; i >= 1; i--)
            {
                if (ctxm.Items[i].Command == EpgCmdsEx.Separator && ctxm.Items[i - 1].Command == EpgCmdsEx.Separator)
                {
                    ctxm.Items.RemoveAt(i);
                }
            }
            //・先頭と最後のセパレータ除去
            if (ctxm.Items.Count != 0 && ctxm.Items[ctxm.Items.Count - 1].Command == EpgCmdsEx.Separator)
            {
                ctxm.Items.RemoveAt(ctxm.Items.Count - 1);
            }
            if (ctxm.Items.Count != 0 && ctxm.Items[0].Command == EpgCmdsEx.Separator)
            {
                ctxm.Items.RemoveAt(0);
            }

            return ctxm;
        }
Ejemplo n.º 39
0
 public static CtxmSetting FindData(this List <CtxmSetting> list, CtxmCode code)
 {
     return(list.Find(data => data.ctxmCode == code));
 }
Ejemplo n.º 40
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);
        }