Ejemplo n.º 1
0
        public TVGuideViewModel(IEnumerable<WebChannelGroup> groups, WebChannelGroup channelGroup, DateTime guideStart, DateTime guideEnd)
        {
            this.groups = groups;

            GuideStart = guideStart;
            GuideEnd = guideEnd;

            GroupId = channelGroup.Id;
            GroupName = channelGroup.GroupName;

            DateTime loadGuideEnd =guideEnd.Subtract(TimeSpan.FromSeconds(1)); // do not load programs that start at the end of the guid
            Channels = MPEServices.TAS.GetChannelsBasic(channelGroup.Id).Select(x => new TVGuideChannelViewModel(x, guideStart, loadGuideEnd));
        }
Ejemplo n.º 2
0
        public TVGuideViewModel(IEnumerable<WebChannelGroup> groups, WebChannelGroup channelGroup, DateTime guideStart, DateTime guideEnd)
        {
            this.groups = groups;

            GuideStart = guideStart;
            GuideEnd = guideEnd;
            HasDateSplit = GuideStart.Date != GuideEnd.Date && !(GuideEnd.Hour == 0 && GuideEnd.Minute == 0);
            if (!HasDateSplit)
            {
                FirstDayHours = (GuideEnd - GuideStart).Hours + ((double)(GuideEnd - GuideStart).Minutes / 60);
                SecondDayHours = 0;
            }
            else
            {
                FirstDayHours = (24 - GuideStart.Hour) - ((double)GuideStart.Minute / 60);
                SecondDayHours = GuideEnd.Hour + ((double)GuideEnd.Minute / 60);
            }

            GroupId = channelGroup.Id;
            GroupName = channelGroup.GroupName;

            DateTime loadGuideEnd = guideEnd.Subtract(TimeSpan.FromSeconds(1)); // do not load programs that start at the end of the guid
            Channels = Connections.Current.TAS.GetChannelsDetailed(channelGroup.Id).Select(x => new TVGuideChannelViewModel(x, guideStart, loadGuideEnd));
        }
Ejemplo n.º 3
0
        public TVGuideViewModel(IEnumerable<WebChannelGroup> groups, WebChannelGroup channelGroup, DateTime guideStart, DateTime guideEnd)
        {
            this.groups = groups;

            GuideStart = guideStart;
            GuideEnd = guideEnd;
            HasDateSplit = GuideStart.Date != GuideEnd.Date;
            if (!HasDateSplit)
            {
                FirstDayHours = (GuideEnd - GuideStart).Hours;
                SecondDayHours = 0;
            }
            else
            {
                FirstDayHours = 24 - GuideStart.Hour;
                SecondDayHours = GuideEnd.Hour;
            }

            GroupId = channelGroup.Id;
            GroupName = channelGroup.GroupName;

            DateTime loadGuideEnd = guideEnd.Subtract(TimeSpan.FromSeconds(1)); // do not load programs that start at the end of the guid
            Channels = MPEServices.TAS.GetChannelsDetailed(channelGroup.Id).Select(x => new TVGuideChannelViewModel(x, guideStart, loadGuideEnd));
        }