/// <summary> /// Alternative Dispose() that suppresses <see cref="IOException"/>. /// </summary> /// <param name="handle"></param> public static void DisposeSuppressIOException(this ITempFileHandle handle) { try { handle.Dispose(); } catch (IOException) { } }
/// <summary> /// Handle callback from handle. /// </summary> /// <param name="handle"></param> /// <param name="deleted"></param> protected void HandleDisposed(ITempFileHandle handle, bool deleted) { // Remove from collection if delete succeeded. lock (m_lock) { handles.Remove(handle); // Delete failed, so add to to-delete list. if (!deleted) { ToDelete.Add(handle.Filename); } } }