private void diskSpaceCheckTimer_Tick(object sender, EventArgs e) { string drive = System.IO.Path.GetPathRoot(Properties.Settings.Default.OutputPath); var space = FileSystemStorage.GetFreeDiskSpaceBytes(drive); long diskQuota = long.Parse(Properties.Settings.Default.DiskQuota) * (1024 * 1024); if (space <= diskQuota && !isDeleting) { isDeleting = true; System.Threading.ThreadPool.QueueUserWorkItem((o) => { try { FileSystemStorage.DeleteMostOutDatedDataForDay(1); } catch (System.IO.IOException) { } finally { isDeleting = false; } }, null ); } }
private static long FreeDiskSpaceBytes() { return(FileSystemStorage.GetFreeDiskSpaceBytes(Properties.Settings.Default.OutputPath)); }