0
0
mirror of https://github.com/sp-tarkov/installer.git synced 2025-02-13 08:50:45 -05:00
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"
});
}
}