mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Compound assignments
This commit is contained in:
parent
0478b605b1
commit
e5f7a8d8c5
|
|
@ -19,7 +19,7 @@ namespace MapControl.MBTiles
|
|||
public class MBTileLayer : MapTileLayer
|
||||
{
|
||||
private static ILogger logger;
|
||||
private static ILogger Logger => logger ?? (logger = ImageLoader.LoggerFactory?.CreateLogger<MBTileLayer>());
|
||||
private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger<MBTileLayer>();
|
||||
|
||||
public static readonly DependencyProperty FileProperty =
|
||||
DependencyPropertyHelper.Register<MBTileLayer, string>(nameof(File), null,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace MapControl.MBTiles
|
|||
public sealed class MBTileSource : TileSource, IDisposable
|
||||
{
|
||||
private static ILogger logger;
|
||||
private static ILogger Logger => logger ?? (logger = ImageLoader.LoggerFactory?.CreateLogger<MBTileSource>());
|
||||
private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger<MBTileSource>();
|
||||
|
||||
private SQLiteConnection connection;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net9.0-windows;net462</TargetFrameworks>
|
||||
<LangVersion Condition="'$(TargetFramework)'=='net462'">8.0</LangVersion>
|
||||
<UseWPF>true</UseWPF>
|
||||
<DefineConstants>WPF</DefineConstants>
|
||||
<RootNamespace>MapControl.MBTiles</RootNamespace>
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net9.0-windows;net462</TargetFrameworks>
|
||||
<LangVersion Condition="'$(TargetFramework)'=='net462'">8.0</LangVersion>
|
||||
<UseWPF>true</UseWPF>
|
||||
<DefineConstants>WPF</DefineConstants>
|
||||
<RootNamespace>MapControl.Projections</RootNamespace>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net9.0-windows;net462</TargetFrameworks>
|
||||
<LangVersion Condition="'$(TargetFramework)'=='net462'">8.0</LangVersion>
|
||||
<UseWPF>true</UseWPF>
|
||||
<DefineConstants>WPF</DefineConstants>
|
||||
<RootNamespace>MapControl.UiTools</RootNamespace>
|
||||
|
|
|
|||
Loading…
Reference in a new issue