This commit is contained in:
ClemensF 2020-04-16 23:15:03 +02:00
parent 3ffb613f80
commit 310f0cca9a
21 changed files with 51 additions and 86 deletions

View file

@ -38,12 +38,7 @@ namespace MapControl.Projections
get { return coordinateSystem; }
set
{
if (value == null)
{
throw new ArgumentNullException("The property value must not be null.");
}
coordinateSystem = value;
coordinateSystem = value ?? throw new ArgumentNullException("The property value must not be null.");
var transformFactory = new CoordinateTransformationFactory();

View file

@ -24,10 +24,9 @@ namespace MapControl.Projections
}
var hemisphere = value[value.Length - 1];
int zoneNumber;
if ((hemisphere != 'N' && hemisphere != 'S') ||
!int.TryParse(value.Substring(0, value.Length - 1), out zoneNumber))
!int.TryParse(value.Substring(0, value.Length - 1), out int zoneNumber))
{
throw new ArgumentException("Invalid UTM zone.");
}