Update ImageFileCache

This commit is contained in:
ClemensFischer 2024-02-05 15:29:11 +01:00
parent 08adde21b8
commit 6a0cfe96d8
3 changed files with 4 additions and 4 deletions

View file

@ -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);
}

View file

@ -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)

View file

@ -61,7 +61,7 @@ namespace SampleApplication
Loaded += async (s, e) =>
{
await Task.Delay(2000);
await cache.Clean();
await cache.CleanAsync();
};
}
}