public static void DeleteIfTemporary(this ITempFilesManager tempFiles, string fileName) { if (tempFiles.IsTemporaryFile(fileName)) { File.Delete(fileName); } }
public static IConnectionParams RemovePathParamIfItRefersToTemporaryFile(IConnectionParams cp, ITempFilesManager mgr) { string fileName = cp[PathConnectionParam]; if (!string.IsNullOrEmpty(fileName)) { if (mgr.IsTemporaryFile(fileName)) { cp[PathConnectionParam] = null; } } return(cp); }
void ITempFilesCleanupList.Add(string fileName) { if (!tempFiles.IsTemporaryFile(fileName)) { return; } lock (sync) { if (disposed) { throw new ObjectDisposedException("ScopedTempFilesCollection"); } files.Add(fileName); } }