示例#1
0
 protected virtual void MoveToReserveItem(ReserveData target, bool IsMarking)
 {
 }
示例#2
0
        protected virtual ReserveViewItem AddReserveViewItem(ReserveData resInfo, ref ProgramViewItem refPgItem, bool SearchEvent = false)
        {
            //LimitedStart()の関係で判定出来ないものを除外
            if (timeList.Any() == false || resInfo.IsManual && resInfo.IsOver(timeList[0]) && resInfo.OnTimeBaseOnAir(timeList[0]) > 0)
            {
                return(null);
            }

            //マージン適用前
            DateTime startTime    = GetViewTime(LimitedStart(resInfo));
            DateTime chkStartTime = startTime.Date.AddHours(startTime.Hour);

            //離れた時間のプログラム予約など、番組表が無いので表示不可
            int index = timeList.BinarySearch(chkStartTime);

            if (index < 0)
            {
                return(null);
            }

            var resItem = new ReserveViewItem(resInfo)
            {
                EpgSettingIndex = viewInfo.EpgSettingIndex, ViewMode = viewMode
            };

            (resInfo is ReserveDataEnd ? recinfoList : reserveList).Add(resItem);

            //予約情報から番組情報を特定し、枠表示位置を再設定する
            refPgItem = null;
            programList.TryGetValue(resInfo.CurrentPgUID(), out refPgItem);
            if (refPgItem == null && SearchEvent == true)
            {
                EpgEventInfo epgInfo;
                if (viewData.EventUIDList.TryGetValue(resInfo.CurrentPgUID(), out epgInfo))
                {
                    EpgEventInfo epgRefInfo = epgInfo.GetGroupMainEvent(viewData.EventUIDList);
                    if (epgRefInfo != null)
                    {
                        programList.TryGetValue(epgRefInfo.CurrentPgUID(), out refPgItem);
                    }
                }
            }

            //EPG予約の場合は番組の外側に予約枠が飛び出さないようなマージンを作成。
            double StartMargin = resInfo.IsEpgReserve == false ? resInfo.StartMarginResActual : Math.Min(0, resInfo.StartMarginResActual);
            double EndMargin   = resInfo.IsEpgReserve == false ? resInfo.EndMarginResActual : Math.Min(0, resInfo.EndMarginResActual);

            //duationがマイナスになる場合は後で処理される
            double duration = resInfo.DurationSecond + StartMargin + EndMargin;

            if (resInfo.IsEpgReserve && resInfo.DurationSecond != 0 && refPgItem != null)
            {
                resItem.Height = Math.Max(refPgItem.Height * duration / resInfo.DurationSecond, ViewUtil.PanelMinimumHeight);
                resItem.TopPos = refPgItem.TopPos + Math.Min(refPgItem.Height - resItem.Height, refPgItem.Height * (-StartMargin) / resInfo.DurationSecond);
            }
            else
            {
                //週間番組表のプログラム録画の予約前マージン対応があるので、マージンの反映はGetViewTime()の後
                startTime      = GetViewTime(resInfo.PgStartTime).AddSeconds(-StartMargin);
                resItem.TopPos = this.EpgStyle().MinHeight *(index * 60 + (startTime - chkStartTime).TotalMinutes);
                resItem.Height = Math.Max(duration * this.EpgStyle().MinHeight / 60 + Math.Min(resItem.TopPos, 0), ViewUtil.PanelMinimumHeight);
                resItem.TopPos = Math.Max(resItem.TopPos, 0);
            }
            return(resItem);
        }
示例#3
0
 protected override void MoveToReserveItem(ReserveData target, bool IsMarking)
 {
     uint ID = target.ReserveID;
     ReserveViewItem target_item = this.reserveList.Find(item => item.ReserveInfo.ReserveID == ID);
     this.programView.ScrollToFindItem(target_item, IsMarking);
 }