Skip to content

Commit ba7263a

Browse files
committed
fixed code compilation
1 parent b7c7853 commit ba7263a

184 files changed

Lines changed: 3175 additions & 3461 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.ComponentModel;
4-
using System.Data;
5-
using System.Drawing;
6-
using System.Text;
72
using System.Windows.Forms;
83

94
namespace DemoWinForm
105
{
11-
public partial class ConvertProjectionAndCoordinatesForm : Form
12-
{
13-
public ConvertProjectionAndCoordinatesForm()
14-
{
15-
InitializeComponent();
16-
}
6+
public partial class ConvertProjectionAndCoordinatesForm : Form
7+
{
8+
public ConvertProjectionAndCoordinatesForm()
9+
{
10+
InitializeComponent();
11+
}
1712

18-
protected override void OnResize(EventArgs e)
19-
{
20-
base.OnResize(e);
13+
protected override void OnResize(EventArgs e)
14+
{
15+
base.OnResize(e);
2116

22-
MainSplitContainer.SplitterDistance = (Width - MainSplitContainer.SplitterWidth) / 2;
23-
}
24-
}
17+
MainSplitContainer.SplitterDistance = (Width - MainSplitContainer.SplitterWidth) / 2;
18+
}
19+
}
2520
}

Examples/DemoWinForm/DemoWinForm.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
<Reference Include="System.Windows.Forms" />
2323
</ItemGroup>
2424

25-
<ItemGroup>
26-
<PackageReference Include="ProjNet4GeoAPI" Version="1.4.1" />
27-
</ItemGroup>
28-
2925
<ItemGroup>
3026
<ProjectReference Include="..\..\SharpMap\SharpMap.csproj" />
3127
<ProjectReference Include="..\..\SharpMap.UI\SharpMap.UI.csproj" />

Examples/DemoWinForm/MainForm.cs

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,18 @@
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;
2418
using DemoWinForm.Properties;
2519
using NetTopologySuite.Geometries;
2620
using SharpMap.Data;
2721
using SharpMap.Data.Providers;
2822
using SharpMap.Forms;
29-
using NetTopologySuite.Geometries;
3023
using 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;
3130
using GeoPoint = NetTopologySuite.Geometries.Coordinate;
3231

3332
namespace 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
}

Examples/DemoWinForm/Program.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
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.Text;
20-
using System.Windows.Forms;
2118
using NetTopologySuite;
2219
using ProjNet.CoordinateSystems;
2320
using ProjNet.CoordinateSystems.Transformations;
21+
using System;
22+
using System.Windows.Forms;
2423

2524
namespace DemoWinForm
2625
{
@@ -32,13 +31,11 @@ internal static class Program
3231
[STAThread]
3332
private static void Main()
3433
{
35-
var gss = new NtsGeometryServices();
34+
var gss = NtsGeometryServices.Instance;
3635
var css = new SharpMap.CoordinateSystems.CoordinateSystemServices(
3736
new CoordinateSystemFactory(),
3837
new CoordinateTransformationFactory(),
3938
SharpMap.Converters.WellKnownText.SpatialReference.GetAllReferenceSystems());
40-
41-
NetTopologySuite.GeometryServiceProvider.Instance = gss;
4239
SharpMap.Session.Instance
4340
.SetGeometryServices(gss)
4441
.SetCoordinateSystemServices(css)
@@ -49,4 +46,4 @@ private static void Main()
4946
Application.Run(new MainForm());
5047
}
5148
}
52-
}
49+
}

Examples/ExampleCodeSnippets/CreatingData.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ public static System.Double[] GetRandomOrdinates(System.Int32 size, System.Doubl
3232
return arr;
3333
}
3434

35-
35+
3636
/// <summary>
3737
/// Creates a FeatureDataTable from arrays of x, y and z components
3838
/// </summary>
3939
/// <param name="xcomponents">an array of doubles representing the x ordinate values</param>
4040
/// <param name="ycomponents">an array of doubles representing the y ordinate values</param>
4141
/// <param name="zcomponents">an array of doubles representing the z ordinate values</param>
4242
/// <returns></returns>
43-
public static SharpMap.Data.FeatureDataTable CreatePointFeatureDataTableFromArrays(double[] xcomponents,
43+
public static SharpMap.Data.FeatureDataTable CreatePointFeatureDataTableFromArrays(double[] xcomponents,
4444
double[] ycomponents,
4545
double[] zcomponents, double[] data = null)
4646
{
@@ -60,17 +60,17 @@ public static SharpMap.Data.FeatureDataTable CreatePointFeatureDataTableFromArra
6060
}
6161

6262
var fdt = new SharpMap.Data.FeatureDataTable();
63-
fdt.Columns.Add("TimeStamp", typeof (System.DateTime)); // add example timestamp attribute
63+
fdt.Columns.Add("TimeStamp", typeof(System.DateTime)); // add example timestamp attribute
6464
if (data != null)
6565
fdt.Columns.Add("Data", typeof(System.Double)); // add example timestamp attribute
6666

67-
67+
6868
for (var i = 0; i < xcomponents.Length; i++)
6969
{
7070
SharpMap.Data.FeatureDataRow fdr = fdt.NewRow();
7171

7272
fdr.Geometry = factory.CreatePoint(threedee
73-
? new NetTopologySuite.Geometries.Coordinate(xcomponents[i], ycomponents[i], zcomponents[i])
73+
? new NetTopologySuite.Geometries.CoordinateZ(xcomponents[i], ycomponents[i], zcomponents[i])
7474
: new NetTopologySuite.Geometries.Coordinate(xcomponents[i], ycomponents[i]));
7575

7676
fdr["TimeStamp"] = System.DateTime.Now; //set the timestamp property
@@ -86,15 +86,15 @@ public static SharpMap.Data.FeatureDataTable CreatePointFeatureDataTableFromArra
8686

8787
public static class ShapeFactory
8888
{
89-
public static NetTopologySuite.Geometries.LinearRing CreateRectangle(NetTopologySuite.Geometries.GeometryFactory factory,
89+
public static NetTopologySuite.Geometries.LinearRing CreateRectangle(NetTopologySuite.Geometries.GeometryFactory factory,
9090
NetTopologySuite.Geometries.Coordinate leftTop, NetTopologySuite.Geometries.Coordinate rightBottom)
9191
{
9292
var pts = new[]
9393
{
94-
leftTop,
95-
new NetTopologySuite.Geometries.Coordinate(rightBottom.X, leftTop.Y),
94+
leftTop,
95+
new NetTopologySuite.Geometries.Coordinate(rightBottom.X, leftTop.Y),
9696
rightBottom,
97-
new NetTopologySuite.Geometries.Coordinate(leftTop.X, rightBottom.Y),
97+
new NetTopologySuite.Geometries.Coordinate(leftTop.X, rightBottom.Y),
9898
leftTop
9999
};
100100
return factory.CreateLinearRing(pts);
@@ -140,7 +140,7 @@ public class TestShapeFactory
140140
{
141141
public static readonly NetTopologySuite.Geometries.GeometryFactory Factory =
142142
new NetTopologySuite.Geometries.GeometryFactory(new NetTopologySuite.Geometries.PrecisionModel(1000));
143-
143+
144144
[NUnit.Framework.Test]
145145
public void TestRectangle()
146146
{
@@ -196,4 +196,4 @@ public void TestLayer()
196196
mapimage.Save("ellipse.png", System.Drawing.Imaging.ImageFormat.Png);
197197
}
198198
}
199-
}
199+
}

0 commit comments

Comments
 (0)