[Peek] fixes and enhancements (#25963)

This commit is contained in:
Seraphima Zykova
2023-05-12 15:34:20 +02:00
committed by GitHub
parent 912061d100
commit a3227da634
7 changed files with 62 additions and 18 deletions

View File

@@ -4,12 +4,21 @@
using System;
using System.IO;
using System.Threading.Tasks;
namespace Microsoft.PowerToys.FilePreviewCommon
{
public static class Helper
{
public static void CleanupTempDir(string folder)
public static Task<bool> CleanupTempDirAsync(string folder)
{
return Task.Run(() =>
{
return CleanupTempDir(folder);
});
}
public static bool CleanupTempDir(string folder)
{
try
{
@@ -18,10 +27,14 @@ namespace Microsoft.PowerToys.FilePreviewCommon
{
file.Delete();
}
return true;
}
catch (Exception)
{
}
return false;
}
}
}