From 6a0cfe96d888bb395882213778fdf091c3efd395 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Mon, 5 Feb 2024 15:29:11 +0100 Subject: [PATCH] Update ImageFileCache --- MapControl/Shared/ImageFileCache.cs | 4 ++-- SampleApps/WinUiApp/MainWindow.xaml.cs | 2 +- SampleApps/WpfApplication/MainWindow.xaml.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MapControl/Shared/ImageFileCache.cs b/MapControl/Shared/ImageFileCache.cs index a66f7d4a..59e0aa61 100644 --- a/MapControl/Shared/ImageFileCache.cs +++ b/MapControl/Shared/ImageFileCache.cs @@ -32,7 +32,7 @@ namespace MapControl.Caching { if (string.IsNullOrEmpty(directory)) { - throw new ArgumentException("The directory argument must not be null or empty.", nameof(directory)); + throw new ArgumentException($"The {nameof(directory)} argument must not be null or empty.", nameof(directory)); } rootDirectory = directory; @@ -40,7 +40,7 @@ namespace MapControl.Caching Debug.WriteLine($"Created ImageFileCache in {rootDirectory}"); } - public Task Clean() + public Task CleanAsync() { return Task.Factory.StartNew(CleanRootDirectory, TaskCreationOptions.LongRunning); } diff --git a/SampleApps/WinUiApp/MainWindow.xaml.cs b/SampleApps/WinUiApp/MainWindow.xaml.cs index 62250551..b8b47dc6 100644 --- a/SampleApps/WinUiApp/MainWindow.xaml.cs +++ b/SampleApps/WinUiApp/MainWindow.xaml.cs @@ -94,7 +94,7 @@ namespace SampleApplication Activated -= WindowActivated; await Task.Delay(2000); - await ((ImageFileCache)TileImageLoader.Cache).Clean(); + await ((ImageFileCache)TileImageLoader.Cache).CleanAsync(); } private void ResetHeadingButtonClick(object sender, RoutedEventArgs e) diff --git a/SampleApps/WpfApplication/MainWindow.xaml.cs b/SampleApps/WpfApplication/MainWindow.xaml.cs index 9d2cf10d..fe24e4b1 100644 --- a/SampleApps/WpfApplication/MainWindow.xaml.cs +++ b/SampleApps/WpfApplication/MainWindow.xaml.cs @@ -61,7 +61,7 @@ namespace SampleApplication Loaded += async (s, e) => { await Task.Delay(2000); - await cache.Clean(); + await cache.CleanAsync(); }; } }