SPT-AKI-Installer/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml.cs

28 lines
750 B
C#

using Avalonia.Controls;
using SPTInstaller.Helpers;
using System.Diagnostics;
namespace SPTInstaller.CustomControls.Dialogs;
public partial class WhyCacheThoughDialog : UserControl
{
public WhyCacheThoughDialog()
{
InitializeComponent();
}
public bool CacheExists => Directory.Exists(DownloadCacheHelper.CachePath);
public void OpenCacheFolder()
{
if (!CacheExists)
return;
Process.Start(new ProcessStartInfo()
{
FileName = Path.EndsInDirectorySeparator(DownloadCacheHelper.CachePath) ? DownloadCacheHelper.CachePath : DownloadCacheHelper.CachePath + Path.DirectorySeparatorChar,
UseShellExecute = true,
Verb = "open"
});
}
}