1515// along with SharpMap; if not, write to the Free Software
1616// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1717
18- using System ;
19- using System . Collections . Generic ;
20- using System . Collections . ObjectModel ;
21- using System . Drawing ;
22- using System . IO ;
23- using System . Windows . Forms ;
2418using DemoWinForm . Properties ;
2519using NetTopologySuite . Geometries ;
2620using SharpMap . Data ;
2721using SharpMap . Data . Providers ;
2822using SharpMap . Forms ;
29- using NetTopologySuite . Geometries ;
3023using SharpMap . Layers ;
24+ using System ;
25+ using System . Collections . Generic ;
26+ using System . Collections . ObjectModel ;
27+ using System . Drawing ;
28+ using System . IO ;
29+ using System . Windows . Forms ;
3130using GeoPoint = NetTopologySuite . Geometries . Coordinate ;
3231
3332namespace DemoWinForm
@@ -67,16 +66,16 @@ private void registerSymbols()
6766
6867 private static void registerKnownColors ( Dictionary < string , Color > colorTable )
6968 {
70- foreach ( string colorName in Enum . GetNames ( typeof ( KnownColor ) ) )
69+ foreach ( string colorName in Enum . GetNames ( typeof ( KnownColor ) ) )
7170 {
72- KnownColor color = ( KnownColor ) Enum . Parse ( typeof ( KnownColor ) , colorName ) ;
71+ KnownColor color = ( KnownColor ) Enum . Parse ( typeof ( KnownColor ) , colorName ) ;
7372 colorTable [ colorName ] = Color . FromKnownColor ( color ) ;
7473 }
7574 }
7675
7776 private void registerLayerFactories ( )
7877 {
79- // ConfigurationManager.GetSection("LayerFactories");
78+ // ConfigurationManager.GetSection("LayerFactories");
8079 _layerFactoryCatalog [ ".shp" ] = new ShapeFileLayerFactory ( ) ;
8180 }
8281
@@ -163,16 +162,16 @@ private static void GeneratePolygons(GeometryFactory factory, ICollection<Geomet
163162 for ( var polyIndex = 0 ; polyIndex < numPolygons ; polyIndex ++ )
164163 {
165164 var vertices = new GeoPoint [ 5 ] ;
166- var upperLeft = new GeoPoint ( rndGen . NextDouble ( ) * 1000 , rndGen . NextDouble ( ) * 1000 ) ;
167- var sideLength = rndGen . NextDouble ( ) * 50 ;
165+ var upperLeft = new GeoPoint ( rndGen . NextDouble ( ) * 1000 , rndGen . NextDouble ( ) * 1000 ) ;
166+ var sideLength = rndGen . NextDouble ( ) * 50 ;
168167
169168 // Make a square
170169 vertices [ 0 ] = new GeoPoint ( upperLeft . X , upperLeft . Y ) ;
171170 vertices [ 1 ] = new GeoPoint ( upperLeft . X + sideLength , upperLeft . Y ) ;
172171 vertices [ 2 ] = new GeoPoint ( upperLeft . X + sideLength , upperLeft . Y - sideLength ) ;
173172 vertices [ 3 ] = new GeoPoint ( upperLeft . X , upperLeft . Y - sideLength ) ;
174173 vertices [ 4 ] = upperLeft ;
175-
174+
176175 geometry . Add ( factory . CreatePolygon ( factory . CreateLinearRing ( vertices ) , null ) ) ;
177176 }
178177 }
@@ -185,7 +184,7 @@ private static void GenerateLines(GeometryFactory factory, ICollection<Geometry>
185184 var numVerticies = rndGen . Next ( 4 , 15 ) ;
186185 var vertices = new GeoPoint [ numVerticies ] ;
187186
188- var lastPoint = new GeoPoint ( rndGen . NextDouble ( ) * 1000 , rndGen . NextDouble ( ) * 1000 ) ;
187+ var lastPoint = new GeoPoint ( rndGen . NextDouble ( ) * 1000 , rndGen . NextDouble ( ) * 1000 ) ;
189188 vertices [ 0 ] = lastPoint ;
190189
191190 for ( var vertexIndex = 1 ; vertexIndex < numVerticies ; vertexIndex ++ )
@@ -205,7 +204,7 @@ private static void GeneratePoints(GeometryFactory factory, ICollection<Geometry
205204 var numPoints = rndGen . Next ( 10 , 100 ) ;
206205 for ( var pointIndex = 0 ; pointIndex < numPoints ; pointIndex ++ )
207206 {
208- var point = new GeoPoint ( rndGen . NextDouble ( ) * 1000 , rndGen . NextDouble ( ) * 1000 ) ;
207+ var point = new GeoPoint ( rndGen . NextDouble ( ) * 1000 , rndGen . NextDouble ( ) * 1000 ) ;
209208 geometry . Add ( factory . CreatePoint ( point ) ) ;
210209 }
211210 }
@@ -273,7 +272,7 @@ private void changeMode(MapBox.Tools tool)
273272
274273 private object getLayerTypeIcon ( Type type )
275274 {
276- if ( type == typeof ( VectorLayer ) )
275+ if ( type == typeof ( VectorLayer ) )
277276 {
278277 return Resources . polygon ;
279278 }
@@ -335,32 +334,32 @@ private void MainMapImage_MapQueried(FeatureDataTable data)
335334
336335 private void AddLayerToolStripButton_Click ( object sender , EventArgs e )
337336 {
338- BeginInvoke ( ( MethodInvoker ) delegate { LoadLayer ( ) ; } ) ;
337+ BeginInvoke ( ( MethodInvoker ) delegate { LoadLayer ( ) ; } ) ;
339338 }
340339
341340 private void RemoveLayerToolStripButton_Click ( object sender , EventArgs e )
342341 {
343- BeginInvoke ( ( MethodInvoker ) delegate { RemoveLayer ( ) ; } ) ;
342+ BeginInvoke ( ( MethodInvoker ) delegate { RemoveLayer ( ) ; } ) ;
344343 }
345344
346345 private void AddLayerToolStripMenuItem_Click ( object sender , EventArgs e )
347346 {
348- BeginInvoke ( ( MethodInvoker ) delegate { LoadLayer ( ) ; } ) ;
347+ BeginInvoke ( ( MethodInvoker ) delegate { LoadLayer ( ) ; } ) ;
349348 }
350349
351350 private void RemoveLayerToolStripMenuItem_Click ( object sender , EventArgs e )
352351 {
353- BeginInvoke ( ( MethodInvoker ) delegate { RemoveLayer ( ) ; } ) ;
352+ BeginInvoke ( ( MethodInvoker ) delegate { RemoveLayer ( ) ; } ) ;
354353 }
355354
356355 private void ZoomToExtentsToolStripButton_Click ( object sender , EventArgs e )
357356 {
358- BeginInvoke ( ( MethodInvoker ) delegate { zoomToExtents ( ) ; } ) ;
357+ BeginInvoke ( ( MethodInvoker ) delegate { zoomToExtents ( ) ; } ) ;
359358 }
360359
361360 private void PanToolStripButton_Click ( object sender , EventArgs e )
362361 {
363- BeginInvoke ( ( MethodInvoker ) delegate { changeMode ( MapBox . Tools . Pan ) ; } ) ;
362+ BeginInvoke ( ( MethodInvoker ) delegate { changeMode ( MapBox . Tools . Pan ) ; } ) ;
364363 }
365364
366365 private void QueryModeToolStripButton_Click ( object sender , EventArgs e )
@@ -418,7 +417,7 @@ private void MoveDownToolStripMenuItem_Click(object sender, EventArgs e)
418417
419418 private void LayersDataGridView_SelectionChanged ( object sender , EventArgs e )
420419 {
421- BeginInvoke ( ( MethodInvoker ) delegate
420+ BeginInvoke ( ( MethodInvoker ) delegate
422421 {
423422 changeUIOnLayerSelectionChange ( ) ;
424423
@@ -437,7 +436,7 @@ private void MainMapImage_MouseMove(GeoPoint WorldPos, MouseEventArgs ImagePos)
437436
438437 private void AddNewRandomGeometryLayer_Click ( object sender , EventArgs e )
439438 {
440- BeginInvoke ( ( MethodInvoker ) delegate { addNewRandomGeometryLayer ( ) ; } ) ;
439+ BeginInvoke ( ( MethodInvoker ) delegate { addNewRandomGeometryLayer ( ) ; } ) ;
441440 }
442441 }
443442}
0 commit comments