Esempio n. 1
0
        protected bool mcc_chgRecSetting(ExecutedRoutedEventArgs e)
        {
            List <RecSettingData> infoList = dataList.OfType <IRecSetttingData>().Where(data => data.RecSettingInfo != null).RecSettingList();

            if (infoList.Count == 0)
            {
                return(false);
            }

            if (e.Command == EpgCmds.ChgOnPreset)
            {
                var val = Settings.Instance.RecPreset(CmdExeUtil.ReadIdData(e, 0, 0xFE)).Data;
                foreach (var data in dataList.OfType <IRecSetttingData>())
                {
                    data.RecSettingInfo = val.DeepClone();
                }
            }
            else if (e.Command == EpgCmds.ChgRecmode)
            {
                var val = (byte)CmdExeUtil.ReadIdData(e, 0, 5);
                infoList.ForEach(info => info.RecMode = val);
            }
            else if (e.Command == EpgCmds.ChgPriority)
            {
                var val = (byte)CmdExeUtil.ReadIdData(e, 1, 5);
                infoList.ForEach(info => info.Priority = val);
            }
            else if (e.Command == EpgCmds.ChgRelay)
            {
                var val = (byte)CmdExeUtil.ReadIdData(e, 0, 1);
                infoList.ForEach(info => info.TuijyuuFlag = val);
            }
            else if (e.Command == EpgCmds.ChgPittari)
            {
                var val = (byte)CmdExeUtil.ReadIdData(e, 0, 1);
                infoList.ForEach(info => info.PittariFlag = val);
            }
            else if (e.Command == EpgCmds.ChgTuner)
            {
                var val = (uint)CmdExeUtil.ReadIdData(e, 0, int.MaxValue - 1);
                infoList.ForEach(info => info.TunerID = val);
            }
            else if (e.Command == EpgCmds.ChgMarginStart)
            {
                int?offset = CmdExeUtil.ReadIdData(e);
                MenuUtil.ChangeMargin(infoList, offset == 0, offset, null, true);
            }
            else if (e.Command == EpgCmds.ChgMarginEnd)
            {
                int?offset = CmdExeUtil.ReadIdData(e);
                MenuUtil.ChangeMargin(infoList, offset == 0, null, offset, true);
            }
            else if (e.Command == EpgCmds.ChgMarginValue)
            {
                return(MenuUtil.ChangeMarginValue(infoList, CmdExeUtil.ReadIdData(e, 0, 2) == 1, this.Owner));
            }
            return(true);
        }
Esempio n. 2
0
        protected bool mcc_chgRecSetting(ExecutedRoutedEventArgs e)
        {
            List <RecSettingData> infoList = dataList.OfType <IRecSetttingData>().RecSettingList();

            if (e.Command == EpgCmds.ChgOnPreset)
            {
                return(MenuUtil.ChangeOnPreset(infoList, (uint)CmdExeUtil.ReadIdData(e, 0, 0xFE)));
            }
            else if (e.Command == EpgCmds.ChgRecmode)
            {
                return(MenuUtil.ChangeRecmode(infoList, (byte)CmdExeUtil.ReadIdData(e, 0, 5)));
            }
            else if (e.Command == EpgCmds.ChgPriority)
            {
                return(MenuUtil.ChangePriority(infoList, (byte)CmdExeUtil.ReadIdData(e, 1, 5)));
            }
            else if (e.Command == EpgCmds.ChgRelay)
            {
                return(MenuUtil.ChangeRelay(infoList, (byte)CmdExeUtil.ReadIdData(e, 0, 1)));
            }
            else if (e.Command == EpgCmds.ChgPittari)
            {
                return(MenuUtil.ChangePittari(infoList, (byte)CmdExeUtil.ReadIdData(e, 0, 1)));
            }
            else if (e.Command == EpgCmds.ChgTuner)
            {
                return(MenuUtil.ChangeTuner(infoList, (uint)CmdExeUtil.ReadIdData(e, 0, int.MaxValue - 1)));
            }
            else if (e.Command == EpgCmds.ChgMarginStart)
            {
                return(MenuUtil.ChangeMargin(infoList, CmdExeUtil.ReadIdData(e), true));
            }
            else if (e.Command == EpgCmds.ChgMarginStartValue)
            {
                return(MenuUtil.ChangeMarginValue(infoList, true, this.Owner));
            }
            else if (e.Command == EpgCmds.ChgMarginEnd)
            {
                return(MenuUtil.ChangeMargin(infoList, CmdExeUtil.ReadIdData(e), false));
            }
            else if (e.Command == EpgCmds.ChgMarginEndValue)
            {
                return(MenuUtil.ChangeMarginValue(infoList, false, this.Owner));
            }
            return(false);
        }