Index: Core/Components/src/Core.Components.Charting.Forms/Core.Components.Charting.Forms.csproj =================================================================== diff -u -r25bdf707d3cd78e182705e16371a376222b7ee79 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/src/Core.Components.Charting.Forms/Core.Components.Charting.Forms.csproj (.../Core.Components.Charting.Forms.csproj) (revision 25bdf707d3cd78e182705e16371a376222b7ee79) +++ Core/Components/src/Core.Components.Charting.Forms/Core.Components.Charting.Forms.csproj (.../Core.Components.Charting.Forms.csproj) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -39,6 +39,7 @@ Properties\GlobalAssembly.cs + @@ -48,6 +49,10 @@ + + {3bbfd65b-b277-4e50-ae6d-bd24c3434609} + Core.Common.Base + {9a2d67e6-26ac-4d17-b11a-2b4372f2f572} Core.Common.Controls Index: Core/Components/src/Core.Components.Charting.Forms/IChartControl.cs =================================================================== diff -u --- Core/Components/src/Core.Components.Charting.Forms/IChartControl.cs (revision 0) +++ Core/Components/src/Core.Components.Charting.Forms/IChartControl.cs (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Core.Components.Charting.Data; + +namespace Core.Components.Charting.Forms +{ + /// + /// Interface describing general chart interactions. + /// + public interface IChartControl + { + /// + /// Gets a value indicating whether or not the chart can be panned with the left mouse button. + /// + bool IsPanningEnabled { get; } + + /// + /// Gets a value indicating whether or not the chart can be zoomed by rectangle with the left mouse button. + /// + bool IsRectangleZoomingEnabled { get; } + + /// + /// Gets or sets the data to show in the . + /// + ChartData Data { get; set; } + + /// + /// Toggles panning of the . Panning is invoked by clicking the left mouse-button. + /// + void TogglePanning(); + + /// + /// Toggles rectangle zooming of the . Rectangle zooming is invoked by clicking the left mouse-button. + /// + void ToggleRectangleZooming(); + + /// + /// Zooms to a level so that everything is in view. + /// + void ZoomToAll(); + } +} \ No newline at end of file Index: Core/Components/src/Core.Components.Charting.Forms/IChartView.cs =================================================================== diff -u -r25bdf707d3cd78e182705e16371a376222b7ee79 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/src/Core.Components.Charting.Forms/IChartView.cs (.../IChartView.cs) (revision 25bdf707d3cd78e182705e16371a376222b7ee79) +++ Core/Components/src/Core.Components.Charting.Forms/IChartView.cs (.../IChartView.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -24,13 +24,13 @@ namespace Core.Components.Charting.Forms { /// - /// Interface describing that contain a as one of its components. + /// Interface describing that contain a as one of its components. /// public interface IChartView : IView { /// - /// Gets the set for this . + /// Gets the set for this . /// - IChart Chart { get; } + IChartControl Chart { get; } } } \ No newline at end of file Index: Core/Components/src/Core.Components.Charting/Core.Components.Charting.csproj =================================================================== diff -u -rc8848af0c6f8780634dcce2013e606f090da6577 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/src/Core.Components.Charting/Core.Components.Charting.csproj (.../Core.Components.Charting.csproj) (revision c8848af0c6f8780634dcce2013e606f090da6577) +++ Core/Components/src/Core.Components.Charting/Core.Components.Charting.csproj (.../Core.Components.Charting.csproj) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -43,7 +43,6 @@ - Fisheye: Tag 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f refers to a dead (removed) revision in file `Core/Components/src/Core.Components.Charting/IChart.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f refers to a dead (removed) revision in file `Core/Components/src/Core.Components.DotSpatial.Forms/BaseMap.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Components/src/Core.Components.DotSpatial.Forms/Core.Components.DotSpatial.Forms.csproj =================================================================== diff -u -r3aa114b55dd6caa46890a54af64fba874497c135 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/src/Core.Components.DotSpatial.Forms/Core.Components.DotSpatial.Forms.csproj (.../Core.Components.DotSpatial.Forms.csproj) (revision 3aa114b55dd6caa46890a54af64fba874497c135) +++ Core/Components/src/Core.Components.DotSpatial.Forms/Core.Components.DotSpatial.Forms.csproj (.../Core.Components.DotSpatial.Forms.csproj) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -91,7 +91,7 @@ Properties\GlobalAssembly.cs - + Component @@ -110,6 +110,10 @@ {aa47e858-a2a7-470e-8b2d-c76ae8ed9ccd} Core.Components.DotSpatial + + {4a06df0d-5d75-4bad-a95a-a3db9b7c4ad5} + Core.Components.Gis.Forms + {318ba582-88c9-4816-a54a-a7e431461de3} Core.Components.Gis Index: Core/Components/src/Core.Components.DotSpatial.Forms/MapControl.cs =================================================================== diff -u --- Core/Components/src/Core.Components.DotSpatial.Forms/MapControl.cs (revision 0) +++ Core/Components/src/Core.Components.DotSpatial.Forms/MapControl.cs (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -0,0 +1,202 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Windows.Forms; +using Core.Common.Base; +using Core.Components.DotSpatial.Converter; +using Core.Components.DotSpatial.MapFunctions; +using Core.Components.Gis.Data; +using Core.Components.Gis.Forms; + +using DotSpatial.Controls; + +using MapFunctionPan = Core.Components.DotSpatial.MapFunctions.MapFunctionPan; + +namespace Core.Components.DotSpatial.Forms +{ + /// + /// This class describes a map view with configured projection and function mode. + /// + public sealed class MapControl : Control, IMapControl, IObserver + { + private readonly MapDataFactory mapDataFactory = new MapDataFactory(); + + private MapData data; + private Map map; + private IMapFunction mapFunctionSelectionZoom; + private MouseCoordinatesMapExtension mouseCoordinatesMapExtension; + private IMapFunction mapFunctionPanning; + + /// + /// Creates a new instance of . + /// + public MapControl() + { + InitializeMapView(); + TogglePanning(); + } + + public bool IsPanningEnabled { get; private set; } + + public bool IsRectangleZoomingEnabled { get; private set; } + public bool IsMouseCoordinatesVisible { get; private set; } + + public MapData Data + { + get + { + return data; + } + set + { + if (IsDisposed) + { + return; + } + + DetachFromData(); + data = value; + AttachToData(); + DrawFeatureSets(); + } + } + + public void ZoomToAll() + { + map.ZoomToMaxExtent(); + } + + public void TogglePanning() + { + if (!IsPanningEnabled) + { + ResetDefaultInteraction(); + map.FunctionMode = FunctionMode.Pan; + IsPanningEnabled = true; + map.Cursor = Cursors.Hand; + + if (mapFunctionPanning == null) + { + mapFunctionPanning = new MapFunctionPan(map); + } + map.ActivateMapFunction(mapFunctionPanning); + } + } + + public void ToggleRectangleZooming() + { + if (!IsRectangleZoomingEnabled) + { + ResetDefaultInteraction(); + map.FunctionMode = FunctionMode.Select; + IsRectangleZoomingEnabled = true; + + if (mapFunctionSelectionZoom == null) + { + mapFunctionSelectionZoom = new MapFunctionSelectionZoom(map); + } + map.ActivateMapFunction(mapFunctionSelectionZoom); + } + } + + public void ToggleMouseCoordinatesVisibility() + { + if (!IsMouseCoordinatesVisible) + { + mouseCoordinatesMapExtension.Activate(); + IsMouseCoordinatesVisible = true; + } + else + { + mouseCoordinatesMapExtension.Deactivate(); + IsMouseCoordinatesVisible = false; + } + } + + public void UpdateObserver() + { + DrawFeatureSets(); + } + + protected override void Dispose(bool disposing) + { + ; + map.Dispose(); + mouseCoordinatesMapExtension.Dispose(); + base.Dispose(disposing); + } + + private void ResetDefaultInteraction() + { + IsPanningEnabled = false; + IsRectangleZoomingEnabled = false; + } + + /// + /// Attaches the to the currently set , if there is any. + /// + private void AttachToData() + { + if (data != null) + { + data.Attach(this); + } + } + + /// + /// Detaches the to the currently set , if there is any. + /// + private void DetachFromData() + { + if (data != null) + { + data.Detach(this); + } + } + + private void DrawFeatureSets() + { + map.ClearLayers(); + if (data != null) + { + foreach (IMapFeatureLayer mapLayer in mapDataFactory.Create(data)) + { + map.Layers.Add(mapLayer); + } + } + } + + private void InitializeMapView() + { + map = new Map + { + ProjectionModeDefine = ActionMode.Never, + Dock = DockStyle.Fill, + FunctionMode = FunctionMode.Pan, + }; + + mouseCoordinatesMapExtension = new MouseCoordinatesMapExtension(map); + ToggleMouseCoordinatesVisibility(); + + Controls.Add(map); + } + } +} \ No newline at end of file Index: Core/Components/src/Core.Components.DotSpatial/Core.Components.DotSpatial.csproj =================================================================== diff -u -r87ecbdded83da959215bb92dab301a769b67282b -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/src/Core.Components.DotSpatial/Core.Components.DotSpatial.csproj (.../Core.Components.DotSpatial.csproj) (revision 87ecbdded83da959215bb92dab301a769b67282b) +++ Core/Components/src/Core.Components.DotSpatial/Core.Components.DotSpatial.csproj (.../Core.Components.DotSpatial.csproj) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -97,9 +97,9 @@ - + + - Fisheye: Tag 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f refers to a dead (removed) revision in file `Core/Components/src/Core.Components.DotSpatial/MapFunctionPan.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f refers to a dead (removed) revision in file `Core/Components/src/Core.Components.DotSpatial/MapFunctionSelectionZoom.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Components/src/Core.Components.DotSpatial/MapFunctions/MapFunctionPan.cs =================================================================== diff -u --- Core/Components/src/Core.Components.DotSpatial/MapFunctions/MapFunctionPan.cs (revision 0) +++ Core/Components/src/Core.Components.DotSpatial/MapFunctions/MapFunctionPan.cs (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Windows.Forms; + +using DotSpatial.Controls; + +namespace Core.Components.DotSpatial.MapFunctions +{ + /// + /// that handles events to update . + /// + public class MapFunctionPan : global::DotSpatial.Controls.MapFunctionPan + { + private readonly Cursor defaultCursor = Cursors.Default; + + /// + /// Initializes a new instance of the MapFunctionPan class. + /// + /// Any valid interface. + public MapFunctionPan(IMap map) : base(map) + { + FunctionActivated += ActivateFunction; + MouseDown += OnMouseDown; + MouseUp += OnMouseUp; + } + + private void ActivateFunction(object sender, EventArgs e) + { + Map.Cursor = defaultCursor; + } + + private void OnMouseUp(object sender, GeoMouseArgs e) + { + Map.Cursor = defaultCursor; + } + + private void OnMouseDown(object sender, GeoMouseArgs geoMouseArgs) + { + Map.Cursor = Cursors.Hand; + } + } +} \ No newline at end of file Index: Core/Components/src/Core.Components.DotSpatial/MapFunctions/MapFunctionSelectionZoom.cs =================================================================== diff -u --- Core/Components/src/Core.Components.DotSpatial/MapFunctions/MapFunctionSelectionZoom.cs (revision 0) +++ Core/Components/src/Core.Components.DotSpatial/MapFunctions/MapFunctionSelectionZoom.cs (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -0,0 +1,154 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +using DotSpatial.Controls; +using DotSpatial.Data; +using DotSpatial.Symbology; +using DotSpatial.Topology; + +using Point = System.Drawing.Point; + +namespace Core.Components.DotSpatial.MapFunctions +{ + /// + /// that can zoom into the map using left mouse clicks or rectangle dragging.. + /// + /// This is a copy of with the following changes: + /// + /// It does not zoom out on right mouse clicks. + /// It does not zoom when the location of the cursus on is equal to the location set at + /// . + /// + /// + public class MapFunctionSelectionZoom : MapFunction + { + private readonly Pen selectionPen; + private readonly Cursor defaultCursor = Cursors.Default; + private Point currentPoint; + private Coordinate geoStartPoint; + private bool isDragging; + private Point startPoint = Point.Empty; + + /// + /// Creates a new instance of . + /// + /// Any valid interface. + public MapFunctionSelectionZoom(IMap map) : base(map) + { + selectionPen = new Pen(Color.Black) + { + DashStyle = DashStyle.Dash + }; + YieldStyle = YieldStyles.LeftButton | YieldStyles.RightButton; + FunctionActivated += ActivateFunction; + } + + protected override void OnDraw(MapDrawArgs e) + { + if (isDragging) + { + var rectangle = Opp.RectangleFromPoints(startPoint, currentPoint); + rectangle.Width -= 1; + rectangle.Height -= 1; + e.Graphics.DrawRectangle(Pens.White, rectangle); + e.Graphics.DrawRectangle(selectionPen, rectangle); + } + base.OnDraw(e); + } + + protected override void OnMouseDown(GeoMouseArgs e) + { + if (e.Button == MouseButtons.Left) + { + startPoint = e.Location; + currentPoint = startPoint; + geoStartPoint = e.GeographicLocation; + isDragging = true; + Map.IsBusy = true; + Map.Cursor = Cursors.SizeNWSE; + } + base.OnMouseDown(e); + } + + protected override void OnMouseMove(GeoMouseArgs e) + { + if (isDragging) + { + int x = Math.Min(Math.Min(startPoint.X, currentPoint.X), e.X); + int y = Math.Min(Math.Min(startPoint.Y, currentPoint.Y), e.Y); + int mx = Math.Max(Math.Max(startPoint.X, currentPoint.X), e.X); + int my = Math.Max(Math.Max(startPoint.Y, currentPoint.Y), e.Y); + currentPoint = e.Location; + Map.Invalidate(new Rectangle(x, y, mx - x, my - y)); + } + base.OnMouseMove(e); + } + + protected override void OnMouseUp(GeoMouseArgs e) + { + if (!(e.Map.IsZoomedToMaxExtent && e.Button == MouseButtons.Right)) + { + e.Map.IsZoomedToMaxExtent = false; + var handled = false; + currentPoint = e.Location; + + Map.Invalidate(); + if (isDragging) + { + if (startPoint == currentPoint) + { + handled = true; + } + else if (geoStartPoint != null) + { + IEnvelope env = new Envelope(geoStartPoint.X, e.GeographicLocation.X, + geoStartPoint.Y, e.GeographicLocation.Y); + if (Math.Abs(e.X - startPoint.X) > 1 && Math.Abs(e.Y - startPoint.Y) > 1) + { + e.Map.ViewExtents = env.ToExtent(); + handled = true; + } + } + } + isDragging = false; + + if (handled == false) + { + e.Map.MapFrame.ResetExtents(); + } + } + + base.OnMouseUp(e); + Map.IsBusy = false; + Map.Cursor = defaultCursor; + } + + private void ActivateFunction(object sender, EventArgs e) + { + Map.Cursor = defaultCursor; + } + } +} \ No newline at end of file Index: Core/Components/src/Core.Components.Gis.Forms/Core.Components.Gis.Forms.csproj =================================================================== diff -u -r25bdf707d3cd78e182705e16371a376222b7ee79 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/src/Core.Components.Gis.Forms/Core.Components.Gis.Forms.csproj (.../Core.Components.Gis.Forms.csproj) (revision 25bdf707d3cd78e182705e16371a376222b7ee79) +++ Core/Components/src/Core.Components.Gis.Forms/Core.Components.Gis.Forms.csproj (.../Core.Components.Gis.Forms.csproj) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -39,10 +39,15 @@ Properties\GlobalAssembly.cs + + + {3bbfd65b-b277-4e50-ae6d-bd24c3434609} + Core.Common.Base + {9A2D67E6-26AC-4D17-B11A-2B4372F2F572} Core.Common.Controls Index: Core/Components/src/Core.Components.Gis.Forms/IMapControl.cs =================================================================== diff -u --- Core/Components/src/Core.Components.Gis.Forms/IMapControl.cs (revision 0) +++ Core/Components/src/Core.Components.Gis.Forms/IMapControl.cs (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -0,0 +1,71 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Core.Components.Gis.Data; + +namespace Core.Components.Gis.Forms +{ + /// + /// Interface describing general map interactions. + /// + public interface IMapControl + { + /// + /// Gets a value indicating whether or not the map can be panned with the left mouse button. + /// + bool IsPanningEnabled { get; } + + /// + /// Gets a value indicating whether or not the map can be zoomed by rectangle with the left mouse button. + /// + bool IsRectangleZoomingEnabled { get; } + + /// + /// Gets a value indicating whether or not the map coordinates of the mouse should be shown. + /// + bool IsMouseCoordinatesVisible { get; } + + /// + /// Gets or sets the data to show in the . + /// + MapData Data { get; set; } + + /// + /// Zooms to a level so that everything is in view. + /// + void ZoomToAll(); + + /// + /// Toggles panning of the . Panning is invoked by clicking the left mouse-button. + /// + void TogglePanning(); + + /// + /// Toggles rectangle zooming of the . Rectangle zooming is invoked by clicking the left mouse-button. + /// + void ToggleRectangleZooming(); + + /// + /// Toggles the visibility mouse coordinates of the . + /// + void ToggleMouseCoordinatesVisibility(); + } +} \ No newline at end of file Index: Core/Components/src/Core.Components.Gis.Forms/IMapView.cs =================================================================== diff -u -r86e717a5477d55d1c4351f2857a1d76e220a3ab4 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/src/Core.Components.Gis.Forms/IMapView.cs (.../IMapView.cs) (revision 86e717a5477d55d1c4351f2857a1d76e220a3ab4) +++ Core/Components/src/Core.Components.Gis.Forms/IMapView.cs (.../IMapView.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -24,13 +24,13 @@ namespace Core.Components.Gis.Forms { /// - /// Interface describing that contain a as one of its components. + /// Interface describing that contain a as one of its components. /// public interface IMapView : IView { /// - /// Gets the set for this . + /// Gets the set for this . /// - IMap Map { get; } + IMapControl Map { get; } } } \ No newline at end of file Index: Core/Components/src/Core.Components.Gis/Core.Components.Gis.csproj =================================================================== diff -u -r295f682376c0fdfe225ce196a5d654964a3c81bd -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/src/Core.Components.Gis/Core.Components.Gis.csproj (.../Core.Components.Gis.csproj) (revision 295f682376c0fdfe225ce196a5d654964a3c81bd) +++ Core/Components/src/Core.Components.Gis/Core.Components.Gis.csproj (.../Core.Components.Gis.csproj) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -48,7 +48,6 @@ - Fisheye: Tag 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f refers to a dead (removed) revision in file `Core/Components/src/Core.Components.Gis/IMap.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f refers to a dead (removed) revision in file `Core/Components/src/Core.Components.OxyPlot.Forms/BaseChart.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Components/src/Core.Components.OxyPlot.Forms/ChartControl.cs =================================================================== diff -u --- Core/Components/src/Core.Components.OxyPlot.Forms/ChartControl.cs (revision 0) +++ Core/Components/src/Core.Components.OxyPlot.Forms/ChartControl.cs (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -0,0 +1,159 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using Core.Common.Base; +using Core.Components.Charting.Forms; +using Core.Components.Charting.Data; +using Core.Components.OxyPlot.Converter; +using OxyPlot.WindowsForms; + +namespace Core.Components.OxyPlot.Forms +{ + /// + /// This class describes a plot view with configured representation of axes. + /// + public sealed class ChartControl : Control, IObserver, IChartControl + { + private readonly SeriesFactory seriesFactory = new SeriesFactory(); + + private ChartData data; + + private LinearPlotView view; + private DynamicPlotController controller; + + /// + /// Creates a new instance of . + /// + public ChartControl() + { + InitializePlotView(); + MinimumSize = new Size(50, 75); + } + + /// + /// Attaches the to the currently set , if there is any. + /// + private void AttachToData() + { + if (data != null) + { + data.Attach(this); + } + } + + /// + /// Detaches the to the currently set , if there is any. + /// + private void DetachFromData() + { + if (data != null) + { + data.Detach(this); + } + } + + /// + /// Initialize the for the . + /// + private void InitializePlotView() + { + view = new LinearPlotView(); + controller = new DynamicPlotController(); + view.Controller = controller; + Controls.Add(view); + } + + /// + /// Draws series based on the currently set . + /// + private void DrawSeries() + { + view.Model.Series.Clear(); + if (data != null) + { + foreach (var series in seriesFactory.Create(data)) + { + view.Model.Series.Add(series); + } + } + view.InvalidatePlot(true); + } + + #region IChart + + public bool IsPanningEnabled + { + get + { + return controller.IsPanningEnabled; + } + } + + public bool IsRectangleZoomingEnabled + { + get + { + return controller.IsRectangleZoomingEnabled; + } + } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ChartData Data + { + get + { + return data; + } + set + { + DetachFromData(); + data = value; + AttachToData(); + DrawSeries(); + } + } + + public void TogglePanning() + { + controller.TogglePanning(); + } + + public void ToggleRectangleZooming() + { + controller.ToggleRectangleZooming(); + } + + public void ZoomToAll() + { + view.ZoomToAll(); + } + + public void UpdateObserver() + { + DrawSeries(); + } + + #endregion + } +} \ No newline at end of file Index: Core/Components/src/Core.Components.OxyPlot.Forms/Core.Components.OxyPlot.Forms.csproj =================================================================== diff -u -rc8848af0c6f8780634dcce2013e606f090da6577 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/src/Core.Components.OxyPlot.Forms/Core.Components.OxyPlot.Forms.csproj (.../Core.Components.OxyPlot.Forms.csproj) (revision c8848af0c6f8780634dcce2013e606f090da6577) +++ Core/Components/src/Core.Components.OxyPlot.Forms/Core.Components.OxyPlot.Forms.csproj (.../Core.Components.OxyPlot.Forms.csproj) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -53,7 +53,7 @@ Properties\GlobalAssembly.cs - + Component @@ -82,6 +82,10 @@ Core.Common.Version False + + {2465cca1-c505-4827-9454-4fd5fd9194cd} + Core.Components.Charting.Forms + {516EBC95-B8F2-428C-B7F6-733F01BF8FDD} Core.Components.Charting Index: Core/Components/src/Core.Components.OxyPlot.Forms/LinearPlotView.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/src/Core.Components.OxyPlot.Forms/LinearPlotView.cs (.../LinearPlotView.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Components/src/Core.Components.OxyPlot.Forms/LinearPlotView.cs (.../LinearPlotView.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -44,8 +44,8 @@ { Axes = { - CreateAxis(Resources.BaseChart_XAxisTitle, AxisPosition.Bottom), - CreateAxis(Resources.BaseChart_YAxisTitle, AxisPosition.Left) + CreateAxis(Resources.ChartControl_XAxisTitle, AxisPosition.Bottom), + CreateAxis(Resources.ChartControl_YAxisTitle, AxisPosition.Left) } }; Index: Core/Components/src/Core.Components.OxyPlot.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rc8848af0c6f8780634dcce2013e606f090da6577 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/src/Core.Components.OxyPlot.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision c8848af0c6f8780634dcce2013e606f090da6577) +++ Core/Components/src/Core.Components.OxyPlot.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -63,18 +63,18 @@ /// /// Looks up a localized string similar to L. /// - public static string BaseChart_XAxisTitle { + public static string ChartControl_XAxisTitle { get { - return ResourceManager.GetString("BaseChart_XAxisTitle", resourceCulture); + return ResourceManager.GetString("ChartControl_XAxisTitle", resourceCulture); } } /// /// Looks up a localized string similar to Hoogte. /// - public static string BaseChart_YAxisTitle { + public static string ChartControl_YAxisTitle { get { - return ResourceManager.GetString("BaseChart_YAxisTitle", resourceCulture); + return ResourceManager.GetString("ChartControl_YAxisTitle", resourceCulture); } } } Index: Core/Components/src/Core.Components.OxyPlot.Forms/Properties/Resources.resx =================================================================== diff -u -r9b19f753c055f426fcea7b6c01cdf43c8d9f2468 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/src/Core.Components.OxyPlot.Forms/Properties/Resources.resx (.../Resources.resx) (revision 9b19f753c055f426fcea7b6c01cdf43c8d9f2468) +++ Core/Components/src/Core.Components.OxyPlot.Forms/Properties/Resources.resx (.../Resources.resx) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -117,10 +117,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + L - + Hoogte \ No newline at end of file Fisheye: Tag 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f refers to a dead (removed) revision in file `Core/Components/test/Core.Components.DotSpatial.Forms.Test/BaseMapTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Components/test/Core.Components.DotSpatial.Forms.Test/Core.Components.DotSpatial.Forms.Test.csproj =================================================================== diff -u -rdb3aa610228b657d23bba55a4ff26a1e359e9847 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/test/Core.Components.DotSpatial.Forms.Test/Core.Components.DotSpatial.Forms.Test.csproj (.../Core.Components.DotSpatial.Forms.Test.csproj) (revision db3aa610228b657d23bba55a4ff26a1e359e9847) +++ Core/Components/test/Core.Components.DotSpatial.Forms.Test/Core.Components.DotSpatial.Forms.Test.csproj (.../Core.Components.DotSpatial.Forms.Test.csproj) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -90,7 +90,7 @@ - + @@ -112,6 +112,10 @@ {5a91174a-fb95-4c9d-9ca5-81c0b8d4361a} Core.Components.DotSpatial.Forms + + {4a06df0d-5d75-4bad-a95a-a3db9b7c4ad5} + Core.Components.Gis.Forms + {318ba582-88c9-4816-a54a-a7e431461de3} Core.Components.Gis Index: Core/Components/test/Core.Components.DotSpatial.Forms.Test/MapControlTest.cs =================================================================== diff -u --- Core/Components/test/Core.Components.DotSpatial.Forms.Test/MapControlTest.cs (revision 0) +++ Core/Components/test/Core.Components.DotSpatial.Forms.Test/MapControlTest.cs (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -0,0 +1,307 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; +using Core.Common.Base.Geometry; +using Core.Components.DotSpatial.TestUtil; +using Core.Components.Gis.Data; +using Core.Components.Gis.Forms; + +using DotSpatial.Controls; +using NUnit.Framework; + +namespace Core.Components.DotSpatial.Forms.Test +{ + [TestFixture] + public class MapControlTest + { + [Test] + public void DefaultConstructor_DefaultValues() + { + // Call + using (var map = new MapControl()) + { + // Assert + Assert.IsInstanceOf(map); + Assert.IsInstanceOf(map); + Assert.IsNull(map.Data); + Assert.IsTrue(map.IsPanningEnabled); + Assert.IsFalse(map.IsRectangleZoomingEnabled); + Assert.IsTrue(map.IsMouseCoordinatesVisible); + } + } + + [Test] + public void Data_UnknownMapData_ThrowsNotSupportedException() + { + // Setup + using (var map = new MapControl()) + { + var testData = new TestMapData("test data"); + + // Call + TestDelegate test = () => map.Data = testData; + + // Assert + Assert.Throws(test); + } + } + + [Test] + public void Data_Null_ReturnsNull() + { + // Setup + using (var map = new MapControl()) + { + // Call + map.Data = null; + + // Assert + Assert.IsNull(map.Data); + } + } + + [Test] + public void Data_NotNull_ReturnsData() + { + // Setup + using (var map = new MapControl()) + { + var testData = new MapPointData(Enumerable.Empty(), "test data"); + + // Call + map.Data = testData; + + // Assert + Assert.AreSame(testData, map.Data); + } + } + + [Test] + public void Data_SetPointData_MapPointLayerAdded() + { + // Setup + using (var map = new MapControl()) + { + var testData = new MapPointData(Enumerable.Empty(), "test data"); + var mapView = map.Controls.OfType().First(); + + // Call + map.Data = testData; + + // Assert + Assert.IsInstanceOf(map.Data); + Assert.AreEqual(1, mapView.Layers.Count); + Assert.IsInstanceOf(mapView.Layers[0]); + } + } + + [Test] + public void UpdateObserver_UpdateData_UpdateMap() + { + // Setup + using (var map = new MapControl()) + { + var mapView = map.Controls.OfType().First(); + var testData = new MapDataCollection(new List + { + + new MapPointData(Enumerable.Empty(), "test data") + }, "test data"); + + map.Data = testData; + + // Precondition + Assert.AreEqual(1, mapView.Layers.Count); + Assert.IsInstanceOf(mapView.Layers[0]); + + testData.List.Add(new MapLineData(Enumerable.Empty(), "test data")); + + // Call + map.UpdateObserver(); + + // Assert + Assert.AreEqual(2, mapView.Layers.Count); + Assert.IsInstanceOf(mapView.Layers[0]); + Assert.IsInstanceOf(mapView.Layers[1]); + } + } + + [Test] + public void Data_SetToNull_DetachObserver() + { + // Setup + using (var map = new MapControl()) + { + var mapView = map.Controls.OfType().First(); + var testData = new MapDataCollection(new List + { + new MapPointData(Enumerable.Empty(), "test data") + }, "test data"); + + map.Data = testData; + + // Precondition + Assert.AreEqual(1, mapView.Layers.Count); + Assert.IsInstanceOf(mapView.Layers[0]); + + map.Data = null; + + testData.List.Add(new MapPointData(Enumerable.Empty(), "test data")); + + // Call + map.UpdateObserver(); + + // Assert + Assert.IsNull(map.Data); + Assert.AreEqual(0, mapView.Layers.Count); + } + } + + [Test] + [RequiresSTA] + public void ZoomToAll_MapInForm_ViewInvalidatedLayersSame() + { + // Setup + using (var form = new Form()) + { + var map = new MapControl(); + var testData = new MapPointData(Enumerable.Empty(), "test data"); + var mapView = map.Controls.OfType().First(); + var invalidated = 0; + + map.Data = testData; + form.Controls.Add(map); + + mapView.Invalidated += (sender, args) => { invalidated++; }; + + form.Show(); + Assert.AreEqual(0, invalidated, "Precondition failed: mapView.Invalidated > 0"); + + // Call + map.ZoomToAll(); + + // Assert + Assert.AreEqual(2, invalidated); + Assert.AreEqual(mapView.GetMaxExtent(), mapView.ViewExtents); + } + } + + [Test] + public void ToggleRectangleZooming_PanningIsEnabled_RectangleZoomingIsEnabled() + { + // Setup + using (var map = new MapControl()) + { + Assert.IsFalse(map.IsRectangleZoomingEnabled, "Precondition failed: IsRectangleZoomingEnabled is true"); + + // Call + map.ToggleRectangleZooming(); + + // Assert + Assert.IsTrue(map.IsRectangleZoomingEnabled); + Assert.IsFalse(map.IsPanningEnabled); + } + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void ToggleRectangleZooming_Always_ChangesState(bool isRectangleZooming) + { + // Setup + using (var map = new MapControl()) + { + if (isRectangleZooming) + { + map.ToggleRectangleZooming(); + } + + // Precondition + Assert.AreEqual(isRectangleZooming, map.IsRectangleZoomingEnabled, + String.Format("Precondition failed: IsRectangleZoomingEnabled is {0}", map.IsRectangleZoomingEnabled)); + Assert.AreEqual(!isRectangleZooming, map.IsPanningEnabled, + String.Format("Precondition failed: IsPanningEnabled is {0}", map.IsPanningEnabled)); + + // Call + map.ToggleRectangleZooming(); + + // Assert + Assert.IsTrue(map.IsRectangleZoomingEnabled); + } + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void ToggleMouseCoordinatesVisibility_Always_ChangesState(bool isShowingCoordinates) + { + // Setup + using (var map = new MapControl()) + { + if (!isShowingCoordinates) + { + // Make sure the state is correct + map.ToggleMouseCoordinatesVisibility(); + + // Precondition + Assert.IsFalse(map.IsMouseCoordinatesVisible); + } + + // Call + map.ToggleMouseCoordinatesVisibility(); + + // Assert + Assert.AreNotEqual(isShowingCoordinates, map.IsMouseCoordinatesVisible); + } + } + + [Test] + [RequiresSTA] + public void UpdateObserver_MapInForm_MapLayersRenewed() + { + // Setup + using (var form = new Form()) + { + var map = new MapControl(); + var testData = new MapPointData(Enumerable.Empty(), "test data"); + var view = map.Controls.OfType().First(); + + map.Data = testData; + var layers = view.Layers.ToList(); + + form.Controls.Add(map); + + form.Show(); + + // Call + map.UpdateObserver(); + + // Assert + Assert.AreEqual(1, view.Layers.Count); + Assert.AreNotSame(layers[0], view.Layers[0]); + } + } + } +} \ No newline at end of file Index: Core/Components/test/Core.Components.DotSpatial.Test/Core.Components.DotSpatial.Test.csproj =================================================================== diff -u -r87ecbdded83da959215bb92dab301a769b67282b -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/test/Core.Components.DotSpatial.Test/Core.Components.DotSpatial.Test.csproj (.../Core.Components.DotSpatial.Test.csproj) (revision 87ecbdded83da959215bb92dab301a769b67282b) +++ Core/Components/test/Core.Components.DotSpatial.Test/Core.Components.DotSpatial.Test.csproj (.../Core.Components.DotSpatial.Test.csproj) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -107,8 +107,8 @@ - - + + Fisheye: Tag 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f refers to a dead (removed) revision in file `Core/Components/test/Core.Components.DotSpatial.Test/MapFunctionPanTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f refers to a dead (removed) revision in file `Core/Components/test/Core.Components.DotSpatial.Test/MapFunctionSelectionZoomTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Components/test/Core.Components.DotSpatial.Test/MapFunctions/MapFunctionPanTest.cs =================================================================== diff -u --- Core/Components/test/Core.Components.DotSpatial.Test/MapFunctions/MapFunctionPanTest.cs (revision 0) +++ Core/Components/test/Core.Components.DotSpatial.Test/MapFunctions/MapFunctionPanTest.cs (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -0,0 +1,55 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Windows.Forms; + +using DotSpatial.Controls; + +using NUnit.Framework; + +using Rhino.Mocks; + +using MapFunctionPan = Core.Components.DotSpatial.MapFunctions.MapFunctionPan; + +namespace Core.Components.DotSpatial.Test.MapFunctions +{ + [TestFixture] + public class MapFunctionPanTest + { + [Test] + public void Constructor_ActivateEvent_ExpectedValues() + { + // Setup + var mockingRepository = new MockRepository(); + var mapMock = mockingRepository.StrictMock(); + mapMock.Expect(m => m.Cursor).SetPropertyWithArgument(Cursors.Default); + mockingRepository.ReplayAll(); + + // Call + MapFunctionPan mapFunction = new MapFunctionPan(mapMock); + mapFunction.Activate(); + + // Assert + Assert.IsInstanceOf(mapFunction); + mockingRepository.VerifyAll(); + } + } +} \ No newline at end of file Index: Core/Components/test/Core.Components.DotSpatial.Test/MapFunctions/MapFunctionSelectionZoomTest.cs =================================================================== diff -u --- Core/Components/test/Core.Components.DotSpatial.Test/MapFunctions/MapFunctionSelectionZoomTest.cs (revision 0) +++ Core/Components/test/Core.Components.DotSpatial.Test/MapFunctions/MapFunctionSelectionZoomTest.cs (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -0,0 +1,71 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Windows.Forms; + +using Core.Components.DotSpatial.MapFunctions; + +using DotSpatial.Controls; + +using NUnit.Framework; + +using Rhino.Mocks; + +namespace Core.Components.DotSpatial.Test.MapFunctions +{ + [TestFixture] + public class MapFunctionSelectionZoomTest + { + [Test] + public void Constructor_Always_ExpectedValues() + { + // Setup + var mockingRepository = new MockRepository(); + var mapMock = mockingRepository.StrictMock(); + mockingRepository.ReplayAll(); + + // Call + MapFunctionSelectionZoom mapFunction = new MapFunctionSelectionZoom(mapMock); + + // Assert + Assert.IsInstanceOf(mapFunction); + mockingRepository.VerifyAll(); + } + + [Test] + public void Constructor_ActivateEvent_ExpectedValues() + { + // Setup + var mockingRepository = new MockRepository(); + var mapMock = mockingRepository.StrictMock(); + mapMock.Expect(m => m.Cursor).SetPropertyWithArgument(Cursors.Default); + mockingRepository.ReplayAll(); + + // Call + MapFunctionSelectionZoom mapFunction = new MapFunctionSelectionZoom(mapMock); + mapFunction.Activate(); + + // Assert + Assert.IsInstanceOf(mapFunction); + mockingRepository.VerifyAll(); + } + } +} \ No newline at end of file Fisheye: Tag 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f refers to a dead (removed) revision in file `Core/Components/test/Core.Components.OxyPlot.Forms.Test/BaseChartTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Components/test/Core.Components.OxyPlot.Forms.Test/ChartControlTest.cs =================================================================== diff -u --- Core/Components/test/Core.Components.OxyPlot.Forms.Test/ChartControlTest.cs (revision 0) +++ Core/Components/test/Core.Components.OxyPlot.Forms.Test/ChartControlTest.cs (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -0,0 +1,218 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; +using Core.Common.Base; +using Core.Common.Utils.Reflection; +using Core.Components.Charting.Data; +using Core.Components.Charting.TestUtil; +using NUnit.Framework; +using OxyPlot.WindowsForms; + +namespace Core.Components.OxyPlot.Forms.Test +{ + [TestFixture] + public class ChartControlTest + { + [Test] + public void DefaultConstructor_PropertiesSet() + { + // Call + var chart = new ChartControl(); + + // Assert + Assert.IsInstanceOf(chart); + Assert.AreEqual(75, chart.MinimumSize.Height); + Assert.AreEqual(50, chart.MinimumSize.Width); + Assert.IsNull(chart.Data); + Assert.IsTrue(chart.IsPanningEnabled); + Assert.IsFalse(chart.IsRectangleZoomingEnabled); + } + + [Test] + public void Data_NotKnownChartData_ThrowsNotSupportedException() + { + // Setup + var chart = new ChartControl(); + var testData = new TestChartData(); + + // Call + TestDelegate test = () => chart.Data = testData; + + // Assert + Assert.Throws(test); + } + + [Test] + public void Data_Null_ReturnsNull() + { + // Setup + var chart = new ChartControl(); + + // Call + chart.Data = null; + + // Assert + Assert.IsNull(chart.Data); + } + + [Test] + public void Data_KnownChartData_ChartControlAttachedSeriesAdded() + { + // Setup + var chart = new ChartControl(); + var testData = new LineData(Enumerable.Empty>()); + var observers = TypeUtils.GetField>(testData, "observers"); + var view = TypeUtils.GetField(chart, "view"); + + // Call + chart.Data = testData; + + // Assert + CollectionAssert.AreEqual(new[] + { + chart + }, observers); + Assert.AreEqual(1, view.Model.Series.Count); + } + + [Test] + public void Data_NewDataSet_ChartControlDetachedFromOldAttachedToNewSeriesUpdated() + { + // Setup + var chart = new ChartControl(); + var testDataOld = new LineData(Enumerable.Empty>()); + var testDataNew = new LineData(Enumerable.Empty>()); + var observersOld = TypeUtils.GetField>(testDataOld, "observers"); + var observersNew = TypeUtils.GetField>(testDataNew, "observers"); + var view = TypeUtils.GetField(chart, "view"); + + // Call + chart.Data = testDataOld; + chart.Data = testDataNew; + + // Assert + CollectionAssert.IsEmpty(observersOld); + CollectionAssert.AreEqual(new[] + { + chart + }, observersNew); + Assert.AreEqual(1, view.Model.Series.Count); + } + + [Test] + public void Data_DataSetNewValueIsNull_ChartControlDetachedSeriesCleared() + { + // Setup + var chart = new ChartControl(); + var testData = new LineData(Enumerable.Empty>()); + var observers = TypeUtils.GetField>(testData, "observers"); + var view = TypeUtils.GetField(chart, "view"); + + chart.Data = testData; + + // Precondition + Assert.AreEqual(1, view.Model.Series.Count); + + // Call + chart.Data = null; + + // Assert + CollectionAssert.IsEmpty(observers); + CollectionAssert.IsEmpty(view.Model.Series); + } + + [Test] + public void TogglePanning_Always_PanningEnabled() + { + // Setup + var chart = new ChartControl(); + + // Precondition + Assert.IsTrue(chart.IsPanningEnabled); + + // Call + chart.TogglePanning(); + + // Assert + Assert.IsTrue(chart.IsPanningEnabled); + Assert.IsFalse(chart.IsRectangleZoomingEnabled); + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void ToggleRectangleZooming_Always_ChangesState(bool isRectangleZooming) + { + // Setup + var chart = new ChartControl(); + if (isRectangleZooming) + { + chart.ToggleRectangleZooming(); + } + + // Precondition + Assert.AreEqual(isRectangleZooming, chart.IsRectangleZoomingEnabled); + Assert.AreEqual(!isRectangleZooming, chart.IsPanningEnabled); + + // Call + chart.ToggleRectangleZooming(); + + // Assert + Assert.IsTrue(chart.IsRectangleZoomingEnabled); + } + + [Test] + public void ZoomToAll_ChartInForm_ViewInvalidatedSeriesSame() + { + // Setup + var form = new Form(); + var chart = new ChartControl(); + var testData = new LineData(Enumerable.Empty>()); + var view = TypeUtils.GetField(chart, "view"); + var invalidated = 0; + + chart.Data = testData; + var series = view.Model.Series.ToList(); + + form.Controls.Add(chart); + view.Invalidated += (sender, args) => invalidated++; + + form.Show(); + + // Call + chart.ZoomToAll(); + + // Assert + Assert.AreEqual(1, invalidated); + CollectionAssert.AreEqual(series, view.Model.Series); + } + + [Test] + public void UpdateObserver_ChartInForm_ViewInvalidatedSeriesRenewed() + { + // Setup + var form = new Form(); + var chart = new ChartControl(); + var testData = new LineData(Enumerable.Empty>()); + var view = TypeUtils.GetField(chart, "view"); + var invalidated = 0; + + chart.Data = testData; + var series = view.Model.Series.ToList(); + + form.Controls.Add(chart); + view.Invalidated += (sender, args) => invalidated++; + + form.Show(); + + // Call + chart.UpdateObserver(); + + // Assert + Assert.AreEqual(1, invalidated); + Assert.AreEqual(1, view.Model.Series.Count); + Assert.AreNotSame(series[0], view.Model.Series[0]); + } + } +} \ No newline at end of file Index: Core/Components/test/Core.Components.OxyPlot.Forms.Test/Core.Components.OxyPlot.Forms.Test.csproj =================================================================== diff -u -r74cd1965818ae9b23da6cad8776b7da2868be4a7 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/test/Core.Components.OxyPlot.Forms.Test/Core.Components.OxyPlot.Forms.Test.csproj (.../Core.Components.OxyPlot.Forms.Test.csproj) (revision 74cd1965818ae9b23da6cad8776b7da2868be4a7) +++ Core/Components/test/Core.Components.OxyPlot.Forms.Test/Core.Components.OxyPlot.Forms.Test.csproj (.../Core.Components.OxyPlot.Forms.Test.csproj) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -59,7 +59,7 @@ - + @@ -79,6 +79,10 @@ {D749EE4C-CE50-4C17-BF01-9A953028C126} Core.Common.TestUtil + + {2465cca1-c505-4827-9454-4fd5fd9194cd} + Core.Components.Charting.Forms + {516EBC95-B8F2-428C-B7F6-733F01BF8FDD} Core.Components.Charting Index: Core/Components/test/Core.Components.OxyPlot.Forms.Test/LinearPlotViewTest.cs =================================================================== diff -u -rd4aa34af2a210f8c40a469601be17e038791dd2b -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Components/test/Core.Components.OxyPlot.Forms.Test/LinearPlotViewTest.cs (.../LinearPlotViewTest.cs) (revision d4aa34af2a210f8c40a469601be17e038791dd2b) +++ Core/Components/test/Core.Components.OxyPlot.Forms.Test/LinearPlotViewTest.cs (.../LinearPlotViewTest.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -25,7 +25,7 @@ var axes = view.Model.Axes; Assert.AreEqual(2, axes.Count); CollectionAssert.AllItemsAreInstancesOfType(axes, typeof(LinearAxis)); - CollectionAssert.AreEqual(new [] {Resources.BaseChart_XAxisTitle, Resources.BaseChart_YAxisTitle} , axes.Select(a => a.Title)); + CollectionAssert.AreEqual(new [] {Resources.ChartControl_XAxisTitle, Resources.ChartControl_YAxisTitle} , axes.Select(a => a.Title)); CollectionAssert.AreEqual(new [] {AxisPosition.Bottom, AxisPosition.Left} , axes.Select(a => a.Position)); CollectionAssert.AreEqual(new [] {TickStyle.None, TickStyle.None} , axes.Select(a => a.TickStyle)); CollectionAssert.AreEqual(new [] {new[] { 0.0 }, new[] { 0.0 }} , axes.Select(a => a.ExtraGridlines)); Index: Core/Plugins/src/Core.Plugins.DotSpatial/Forms/MapDataView.cs =================================================================== diff -u -r86e717a5477d55d1c4351f2857a1d76e220a3ab4 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/src/Core.Plugins.DotSpatial/Forms/MapDataView.cs (.../MapDataView.cs) (revision 86e717a5477d55d1c4351f2857a1d76e220a3ab4) +++ Core/Plugins/src/Core.Plugins.DotSpatial/Forms/MapDataView.cs (.../MapDataView.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -21,7 +21,6 @@ using System.Windows.Forms; using Core.Components.DotSpatial.Forms; -using Core.Components.Gis; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; @@ -32,19 +31,19 @@ /// public partial class MapDataView : UserControl, IMapView { - private readonly BaseMap baseMap; + private readonly MapControl mapControl; private MapData data; /// /// Creates a new instance of . /// public MapDataView() { - baseMap = new BaseMap + mapControl = new MapControl { Dock = DockStyle.Fill }; - Controls.Add(baseMap); + Controls.Add(mapControl); } public object Data @@ -64,11 +63,11 @@ } } - public IMap Map + public IMapControl Map { get { - return baseMap; + return mapControl; } } } Index: Core/Plugins/src/Core.Plugins.DotSpatial/Legend/MapLegendView.cs =================================================================== diff -u -rc9f9c04e4fc62406231afd07d63cd7da11673ec6 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/src/Core.Plugins.DotSpatial/Legend/MapLegendView.cs (.../MapLegendView.cs) (revision c9f9c04e4fc62406231afd07d63cd7da11673ec6) +++ Core/Plugins/src/Core.Plugins.DotSpatial/Legend/MapLegendView.cs (.../MapLegendView.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -33,7 +33,7 @@ namespace Core.Plugins.DotSpatial.Legend { /// - /// The view which shows the data that is added to a . + /// The view which shows the data that is added to a . /// public sealed partial class MapLegendView : UserControl, IView { @@ -122,9 +122,9 @@ Text = mapDataCollection => mapDataCollection.Name, Image = mapDataCollection => GuiResources.folder, ChildNodeObjects = mapDataCollection => mapDataCollection.List.Reverse().Cast().ToArray(), - CanDrop = BaseMapCanDrop, - CanInsert = BaseMapCanInsert, - OnDrop = BaseMapOnDrop + CanDrop = MapControlCanDrop, + CanInsert = MapControlCanInsert, + OnDrop = MapControlOnDrop }); treeViewControl.RegisterTreeNodeInfo(new TreeNodeInfo @@ -183,17 +183,17 @@ # region MapDataCollection - private static bool BaseMapCanDrop(object draggedData, object targetData) + private static bool MapControlCanDrop(object draggedData, object targetData) { return draggedData is MapData; } - private static bool BaseMapCanInsert(object draggedData, object targetData) + private static bool MapControlCanInsert(object draggedData, object targetData) { return draggedData is MapData; } - private static void BaseMapOnDrop(object droppedData, object newParentData, object oldParentData, int position, TreeViewControl control) + private static void MapControlOnDrop(object droppedData, object newParentData, object oldParentData, int position, TreeViewControl control) { var mapData = (MapData)droppedData; var target = (MapDataCollection)newParentData; Index: Core/Plugins/src/Core.Plugins.DotSpatial/MapRibbon.xaml.cs =================================================================== diff -u -r880ce6f91c0318987639d8ebfb5356401a133ab1 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/src/Core.Plugins.DotSpatial/MapRibbon.xaml.cs (.../MapRibbon.xaml.cs) (revision 880ce6f91c0318987639d8ebfb5356401a133ab1) +++ Core/Plugins/src/Core.Plugins.DotSpatial/MapRibbon.xaml.cs (.../MapRibbon.xaml.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -23,7 +23,8 @@ using System.Windows; using Core.Common.Controls.Commands; using Core.Common.Gui.Forms; -using Core.Components.Gis; +using Core.Components.Gis.Forms; + using Fluent; namespace Core.Plugins.DotSpatial @@ -33,7 +34,7 @@ /// public partial class MapRibbon : IRibbonCommandHandler { - private IMap map; + private IMapControl map; /// /// Creates a new instance of . @@ -44,9 +45,9 @@ } /// - /// Sets the to show the ribbon for. + /// Sets the to show the ribbon for. /// - public IMap Map + public IMapControl Map { private get { Index: Core/Plugins/src/Core.Plugins.OxyPlot/ChartingRibbon.xaml.cs =================================================================== diff -u -r6a644d66b282d1c0cb1625cf2322f1e67148556d -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/src/Core.Plugins.OxyPlot/ChartingRibbon.xaml.cs (.../ChartingRibbon.xaml.cs) (revision 6a644d66b282d1c0cb1625cf2322f1e67148556d) +++ Core/Plugins/src/Core.Plugins.OxyPlot/ChartingRibbon.xaml.cs (.../ChartingRibbon.xaml.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -23,7 +23,8 @@ using System.Windows; using Core.Common.Controls.Commands; using Core.Common.Gui.Forms; -using Core.Components.Charting; +using Core.Components.Charting.Forms; + using Fluent; namespace Core.Plugins.OxyPlot @@ -33,7 +34,7 @@ /// public partial class ChartingRibbon : IRibbonCommandHandler { - private IChart chart; + private IChartControl chart; /// /// Creates a new instance of . @@ -44,9 +45,9 @@ } /// - /// Sets the to show the ribbon for. + /// Sets the to show the ribbon for. /// - public IChart Chart + public IChartControl Chart { private get { Index: Core/Plugins/src/Core.Plugins.OxyPlot/Forms/ChartDataView.Designer.cs =================================================================== diff -u -r460ed7ba26498668b47780bf1abd8293db3baeff -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/src/Core.Plugins.OxyPlot/Forms/ChartDataView.Designer.cs (.../ChartDataView.Designer.cs) (revision 460ed7ba26498668b47780bf1abd8293db3baeff) +++ Core/Plugins/src/Core.Plugins.OxyPlot/Forms/ChartDataView.Designer.cs (.../ChartDataView.Designer.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -27,21 +27,21 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChartDataView)); - this.chart = new Core.Components.OxyPlot.Forms.BaseChart(); + this.chartControl = new Core.Components.OxyPlot.Forms.ChartControl(); this.SuspendLayout(); // // chart // - this.chart.Dock = System.Windows.Forms.DockStyle.Fill; - this.chart.Location = new System.Drawing.Point(0, 0); - this.chart.MinimumSize = new System.Drawing.Size(50, 75); - this.chart.Name = "chart"; - this.chart.Size = new System.Drawing.Size(150, 150); - this.chart.TabIndex = 0; + this.chartControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.chartControl.Location = new System.Drawing.Point(0, 0); + this.chartControl.MinimumSize = new System.Drawing.Size(50, 75); + this.chartControl.Name = "chartControl"; + this.chartControl.Size = new System.Drawing.Size(150, 150); + this.chartControl.TabIndex = 0; // // ChartDataView // - this.Controls.Add(this.chart); + this.Controls.Add(this.chartControl); this.MinimumSize = new System.Drawing.Size(0, 1); this.Name = "ChartDataView"; this.ResumeLayout(false); @@ -50,6 +50,6 @@ #endregion - private BaseChart chart; + private ChartControl chartControl; } } \ No newline at end of file Index: Core/Plugins/src/Core.Plugins.OxyPlot/Forms/ChartDataView.cs =================================================================== diff -u -r25bdf707d3cd78e182705e16371a376222b7ee79 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/src/Core.Plugins.OxyPlot/Forms/ChartDataView.cs (.../ChartDataView.cs) (revision 25bdf707d3cd78e182705e16371a376222b7ee79) +++ Core/Plugins/src/Core.Plugins.OxyPlot/Forms/ChartDataView.cs (.../ChartDataView.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -20,7 +20,6 @@ // All rights reserved. using System.Windows.Forms; -using Core.Components.Charting; using Core.Components.Charting.Data; using Core.Components.Charting.Forms; @@ -58,11 +57,11 @@ } } - public IChart Chart + public IChartControl Chart { get { - return chart; + return chartControl; } } } Index: Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendView.cs =================================================================== diff -u -rc5b9900d1cc5bd7eb5ecc0727d1949fb21f486a2 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendView.cs (.../LegendView.cs) (revision c5b9900d1cc5bd7eb5ecc0727d1949fb21f486a2) +++ Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendView.cs (.../LegendView.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -34,7 +34,7 @@ namespace Core.Plugins.OxyPlot.Legend { /// - /// This class defines a view which shows the data that have been added to a . + /// This class defines a view which shows the data that have been added to a . /// public sealed partial class LegendView : UserControl, IView { @@ -78,12 +78,12 @@ treeViewControl.RegisterTreeNodeInfo(new TreeNodeInfo { - Text = baseChart => OxyPlotResources.General_Chart, - Image = baseChart => GuiResources.folder, - ChildNodeObjects = baseChart => baseChart.List.Reverse().Cast().ToArray(), - CanDrop = BaseChartCanDrop, - CanInsert = BaseChartCanInsert, - OnDrop = BaseChartOnDrop + Text = chartControl => OxyPlotResources.General_Chart, + Image = chartControl => GuiResources.folder, + ChildNodeObjects = chartControl => chartControl.List.Reverse().Cast().ToArray(), + CanDrop = ChartControlCanDrop, + CanInsert = ChartControlCanInsert, + OnDrop = ChartControlOnDrop }); } @@ -149,17 +149,17 @@ # region ChartDataCollection - private static bool BaseChartCanDrop(object draggedData, object targetData) + private static bool ChartControlCanDrop(object draggedData, object targetData) { return draggedData is ChartData; } - private static bool BaseChartCanInsert(object draggedData, object targetData) + private static bool ChartControlCanInsert(object draggedData, object targetData) { return draggedData is ChartData; } - private static void BaseChartOnDrop(object droppedData, object newParentData, object oldParentData, int position, TreeViewControl control) + private static void ChartControlOnDrop(object droppedData, object newParentData, object oldParentData, int position, TreeViewControl control) { var chartData = (ChartData) droppedData; var target = (ChartDataCollection) newParentData; Index: Core/Plugins/test/Core.Plugins.DotSpatial.Test/DotSpatialGuiPluginTest.cs =================================================================== diff -u -r86e717a5477d55d1c4351f2857a1d76e220a3ab4 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/test/Core.Plugins.DotSpatial.Test/DotSpatialGuiPluginTest.cs (.../DotSpatialGuiPluginTest.cs) (revision 86e717a5477d55d1c4351f2857a1d76e220a3ab4) +++ Core/Plugins/test/Core.Plugins.DotSpatial.Test/DotSpatialGuiPluginTest.cs (.../DotSpatialGuiPluginTest.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -10,7 +10,6 @@ using Core.Common.Gui.Settings; using Core.Components.DotSpatial.Forms; using Core.Components.DotSpatial.TestUtil; -using Core.Components.Gis; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using Core.Plugins.DotSpatial.Forms; @@ -65,7 +64,7 @@ if (useMapView) { var mapView = mocks.Stub(); - var map = mocks.Stub(); + var map = mocks.Stub(); map.Data = new TestMapData("test data"); mapView.Stub(v => v.Map).Return(map); view = mapView; @@ -135,7 +134,7 @@ { var plugin = new DotSpatialGuiPlugin(); var testMapView = new TestMapView(); - var map = new BaseMap(); + var map = new MapControl(); IView viewMock = visible ? (IView) testMapView : new TestView(); testMapView.Data = map; Index: Core/Plugins/test/Core.Plugins.DotSpatial.Test/Forms/MapDataViewTest.cs =================================================================== diff -u -ra793fc9845a2b861d885170d22cd2353a7146403 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/test/Core.Plugins.DotSpatial.Test/Forms/MapDataViewTest.cs (.../MapDataViewTest.cs) (revision a793fc9845a2b861d885170d22cd2353a7146403) +++ Core/Plugins/test/Core.Plugins.DotSpatial.Test/Forms/MapDataViewTest.cs (.../MapDataViewTest.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -26,29 +26,29 @@ } [Test] - public void DefaultConstructor_Always_AddsBaseMap() + public void DefaultConstructor_Always_AddsMapControl() { // Call using (var mapView = new MapDataView()) { // Assert Assert.AreEqual(1, mapView.Controls.Count); object mapObject = mapView.Controls[0]; - Assert.IsInstanceOf(mapObject); + Assert.IsInstanceOf(mapObject); - var map = (BaseMap)mapObject; + var map = (MapControl)mapObject; Assert.AreEqual(DockStyle.Fill, map.Dock); Assert.NotNull(mapView.Map); } } [Test] - public void Data_SetToNull_BaseMapNoFeatures() + public void Data_SetToNull_MapControlNoFeatures() { // Setup using (var mapView = new MapDataView()) { - var map = (BaseMap)mapView.Controls[0]; + var map = (MapControl)mapView.Controls[0]; // Call TestDelegate testDelegate = () => mapView.Data = null; @@ -79,7 +79,7 @@ // Setup using (var mapView = new MapDataView()) { - var map = (BaseMap)mapView.Controls[0]; + var map = (MapControl)mapView.Controls[0]; var pointData = new MapPointData(Enumerable.Empty(), "test data"); // Call Index: Core/Plugins/test/Core.Plugins.DotSpatial.Test/MapRibbonTest.cs =================================================================== diff -u -r880ce6f91c0318987639d8ebfb5356401a133ab1 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/test/Core.Plugins.DotSpatial.Test/MapRibbonTest.cs (.../MapRibbonTest.cs) (revision 880ce6f91c0318987639d8ebfb5356401a133ab1) +++ Core/Plugins/test/Core.Plugins.DotSpatial.Test/MapRibbonTest.cs (.../MapRibbonTest.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -4,7 +4,7 @@ using System.Windows.Controls.Primitives; using Core.Common.Controls.Commands; using Core.Common.Gui; -using Core.Components.Gis; +using Core.Components.Gis.Forms; using Core.Plugins.DotSpatial.Commands; using Core.Plugins.DotSpatial.Legend; using Fluent; @@ -86,7 +86,7 @@ { // Setup var mocks = new MockRepository(); - var map = mocks.Stub(); + var map = mocks.Stub(); mocks.ReplayAll(); @@ -143,7 +143,7 @@ { // Setup var mocks = new MockRepository(); - var map = mocks.DynamicMock(); + var map = mocks.DynamicMock(); map.Stub(m => m.IsPanningEnabled).Return(panningChecked); mocks.ReplayAll(); @@ -173,7 +173,7 @@ { // Setup var mocks = new MockRepository(); - var map = mocks.DynamicMock(); + var map = mocks.DynamicMock(); map.Stub(m => m.IsRectangleZoomingEnabled).Return(rectangleZoomChecked); mocks.ReplayAll(); @@ -203,7 +203,7 @@ { // Setup var mocks = new MockRepository(); - var map = mocks.DynamicMock(); + var map = mocks.DynamicMock(); map.Stub(m => m.IsMouseCoordinatesVisible).Return(mouseCoordinatesChecked); mocks.ReplayAll(); @@ -258,7 +258,7 @@ { // Setup var mocks = new MockRepository(); - var map = mocks.DynamicMock(); + var map = mocks.DynamicMock(); map.Expect(c => c.TogglePanning()); mocks.ReplayAll(); @@ -285,7 +285,7 @@ { // Setup var mocks = new MockRepository(); - var map = mocks.DynamicMock(); + var map = mocks.DynamicMock(); map.Expect(c => c.ToggleRectangleZooming()); mocks.ReplayAll(); @@ -312,7 +312,7 @@ { // Setup var mocks = new MockRepository(); - var map = mocks.DynamicMock(); + var map = mocks.DynamicMock(); map.Expect(c => c.ZoomToAll()); mocks.ReplayAll(); @@ -339,7 +339,7 @@ { // Setup var mocks = new MockRepository(); - var map = mocks.DynamicMock(); + var map = mocks.DynamicMock(); map.Expect(c => c.ToggleMouseCoordinatesVisibility()); mocks.ReplayAll(); Index: Core/Plugins/test/Core.Plugins.DotSpatial.Test/TestMapView.cs =================================================================== diff -u -r86e717a5477d55d1c4351f2857a1d76e220a3ab4 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/test/Core.Plugins.DotSpatial.Test/TestMapView.cs (.../TestMapView.cs) (revision 86e717a5477d55d1c4351f2857a1d76e220a3ab4) +++ Core/Plugins/test/Core.Plugins.DotSpatial.Test/TestMapView.cs (.../TestMapView.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -1,6 +1,5 @@ using System.Windows.Forms; using Core.Components.DotSpatial.Forms; -using Core.Components.Gis; using Core.Components.Gis.Forms; namespace Core.Plugins.DotSpatial.Test @@ -12,11 +11,11 @@ { public object Data { get; set; } - public IMap Map + public IMapControl Map { get { - return (BaseMap) Data; + return (MapControl) Data; } } } Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/ChartingRibbonTest.cs =================================================================== diff -u -r96fff35cedc43c8be2da620efa3d1b9cb3e42238 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/ChartingRibbonTest.cs (.../ChartingRibbonTest.cs) (revision 96fff35cedc43c8be2da620efa3d1b9cb3e42238) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/ChartingRibbonTest.cs (.../ChartingRibbonTest.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -2,7 +2,7 @@ using System.Windows; using Core.Common.Gui; -using Core.Components.Charting; +using Core.Components.Charting.Forms; using Core.Plugins.OxyPlot.Commands; using Core.Plugins.OxyPlot.Legend; using Fluent; @@ -81,7 +81,7 @@ { // Setup var mocks = new MockRepository(); - var chart = mocks.DynamicMock(); + var chart = mocks.DynamicMock(); chart.Expect(c => c.TogglePanning()); mocks.ReplayAll(); @@ -108,7 +108,7 @@ { // Setup var mocks = new MockRepository(); - var chart = mocks.DynamicMock(); + var chart = mocks.DynamicMock(); chart.Expect(c => c.ToggleRectangleZooming()); mocks.ReplayAll(); @@ -163,7 +163,7 @@ // Setup var ribbon = new ChartingRibbon(); var mocks = new MockRepository(); - var chart = mocks.StrictMock(); + var chart = mocks.StrictMock(); chart.Expect(c => c.IsPanningEnabled).Return(true); chart.Expect(c => c.IsRectangleZoomingEnabled).Return(true); @@ -193,7 +193,7 @@ { // Setup var mocks = new MockRepository(); - var chart = mocks.StrictMock(); + var chart = mocks.StrictMock(); var ribbon = new ChartingRibbon(); chart.Expect(c => c.IsPanningEnabled).Return(buttonChecked); @@ -225,7 +225,7 @@ { // Setup var mocks = new MockRepository(); - var chart = mocks.Stub(); + var chart = mocks.Stub(); mocks.ReplayAll(); @@ -283,7 +283,7 @@ { // Setup var mocks = new MockRepository(); - var chart = mocks.StrictMock(); + var chart = mocks.StrictMock(); var ribbon = new ChartingRibbon(); Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/Forms/ChartDataViewTest.cs =================================================================== diff -u -ref72c08668ad38b9120c7652f58f6f9dcbdf7bec -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/Forms/ChartDataViewTest.cs (.../ChartDataViewTest.cs) (revision ef72c08668ad38b9120c7652f58f6f9dcbdf7bec) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/Forms/ChartDataViewTest.cs (.../ChartDataViewTest.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -12,27 +12,27 @@ public class ChartDataViewTest { [Test] - public void DefaultConstructor_Always_AddsBaseChart() + public void DefaultConstructor_Always_AddsChartControl() { // Call var chartView = new ChartDataView(); // Assert Assert.AreEqual(1, chartView.Controls.Count); object chartObject = chartView.Controls[0]; - Assert.IsInstanceOf(chartObject); + Assert.IsInstanceOf(chartObject); - var chart = (BaseChart)chartObject; + var chart = (ChartControl)chartObject; Assert.AreEqual(DockStyle.Fill, chart.Dock); Assert.NotNull(chartView.Chart); } [Test] - public void Data_SetToNull_BaseChartNoSeries() + public void Data_SetToNull_ChartControlNoSeries() { // Setup var chartView = new ChartDataView(); - var chart = (BaseChart)chartView.Controls[0]; + var chart = (ChartControl)chartView.Controls[0]; // Call chartView.Data = null; @@ -59,7 +59,7 @@ { // Setup var chartView = new ChartDataView(); - var chart = (BaseChart)chartView.Controls[0]; + var chart = (ChartControl)chartView.Controls[0]; var lineData = new LineData(Enumerable.Empty>()); // Call @@ -75,7 +75,7 @@ { // Setup var chartView = new ChartDataView(); - var chart = (BaseChart)chartView.Controls[0]; + var chart = (ChartControl)chartView.Controls[0]; var pointData = new PointData(Enumerable.Empty>()); // Call @@ -91,7 +91,7 @@ { // Setup var chartView = new ChartDataView(); - var chart = (BaseChart)chartView.Controls[0]; + var chart = (ChartControl)chartView.Controls[0]; var areaData = new AreaData(Enumerable.Empty>()); // Call @@ -107,7 +107,7 @@ { // Setup var chartView = new ChartDataView(); - var chart = (BaseChart)chartView.Controls[0]; + var chart = (ChartControl)chartView.Controls[0]; var chartDataCollection = new ChartDataCollection(new ChartData[0]); // Call Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/LegendViewTest.cs =================================================================== diff -u -r249fd5e4604012895724a9d7df67201332c9e7dc -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/LegendViewTest.cs (.../LegendViewTest.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/LegendViewTest.cs (.../LegendViewTest.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -27,18 +27,18 @@ } [Test] - public void Data_BaseChart_DataSet() + public void Data_ChartControl_DataSet() { // Setup using (var view = new LegendView()) { - var baseChart = new ChartDataCollection(new List()); + var chartDataCollection = new ChartDataCollection(new List()); // Call - view.Data = baseChart; + view.Data = chartDataCollection; // Assert - Assert.AreSame(baseChart, view.Data); + Assert.AreSame(chartDataCollection, view.Data); } } Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs =================================================================== diff -u -r25bdf707d3cd78e182705e16371a376222b7ee79 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs (.../OxyPlotGuiPluginTest.cs) (revision 25bdf707d3cd78e182705e16371a376222b7ee79) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs (.../OxyPlotGuiPluginTest.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -9,7 +9,6 @@ using Core.Common.Gui.Forms.MainWindow; using Core.Common.Gui.Plugin; using Core.Common.Gui.Settings; -using Core.Components.Charting; using Core.Components.Charting.Data; using Core.Components.Charting.Forms; using Core.Components.Charting.TestUtil; @@ -64,7 +63,7 @@ if (useChartView) { var chartView = mocks.Stub(); - var chart = mocks.Stub(); + var chart = mocks.Stub(); chart.Data = new TestChartData(); chartView.Stub(v => v.Chart).Return(chart); view = chartView; @@ -133,7 +132,7 @@ { var plugin = new OxyPlotGuiPlugin(); var testChartView = new TestChartView(); - var chart = new BaseChart(); + var chart = new ChartControl(); IView viewMock = visible ? (IView) testChartView : new TestView(); testChartView.Data = chart; Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/TestChartView.cs =================================================================== diff -u -r25bdf707d3cd78e182705e16371a376222b7ee79 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/TestChartView.cs (.../TestChartView.cs) (revision 25bdf707d3cd78e182705e16371a376222b7ee79) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/TestChartView.cs (.../TestChartView.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -1,5 +1,4 @@ using System.Windows.Forms; -using Core.Components.Charting; using Core.Components.Charting.Forms; using Core.Components.OxyPlot.Forms; @@ -12,11 +11,11 @@ { public object Data { get; set; } - public IChart Chart + public IChartControl Chart { get { - return (BaseChart) Data; + return (ChartControl) Data; } } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs =================================================================== diff -u -r86e717a5477d55d1c4351f2857a1d76e220a3ab4 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs (.../AssessmentSectionView.cs) (revision 86e717a5477d55d1c4351f2857a1d76e220a3ab4) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs (.../AssessmentSectionView.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -25,7 +25,6 @@ using Core.Common.Base; using Core.Common.Base.Geometry; using Core.Components.DotSpatial.Forms; -using Core.Components.Gis; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using Ringtoets.Common.Data; @@ -39,19 +38,19 @@ /// public partial class AssessmentSectionView : UserControl, IMapView, IObserver { - private readonly BaseMap map; + private readonly MapControl mapControl; private AssessmentSectionBase data; /// /// Creates a new instance of . /// public AssessmentSectionView() { - map = new BaseMap + mapControl = new MapControl { Dock = DockStyle.Fill }; - Controls.Add(map); + Controls.Add(mapControl); } public object Data @@ -73,11 +72,11 @@ } } - public IMap Map + public IMapControl Map { get { - return map; + return mapControl; } } @@ -103,7 +102,7 @@ mapDataList.Add(GetHydraulicBoundaryLocations()); } - map.Data = new MapDataCollection(mapDataList, Resources.AssessmentSectionMap_DisplayName); + mapControl.Data = new MapDataCollection(mapDataList, Resources.AssessmentSectionMap_DisplayName); } private MapData GetReferenceLineData() Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs =================================================================== diff -u -r05f1e980d28b12f13fd803d9a6c682f708a325d9 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision 05f1e980d28b12f13fd803d9a6c682f708a325d9) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -53,14 +53,14 @@ } [Test] - public void DefaultConstructor_Always_AddsBaseMap() + public void DefaultConstructor_Always_AddsMapControl() { // Call var view = new AssessmentSectionView(); // Assert Assert.AreEqual(1, view.Controls.Count); - var mapObject = view.Controls[0] as BaseMap; + var mapObject = view.Controls[0] as MapControl; Assert.NotNull(mapObject); Assert.AreEqual(DockStyle.Fill, mapObject.Dock); Assert.IsNull(mapObject.Data); @@ -71,7 +71,7 @@ { // Setup var view = new AssessmentSectionView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; var assessmentSectionBase = new TestAssessmentSectionBase(); @@ -89,7 +89,7 @@ { // Setup var view = new AssessmentSectionView(); - var map = (BaseMap) view.Controls[0]; + var map = (MapControl) view.Controls[0]; var assessmentSectionBase = new TestAssessmentSectionBase { HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(), @@ -119,7 +119,7 @@ { // Setup var view = new AssessmentSectionView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; var assessmentSectionBase = new TestAssessmentSectionBase { @@ -146,7 +146,7 @@ { // Setup var view = new AssessmentSectionView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; var assessmentSectionBase = new TestAssessmentSectionBase { @@ -181,7 +181,7 @@ { // Setup var view = new AssessmentSectionView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; var assessmentSectionBase = new TestAssessmentSectionBase { @@ -222,7 +222,7 @@ { // Setup var view = new AssessmentSectionView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; var assessmentSectionBase = new TestAssessmentSectionBase { Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.Designer.cs =================================================================== diff -u -r05f1e980d28b12f13fd803d9a6c682f708a325d9 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.Designer.cs (.../PipingFailureMechanismView.Designer.cs) (revision 05f1e980d28b12f13fd803d9a6c682f708a325d9) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.Designer.cs (.../PipingFailureMechanismView.Designer.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -28,31 +28,31 @@ /// private void InitializeComponent() { - this.MapView = new Core.Components.DotSpatial.Forms.BaseMap(); + this.mapControl = new Core.Components.DotSpatial.Forms.MapControl(); this.SuspendLayout(); // // MapView // - this.MapView.Data = null; - this.MapView.Dock = System.Windows.Forms.DockStyle.Fill; - this.MapView.Location = new System.Drawing.Point(0, 0); - this.MapView.Name = "MapView"; - this.MapView.Size = new System.Drawing.Size(150, 150); - this.MapView.TabIndex = 0; - this.MapView.Text = "baseMap1"; + this.mapControl.Data = null; + this.mapControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.mapControl.Location = new System.Drawing.Point(0, 0); + this.mapControl.Name = "mapControl"; + this.mapControl.Size = new System.Drawing.Size(150, 150); + this.mapControl.TabIndex = 0; + this.mapControl.Text = "mapControl1"; // // PipingFailureMechanismView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.MapView); + this.Controls.Add(this.mapControl); this.Name = "PipingFailureMechanismView"; this.ResumeLayout(false); } #endregion - private Core.Components.DotSpatial.Forms.BaseMap MapView; + private Core.Components.DotSpatial.Forms.MapControl mapControl; } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs =================================================================== diff -u -r86e717a5477d55d1c4351f2857a1d76e220a3ab4 -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs (.../PipingFailureMechanismView.cs) (revision 86e717a5477d55d1c4351f2857a1d76e220a3ab4) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs (.../PipingFailureMechanismView.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -24,7 +24,6 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Base.Geometry; -using Core.Components.Gis; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using Ringtoets.Piping.Forms.PresentationObjects; @@ -65,11 +64,11 @@ } } - public IMap Map + public IMapControl Map { get { - return MapView; + return mapControl; } } @@ -134,7 +133,7 @@ } } - MapView.Data = new MapDataCollection(mapDataList, PipingDataResources.PipingFailureMechanism_DisplayName); } + mapControl.Data = new MapDataCollection(mapDataList, PipingDataResources.PipingFailureMechanism_DisplayName); } private MapData GetReferenceLineMapData() { Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs =================================================================== diff -u -ra927058f93a70b14989884a77f3b46a62e12532d -r30b12b82918d500fe834eafd9f6cd9b2c5dbe60f --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision a927058f93a70b14989884a77f3b46a62e12532d) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 30b12b82918d500fe834eafd9f6cd9b2c5dbe60f) @@ -35,14 +35,14 @@ } [Test] - public void DefaultConstructor_Always_AddsBaseMapWithoutData() + public void DefaultConstructor_Always_AddsMapControlWithoutData() { // Call var view = new PipingFailureMechanismView(); // Assert Assert.AreEqual(1, view.Controls.Count); - var mapObject = view.Controls[0] as BaseMap; + var mapObject = view.Controls[0] as MapControl; Assert.NotNull(mapObject); Assert.AreEqual(DockStyle.Fill, mapObject.Dock); Assert.IsNull(mapObject.Data); @@ -53,7 +53,7 @@ { // Setup var view = new PipingFailureMechanismView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; var assessmentSectionBase = new TestAssessmentSectionBase(); @@ -75,7 +75,7 @@ { // Setup var view = new PipingFailureMechanismView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; var refereceGeometryPoints = new[] { @@ -162,7 +162,7 @@ { // Setup var view = new PipingFailureMechanismView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; var assessmentSectionBase = new TestAssessmentSectionBase { @@ -192,7 +192,7 @@ { // Setup var view = new PipingFailureMechanismView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; var assessmentSectionBase = new TestAssessmentSectionBase { @@ -229,7 +229,7 @@ { // Setup var view = new PipingFailureMechanismView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; var assessmentSectionBase = new TestAssessmentSectionBase(); var pipingFailureMechanism = new PipingFailureMechanism(); @@ -260,7 +260,7 @@ { // Setup var view = new PipingFailureMechanismView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; var assessmentSectionBase = new TestAssessmentSectionBase { @@ -304,7 +304,7 @@ { // Setup var view = new PipingFailureMechanismView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; var assessmentSectionBase = new TestAssessmentSectionBase { @@ -359,7 +359,7 @@ var oldPipingFailureMechanismContext = new PipingFailureMechanismContext(new PipingFailureMechanism(), oldAssessmentSectionMock); var newPipingFailureMechanismContext = new PipingFailureMechanismContext(new PipingFailureMechanism(), newAssessmentSectionMock); var view = new PipingFailureMechanismView(); - var map = (BaseMap)view.Controls[0]; + var map = (MapControl)view.Controls[0]; view.Data = oldPipingFailureMechanismContext; view.Data = newPipingFailureMechanismContext;