Removed string.Empty

This commit is contained in:
ClemensFischer 2024-07-12 18:42:18 +02:00
parent e67d7ee1e3
commit 37b3809b8f
6 changed files with 13 additions and 17 deletions

View file

@ -37,7 +37,7 @@ namespace MapControl
/// <summary>
/// Gets the WMS 1.3.0 CRS identifier.
/// </summary>
public string CrsId { get; protected set; } = string.Empty;
public string CrsId { get; protected set; } = "";
/// <summary>
/// Gets or sets an optional projection center.

View file

@ -31,7 +31,7 @@ namespace MapControl
async (layer, oldValue, newValue) => await layer.UpdateImageAsync());
public static readonly DependencyProperty WmsStylesProperty =
DependencyPropertyHelper.Register<WmsImageLayer, string>(nameof(WmsStyles), string.Empty,
DependencyPropertyHelper.Register<WmsImageLayer, string>(nameof(WmsStyles), "",
async (layer, oldValue, newValue) => await layer.UpdateImageAsync());
public static readonly DependencyProperty WmsLayersProperty =

View file

@ -84,20 +84,16 @@ namespace MapControl
var styleElement = layerElement
.Elements(wmts + "Style")
.FirstOrDefault(s => s.Attribute("isDefault")?.Value == "true");
if (styleElement == null)
{
styleElement = layerElement
.Elements(wmts + "Style")
.FirstOrDefault();
}
.FirstOrDefault(s => s.Attribute("isDefault")?.Value == "true")
?? layerElement
.Elements(wmts + "Style")
.FirstOrDefault();
var style = styleElement?.Element(ows + "Identifier")?.Value;
if (string.IsNullOrEmpty(style))
{
throw new ArgumentException($"No Style element found in Layer \"{layer}\".");
style = "default";
}
var urlTemplate = ReadUrlTemplate(capabilitiesElement, layerElement, layer, style, capabilitiesUrl);

View file

@ -89,14 +89,14 @@ namespace SampleApplication
else
{
mouseLocation.Visibility = Visibility.Collapsed;
mouseLocation.Text = string.Empty;
mouseLocation.Text = "";
}
}
private void MapPointerExited(object sender, PointerRoutedEventArgs e)
{
mouseLocation.Visibility = Visibility.Collapsed;
mouseLocation.Text = string.Empty;
mouseLocation.Text = "";
}
private static string GetLatLonText(Location location)

View file

@ -102,14 +102,14 @@ namespace SampleApplication
else
{
mouseLocation.Visibility = Visibility.Collapsed;
mouseLocation.Text = string.Empty;
mouseLocation.Text = "";
}
}
private void MapPointerExited(object sender, PointerRoutedEventArgs e)
{
mouseLocation.Visibility = Visibility.Collapsed;
mouseLocation.Text = string.Empty;
mouseLocation.Text = "";
}
private static string GetLatLonText(Location location)

View file

@ -94,14 +94,14 @@ namespace SampleApplication
else
{
mouseLocation.Visibility = Visibility.Collapsed;
mouseLocation.Text = string.Empty;
mouseLocation.Text = "";
}
}
private void MapMouseLeave(object sender, MouseEventArgs e)
{
mouseLocation.Visibility = Visibility.Collapsed;
mouseLocation.Text = string.Empty;
mouseLocation.Text = "";
}
private void MapManipulationInertiaStarting(object sender, ManipulationInertiaStartingEventArgs e)