Minor changes

This commit is contained in:
ClemensFischer 2024-05-19 23:22:54 +02:00
parent 7e18b6b984
commit 76b35d00a7
2 changed files with 16 additions and 16 deletions

View file

@ -9,8 +9,6 @@ using System;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Security.AccessControl;
using System.Security.Principal;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -24,7 +22,7 @@ namespace MapControl.Caching
{ {
private static readonly byte[] expirationTag = Encoding.ASCII.GetBytes("EXPIRES:"); 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; private readonly string rootDirectory;
public ImageFileCache(string directory) 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); private static Task WriteAsync(Stream stream, byte[] bytes) => stream.WriteAsync(bytes, 0, bytes.Length);
static partial void SetAccessControl(string path); static partial void SetAccessControl(string path);
#if !UWP #if !UWP && !AVALONIA
static partial void SetAccessControl(string path) static partial void SetAccessControl(string path)
{ {
var fileInfo = new FileInfo(path); var fileInfo = new FileInfo(path);
var fileSecurity = fileInfo.GetAccessControl(); var fileSecurity = fileInfo.GetAccessControl();
var fullControlRule = new FileSystemAccessRule( var fullControlRule = new System.Security.AccessControl.FileSystemAccessRule(
new SecurityIdentifier(WellKnownSidType.BuiltinUsersSid, null), new System.Security.Principal.SecurityIdentifier(
FileSystemRights.FullControl, AccessControlType.Allow); System.Security.Principal.WellKnownSidType.BuiltinUsersSid, null),
System.Security.AccessControl.FileSystemRights.FullControl,
System.Security.AccessControl.AccessControlType.Allow);
fileSecurity.AddAccessRule(fullControlRule); fileSecurity.AddAccessRule(fullControlRule);
fileInfo.SetAccessControl(fileSecurity); fileInfo.SetAccessControl(fileSecurity);

View file

@ -138,9 +138,8 @@ namespace MapControl
} }
/// <summary> /// <summary>
/// Gets or sets the minimum value of the ZoomLevel and TargetZommLevel properties. /// Gets or sets the minimum value of the ZoomLevel and TargetZoomLevel properties.
/// Must be greater than or equal to zero and less than or equal to MaxZoomLevel. /// Must not be less than zero or greater than MaxZoomLevel. The default value is 1.
/// The default value is 1.
/// </summary> /// </summary>
public double MinZoomLevel public double MinZoomLevel
{ {
@ -149,9 +148,8 @@ namespace MapControl
} }
/// <summary> /// <summary>
/// Gets or sets the maximum value of the ZoomLevel and TargetZommLevel properties. /// Gets or sets the maximum value of the ZoomLevel and TargetZoomLevel properties.
/// Must be greater than or equal to MinZoomLevel and less than or equal to 22. /// Must not be less than MinZoomLevel. The default value is 20.
/// The default value is 20.
/// </summary> /// </summary>
public double MaxZoomLevel public double MaxZoomLevel
{ {
@ -245,9 +243,11 @@ namespace MapControl
public Matrix GetMapTransform(Location location) public Matrix GetMapTransform(Location location)
{ {
var scale = GetScale(location); var scale = GetScale(location);
var matrix = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d);
matrix.Rotate(ViewTransform.Rotation); var transform = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d);
return matrix; transform.Rotate(ViewTransform.Rotation);
return transform;
} }
/// <summary> /// <summary>