mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
ImageFileCache FileShare
This commit is contained in:
parent
16d477a31d
commit
e0eb50b7da
|
|
@ -326,7 +326,7 @@ namespace MapControl.Caching
|
|||
|
||||
private static byte[] ReadAllBytes(FileInfo file)
|
||||
{
|
||||
using var stream = file.OpenRead();
|
||||
using var stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||
var buffer = new byte[stream.Length];
|
||||
var offset = 0;
|
||||
|
||||
|
|
@ -340,7 +340,7 @@ namespace MapControl.Caching
|
|||
|
||||
private static async Task<byte[]> ReadAllBytes(FileInfo file, CancellationToken token)
|
||||
{
|
||||
using var stream = file.OpenRead();
|
||||
using var stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||
var buffer = new byte[stream.Length];
|
||||
var offset = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#if WPF
|
||||
using System.Linq;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
|
@ -176,7 +177,7 @@ namespace MapControl
|
|||
{
|
||||
availableSize = new Size(double.PositiveInfinity, double.PositiveInfinity);
|
||||
|
||||
foreach (FrameworkElement element in Children)
|
||||
foreach (var element in Children.OfType<FrameworkElement>())
|
||||
{
|
||||
element.Measure(availableSize);
|
||||
}
|
||||
|
|
@ -188,7 +189,7 @@ namespace MapControl
|
|||
{
|
||||
if (parentMap != null)
|
||||
{
|
||||
foreach (FrameworkElement element in Children)
|
||||
foreach (var element in Children.OfType<FrameworkElement>())
|
||||
{
|
||||
ArrangeChildElement(element, finalSize);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ namespace MapControl
|
|||
{
|
||||
foreach (var tile in Tiles)
|
||||
{
|
||||
// Arrange tiles relative to XMin/YMin.
|
||||
// Arrange tiles relative to TileMatrix.XMin/YMin.
|
||||
//
|
||||
var tileSize = TileSize << (TileMatrix.ZoomLevel - tile.ZoomLevel);
|
||||
var x = tileSize * tile.X - TileSize * TileMatrix.XMin;
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ namespace MapControl
|
|||
{
|
||||
foreach (var tile in Tiles)
|
||||
{
|
||||
// Arrange tiles relative to XMin/YMin.
|
||||
// Arrange tiles relative to TileMatrix.XMin/YMin.
|
||||
//
|
||||
var tileWidth = WmtsTileMatrix.TileWidth;
|
||||
var tileHeight = WmtsTileMatrix.TileHeight;
|
||||
|
|
|
|||
Loading…
Reference in a new issue