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
|
public class MBTileLayer : MapTileLayer
|
||||||
{
|
{
|
||||||
private static ILogger logger;
|
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 =
|
public static readonly DependencyProperty FileProperty =
|
||||||
DependencyPropertyHelper.Register<MBTileLayer, string>(nameof(File), null,
|
DependencyPropertyHelper.Register<MBTileLayer, string>(nameof(File), null,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace MapControl.MBTiles
|
||||||
public sealed class MBTileSource : TileSource, IDisposable
|
public sealed class MBTileSource : TileSource, IDisposable
|
||||||
{
|
{
|
||||||
private static ILogger logger;
|
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;
|
private SQLiteConnection connection;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net9.0-windows;net462</TargetFrameworks>
|
<TargetFrameworks>net9.0-windows;net462</TargetFrameworks>
|
||||||
|
<LangVersion Condition="'$(TargetFramework)'=='net462'">8.0</LangVersion>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<DefineConstants>WPF</DefineConstants>
|
<DefineConstants>WPF</DefineConstants>
|
||||||
<RootNamespace>MapControl.MBTiles</RootNamespace>
|
<RootNamespace>MapControl.MBTiles</RootNamespace>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace MapControl
|
||||||
|
|
||||||
public static MapProjectionFactory Instance
|
public static MapProjectionFactory Instance
|
||||||
{
|
{
|
||||||
get => instance ?? (instance = new MapProjectionFactory());
|
get => instance ??= new MapProjectionFactory();
|
||||||
set => instance = value;
|
set => instance = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ namespace MapControl
|
||||||
|
|
||||||
public ITileImageLoader TileImageLoader
|
public ITileImageLoader TileImageLoader
|
||||||
{
|
{
|
||||||
get => tileImageLoader ?? (tileImageLoader = new TileImageLoader());
|
get => tileImageLoader ??= new TileImageLoader();
|
||||||
set => tileImageLoader = value;
|
set => tileImageLoader = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ namespace MapControl
|
||||||
|
|
||||||
public static WmtsCapabilities ReadCapabilities(XElement capabilitiesElement, string layer, string capabilitiesUrl)
|
public static WmtsCapabilities ReadCapabilities(XElement capabilitiesElement, string layer, string capabilitiesUrl)
|
||||||
{
|
{
|
||||||
var contentsElement = capabilitiesElement.Element(wmts + "Contents")
|
var contentsElement = capabilitiesElement.Element(wmts + "Contents") ??
|
||||||
?? throw new ArgumentException("Contents element not found.");
|
throw new ArgumentException("Contents element not found.");
|
||||||
|
|
||||||
XElement layerElement;
|
XElement layerElement;
|
||||||
|
|
||||||
|
|
@ -77,8 +77,8 @@ namespace MapControl
|
||||||
|
|
||||||
var styleElement = layerElement
|
var styleElement = layerElement
|
||||||
.Elements(wmts + "Style")
|
.Elements(wmts + "Style")
|
||||||
.FirstOrDefault(s => s.Attribute("isDefault")?.Value == "true")
|
.FirstOrDefault(s => s.Attribute("isDefault")?.Value == "true") ??
|
||||||
?? layerElement
|
layerElement
|
||||||
.Elements(wmts + "Style")
|
.Elements(wmts + "Style")
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
|
@ -97,8 +97,8 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
var tileMatrixSetElement = contentsElement
|
var tileMatrixSetElement = contentsElement
|
||||||
.Elements(wmts + "TileMatrixSet")
|
.Elements(wmts + "TileMatrixSet")
|
||||||
.FirstOrDefault(s => s.Element(ows + "Identifier")?.Value == tileMatrixSetId)
|
.FirstOrDefault(s => s.Element(ows + "Identifier")?.Value == tileMatrixSetId) ??
|
||||||
?? throw new ArgumentException($"Linked TileMatrixSet element not found in Layer \"{layer}\".");
|
throw new ArgumentException($"Linked TileMatrixSet element not found in Layer \"{layer}\".");
|
||||||
|
|
||||||
tileMatrixSets.Add(ReadTileMatrixSet(tileMatrixSetElement));
|
tileMatrixSets.Add(ReadTileMatrixSet(tileMatrixSetElement));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net9.0-windows;net462</TargetFrameworks>
|
<TargetFrameworks>net9.0-windows;net462</TargetFrameworks>
|
||||||
|
<LangVersion Condition="'$(TargetFramework)'=='net462'">8.0</LangVersion>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<DefineConstants>WPF</DefineConstants>
|
<DefineConstants>WPF</DefineConstants>
|
||||||
<RootNamespace>MapControl.Projections</RootNamespace>
|
<RootNamespace>MapControl.Projections</RootNamespace>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net9.0-windows;net462</TargetFrameworks>
|
<TargetFrameworks>net9.0-windows;net462</TargetFrameworks>
|
||||||
|
<LangVersion Condition="'$(TargetFramework)'=='net462'">8.0</LangVersion>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<DefineConstants>WPF</DefineConstants>
|
<DefineConstants>WPF</DefineConstants>
|
||||||
<RootNamespace>MapControl.UiTools</RootNamespace>
|
<RootNamespace>MapControl.UiTools</RootNamespace>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue