Exemple #1
0
        protected override void Dispose(bool disposing)
        {
            RemoveSnapshotOverlay();

            foreach (var label in axisLabels)
            {
                label.Dispose();
            }
            axisLabels = null;

            promptSwitchView.Dispose();
            promptSwitchView = null;

            eventSwitchView.Dispose();
            eventSwitchView = null;

            snapshotSwitchView.Dispose();
            snapshotSwitchView = null;

            axis.Dispose();
            axis = null;

            axisDropLine.Dispose();
            axisDropLine = null;

            axisContainer.Dispose();
            axisContainer = null;

            globalMoodMap.Dispose();
            globalMoodMap = null;

            chartOverlay.Dispose();
            chartOverlay = null;

            chartContainer.Dispose();
            chartContainer = null;

            chartKey.Dispose();
            chartKey = null;



            dayLabelAxis.Dispose();
            dayLabelAxis = null;



            base.Dispose(disposing);
        }
Exemple #2
0
        protected void BuildView()
        {
            this.chartContainer = new UIView(new RectangleF(22f, 169.5f, 975f, 444f));
            this.chartContainer.BackgroundColor = new UIColor(18, 23, 29, 1);
            this.Add(this.chartContainer);

            this.chartOverlay       = new UIImageView(this.Bounds);
            this.chartOverlay.Image = Resources.MoodMapWindow;
            this.chartOverlay.UserInteractionEnabled = false;
            this.Add(this.chartOverlay);

            var chartFrame = new RectangleF(0, 0, this.chartContainer.Bounds.Width, this.chartContainer.Bounds.Height);

            this.globalMoodMap = new ScrollableMoodMapView(chartFrame,
                                                           ReportManager.DayStartTime,
                                                           ReportManager.DayEndTime);
            this.chartContainer.Add(this.globalMoodMap);
            this.globalMoodMap.ZoomLevelChanged += (object sender, EventArgs e) => {
                this.ZoomLevelChanged();
            };

            this.chartKey       = new UIImageView(new RectangleF(25f, 693f, 974f, 50f));
            this.chartKey.Image = Resources.MoodMapKey;
            this.Add(this.chartKey);

            this.axisContainer = new UIView(new RectangleF(this.chartContainer.Frame.X,
                                                           this.chartContainer.Frame.Y,
                                                           this.chartContainer.Frame.Width,
                                                           this.chartContainer.Frame.Height + 100));
            this.axisContainer.ClipsToBounds          = true;
            this.axisContainer.UserInteractionEnabled = false;
            this.Add(this.axisContainer);

            this.dayLabelAxis = new DayLabelAxisView(new RectangleF(this.chartContainer.Frame.X,
                                                                    this.chartContainer.Frame.Y - 20f,
                                                                    this.chartContainer.Frame.Width,
                                                                    20f), this.globalMoodMap);
            this.dayLabelAxis.UserInteractionEnabled = false;
            this.Add(this.dayLabelAxis);

            this.snapshotSwitchView          = new SnapshotToolSwitchView(new PointF(670f, 20f));
            this.snapshotSwitchView.Changed += (object sender, EventArgs e) => {
                this.ToggleSnapshotTool();
            };
            this.Add(this.snapshotSwitchView);

            this.promptSwitchView          = new PromptsSwitchView(new PointF(780f, 20f));
            this.promptSwitchView.Changed += (object sender, EventArgs e) => {
                this.TogglePrompts();
            };
            this.Add(this.promptSwitchView);

            this.eventSwitchView          = new EventsSwitchView(new PointF(890f, 20f));
            this.eventSwitchView.Changed += (object sender, EventArgs e) => {
                this.ToggleEvents();
            };
            this.Add(this.eventSwitchView);

            this.globalMoodMap.Scrolled += (object sender, EventArgs e) => {
                this.RepositionAxis();
            };
            this.globalMoodMap.DidZoom += (object sender, EventArgs e) => {
                this.ReScaleAxis();
                this.RepositionAxis();
            };
        }