예제 #1
0
파일: Game.cs 프로젝트: Grigann/PopWeb
        /// <summary>
        /// Initializes the chart information
        /// </summary>
        public virtual void InitializeChartInfos()
        {
            var chartHelper = new ChartHelper<GamingSession>();

            this.ChartIntervalType = chartHelper.ComputeIntervalType(this.GamingSessions);

            var chartSessions = chartHelper.ExtractChartSessions(this.GamingSessions, this.ChartIntervalType);

            this.FirstChartDate = chartSessions.Count == 0 ? DateTime.Today : chartSessions.Keys.Min();
            this.GamingSessionForCharts = chartHelper.ComputeSessionsChart(chartSessions);
            this.GamingSessionXAxisTicks = chartHelper.ComputeXAxisTicks(chartSessions);
            this.GamingSessionYAxisTicks = chartHelper.ComputeYAxisTicks(chartSessions);
        }
예제 #2
0
파일: TvSerie.cs 프로젝트: Grigann/PopWeb
        /// <summary>
        /// Initializes the chart information
        /// </summary>
        public virtual void InitializeChartInfos()
        {
            var chartHelper = new ChartHelper<TvWatchingSession>();

            var watchingSessions = this.Seasons.SelectMany(x => x.Episodes).SelectMany(x => x.WatchingSessions).ToList();
            this.ChartIntervalType = chartHelper.ComputeIntervalType(watchingSessions);

            var chartSessions = chartHelper.ExtractChartSessions(watchingSessions, this.ChartIntervalType);

            this.FirstChartDate = chartSessions.Count == 0 ? DateTime.Today : chartSessions.Keys.Min();
            this.WatchingSessionForCharts = chartHelper.ComputeSessionsChart(chartSessions);
            this.WatchingSessionXAxisTicks = chartHelper.ComputeXAxisTicks(chartSessions);
            this.WatchingSessionYAxisTicks = chartHelper.ComputeYAxisTicks(chartSessions);
        }