Exemple #1
0
        public void Refresh(MoodReport report, ZoomLevel zoomLevel)
        {
            Console.WriteLine("Refresh data  - {0}", zoomLevel.Name);
            this.MoodReport       = report;
            this.ReportStartLocal = ReportManager.GetReportStartLocal(report);
            this.ReportEndLocal   = ReportManager.GetReportEndLocal(report);
            this.DefaultZoomLevel = zoomLevel;
            this.SetZoomLevel(zoomLevel);
            this.LoadImages();

            if (this.eventMarkersVisible)
            {
                BuildEventMarkers();
            }
            else
            {
                this.ClearEventMarkers();
            }
            if (this.promptMarkersVisible)
            {
                BuildPromptMarkers();
            }
            else
            {
                this.ClearPromptMarkers();
            }

            var eventNow = DateTime.UtcNow.ToLocalTime(ApplicationState.Current.EventTimeOffset);

            var offset = eventNow < this.ReportEndLocal ? ChartHelper.ToXPos(this.ReportStartLocal,
                                                                             this.ReportEndLocal,
                                                                             eventNow,
                                                                             this.CurrentRenderLevel.DayImageWidth,
                                                                             ReportManager.DayStartTime,
                                                                             ReportManager.DayEndTime,
                                                                             this.CurrentRenderLevel.DayMarkerWidth)
                         - this.Bounds.Size.Width / 2

                                :this.ContentSize.Width - this.Bounds.Size.Width;

            if (offset > 0)
            {
                this.SetContentOffset(new PointF(offset, 0), true);
            }

            ZoomToDefault();
        }
Exemple #2
0
 protected DateTime?GetCurrentSnapshotTime()
 {
     return(ChartHelper.ToCurrentTime(ReportManager.GetReportStartLocal(this.report), ReportManager.GetReportEndLocal(this.report), GetCurrentXPosition(), this.globalMap.CurrentRenderLevel));
 }
Exemple #3
0
 protected void SetCurrentReport(MoodReport report)
 {
     this.CurrentReport    = report;
     this.ReportStartLocal = ReportManager.GetReportStartLocal(report);
     this.ReportEndLocal   = ReportManager.GetReportEndLocal(report);
 }