mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[Peek] fixes and enhancements (#25963)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user