From 76b35d00a7af5d1b3b0baa7d33f3048e871ea0ce Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Sun, 19 May 2024 23:22:54 +0200 Subject: [PATCH] Minor changes --- MapControl/Shared/ImageFileCache.cs | 14 +++++++------- MapControl/Shared/MapBase.cs | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/MapControl/Shared/ImageFileCache.cs b/MapControl/Shared/ImageFileCache.cs index 6470f844..dab44604 100644 --- a/MapControl/Shared/ImageFileCache.cs +++ b/MapControl/Shared/ImageFileCache.cs @@ -9,8 +9,6 @@ using System; using System.Diagnostics; using System.IO; using System.Linq; -using System.Security.AccessControl; -using System.Security.Principal; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -24,7 +22,7 @@ namespace MapControl.Caching { private static readonly byte[] expirationTag = Encoding.ASCII.GetBytes("EXPIRES:"); - private readonly IDistributedCache memoryCache = new MemoryDistributedCache(Options.Create(new MemoryDistributedCacheOptions())); + private readonly MemoryDistributedCache memoryCache = new MemoryDistributedCache(Options.Create(new MemoryDistributedCacheOptions())); private readonly string rootDirectory; public ImageFileCache(string directory) @@ -379,14 +377,16 @@ namespace MapControl.Caching private static Task WriteAsync(Stream stream, byte[] bytes) => stream.WriteAsync(bytes, 0, bytes.Length); static partial void SetAccessControl(string path); -#if !UWP +#if !UWP && !AVALONIA static partial void SetAccessControl(string path) { var fileInfo = new FileInfo(path); var fileSecurity = fileInfo.GetAccessControl(); - var fullControlRule = new FileSystemAccessRule( - new SecurityIdentifier(WellKnownSidType.BuiltinUsersSid, null), - FileSystemRights.FullControl, AccessControlType.Allow); + var fullControlRule = new System.Security.AccessControl.FileSystemAccessRule( + new System.Security.Principal.SecurityIdentifier( + System.Security.Principal.WellKnownSidType.BuiltinUsersSid, null), + System.Security.AccessControl.FileSystemRights.FullControl, + System.Security.AccessControl.AccessControlType.Allow); fileSecurity.AddAccessRule(fullControlRule); fileInfo.SetAccessControl(fileSecurity); diff --git a/MapControl/Shared/MapBase.cs b/MapControl/Shared/MapBase.cs index ce8367ff..4f2f1fea 100644 --- a/MapControl/Shared/MapBase.cs +++ b/MapControl/Shared/MapBase.cs @@ -138,9 +138,8 @@ namespace MapControl } /// - /// Gets or sets the minimum value of the ZoomLevel and TargetZommLevel properties. - /// Must be greater than or equal to zero and less than or equal to MaxZoomLevel. - /// The default value is 1. + /// Gets or sets the minimum value of the ZoomLevel and TargetZoomLevel properties. + /// Must not be less than zero or greater than MaxZoomLevel. The default value is 1. /// public double MinZoomLevel { @@ -149,9 +148,8 @@ namespace MapControl } /// - /// Gets or sets the maximum value of the ZoomLevel and TargetZommLevel properties. - /// Must be greater than or equal to MinZoomLevel and less than or equal to 22. - /// The default value is 20. + /// Gets or sets the maximum value of the ZoomLevel and TargetZoomLevel properties. + /// Must not be less than MinZoomLevel. The default value is 20. /// public double MaxZoomLevel { @@ -245,9 +243,11 @@ namespace MapControl public Matrix GetMapTransform(Location location) { var scale = GetScale(location); - var matrix = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d); - matrix.Rotate(ViewTransform.Rotation); - return matrix; + + var transform = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d); + transform.Rotate(ViewTransform.Rotation); + + return transform; } ///