mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Compound assignments
This commit is contained in:
parent
0478b605b1
commit
e5f7a8d8c5
8 changed files with 13 additions and 10 deletions
|
|
@ -8,7 +8,7 @@ namespace MapControl
|
|||
|
||||
public static MapProjectionFactory Instance
|
||||
{
|
||||
get => instance ?? (instance = new MapProjectionFactory());
|
||||
get => instance ??= new MapProjectionFactory();
|
||||
set => instance = value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ namespace MapControl
|
|||
|
||||
public ITileImageLoader TileImageLoader
|
||||
{
|
||||
get => tileImageLoader ?? (tileImageLoader = new TileImageLoader());
|
||||
get => tileImageLoader ??= new TileImageLoader();
|
||||
set => tileImageLoader = value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ namespace MapControl
|
|||
|
||||
public static WmtsCapabilities ReadCapabilities(XElement capabilitiesElement, string layer, string capabilitiesUrl)
|
||||
{
|
||||
var contentsElement = capabilitiesElement.Element(wmts + "Contents")
|
||||
?? throw new ArgumentException("Contents element not found.");
|
||||
var contentsElement = capabilitiesElement.Element(wmts + "Contents") ??
|
||||
throw new ArgumentException("Contents element not found.");
|
||||
|
||||
XElement layerElement;
|
||||
|
||||
|
|
@ -77,8 +77,8 @@ namespace MapControl
|
|||
|
||||
var styleElement = layerElement
|
||||
.Elements(wmts + "Style")
|
||||
.FirstOrDefault(s => s.Attribute("isDefault")?.Value == "true")
|
||||
?? layerElement
|
||||
.FirstOrDefault(s => s.Attribute("isDefault")?.Value == "true") ??
|
||||
layerElement
|
||||
.Elements(wmts + "Style")
|
||||
.FirstOrDefault();
|
||||
|
||||
|
|
@ -97,8 +97,8 @@ namespace MapControl
|
|||
{
|
||||
var tileMatrixSetElement = contentsElement
|
||||
.Elements(wmts + "TileMatrixSet")
|
||||
.FirstOrDefault(s => s.Element(ows + "Identifier")?.Value == tileMatrixSetId)
|
||||
?? throw new ArgumentException($"Linked TileMatrixSet element not found in Layer \"{layer}\".");
|
||||
.FirstOrDefault(s => s.Element(ows + "Identifier")?.Value == tileMatrixSetId) ??
|
||||
throw new ArgumentException($"Linked TileMatrixSet element not found in Layer \"{layer}\".");
|
||||
|
||||
tileMatrixSets.Add(ReadTileMatrixSet(tileMatrixSetElement));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue