private void QuarantineCleanUp() { if (ItemWrappers.All(x => x.QuarantinedUntil.HasValue)) { // If all are quarantined then revive the oldest one! DateTime oldestQuarantinedDateTime = ItemWrappers .Where(x => x.QuarantinedUntil.HasValue) .Min(x => x.QuarantinedUntil.Value); ItemWrapper oldestQuarantinedItem = ItemWrappers .FirstOrDefault(x => x.QuarantinedUntil == oldestQuarantinedDateTime); oldestQuarantinedItem?.RemoveFromQuarantine(); } }
public void Dispose() { _currentItemWrapper?.RemoveFromQuarantine(); }