예제 #1
0
        protected override void SetData(bool IsAllData = false)
        {
            base.SetData(IsAllData);
            if (HasList == true)//SearchItemリストがある場合
            {
                List <SearchItem> searchList = _getSearchList(IsAllData);
                searchList = searchList == null ? new List <SearchItem>() : searchList.OfType <SearchItem>().ToList();//無くても大丈夫なはずだが一応
                OrderAdjust(searchList);
                dataList    = searchList.GetReserveList();
                eventList   = searchList.GetEventList();
                eventListEx = searchList.GetNoReserveList();
                headData    = searchList.Count == 0 ? null : searchList[0].IsReserved == true ? searchList[0].ReserveInfo as IAutoAddTargetData : searchList[0].EventInfo;
                headDataEv  = searchList.Count == 0 ? null : searchList[0].EventInfo;
                recinfoList = eventList.SelectMany(data => MenuUtil.GetRecFileInfoList(data)).ToList();
                headDataRec = MenuUtil.GetRecFileInfo(eventList.FirstOrDefault());
            }
            else
            {
                //終了済み録画データの処理
                recinfoList = dataList.OfType <ReserveDataEnd>().SelectMany(data => MenuUtil.GetRecFileInfoList(data)).ToList();
                headDataRec = recinfoList.FirstOrDefault();
                dataList.RemoveAll(data => data is ReserveDataEnd);

                eventList   = _getEpgEventList == null ? null : _getEpgEventList();
                eventList   = eventList == null ? new List <EpgEventInfo>() : eventList.OfType <EpgEventInfo>().ToList();
                eventListEx = new List <EpgEventInfo>();
                eventList.ForEach(epg =>
                {
                    if (dataList.All(res => epg.CurrentPgUID() != res.CurrentPgUID()))
                    {
                        eventListEx.Add(epg);
                    }
                });
                headData   = dataList.Count != 0 ? dataList[0] as IAutoAddTargetData : eventList.Count != 0 ? eventList[0] : null;
                headDataEv = eventList.Count != 0 ? eventList[0] as IAutoAddTargetData : dataList.Count != 0 ? dataList[0] : null;
            }
            eventList   = eventList.Distinct().ToList();
            eventListEx = eventListEx.Distinct().ToList();
            recinfoList = recinfoList.Distinct().ToList();
        }