コード例 #1
0
 /// <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)
     {
     }
 }
コード例 #2
0
 /// <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);
         }
     }
 }