Index: test/Common/SharpMapTestUtils/MapTestHelper.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- test/Common/SharpMapTestUtils/MapTestHelper.cs (.../MapTestHelper.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ test/Common/SharpMapTestUtils/MapTestHelper.cs (.../MapTestHelper.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -11,26 +11,16 @@ /// Provides common GIS testing functionality. /// public class MapTestHelper : Form // TODO: incapsulate Form as a local variable in ShowMap() - { - /// - /// Method show a new map control. - /// - /// - public static void ShowModal(Map map) - { - new MapTestHelper().ShowMap(map); - } + { + private readonly Label coordinateLabel; - private Label coordinateLabel; - public MapTestHelper() { MapControl = new MapControl(); MapControl.Dock = DockStyle.Fill; // disable dragdrop because it breaks the test runtime MapControl.AllowDrop = false; - - + Controls.Add(MapControl); coordinateLabel = new Label(); @@ -44,23 +34,32 @@ MapControl.ActivateTool(MapControl.SelectTool); } + public MapControl MapControl { get; set; } + + /// + /// Method show a new map control. + /// + /// + public static void ShowModal(Map map) + { + new MapTestHelper().ShowMap(map); + } + public void ShowMap(Map map) { MapControl.Map = map; map.ZoomToExtents(); MapControl.MouseMove += delegate(object sender, MouseEventArgs e) - { - var point = map.ImageToWorld(new PointF(e.X, e.Y)); - coordinateLabel.Text = string.Format("{0}:{1}", point.X, point.Y); - }; + { + var point = map.ImageToWorld(new PointF(e.X, e.Y)); + coordinateLabel.Text = string.Format("{0}:{1}", point.X, point.Y); + }; WindowsFormsTestHelper.ShowModal(this); map.Dispose(); } - - public MapControl MapControl { get; set; } } } \ No newline at end of file