private static void RemoveExpiredBackups(IOrderedEnumerable<SemiAutoSaveFileAttr> orderedList)
{
int found = 0;
foreach (var item in orderedList)
{
found++;
// 直近五個は保管しておく
if (found <= 6)
{
continue;
}
// 作成後五日後以内のものは残す
if (item.CreatedDate.AddDays(5) > DateTime.Today)
{
continue;
}
if (File.Exists(item.FullPath) == false)
{
continue;
}
try
{
File.Delete(item.FullPath);
}
catch (Exception)
{
}
}
}