예제 #1
0
 public void TearDown()
 {
     if (File.Exists(_widgetFile.Path))
     {
         File.Delete(_widgetFile.Path);
     }
     if (Directory.Exists(_secondActivityFolder))
     {
         RobustIO.DeleteDirectoryAndContents(_secondActivityFolder);
     }
 }
예제 #2
0
 // See comment on class above regarding Dispose
 public void Dispose()
 {
     if (_detached)
     {
         return;
     }
     try
     {
         RobustFile.Delete(Path);
     }
     catch (IOException e)
     {
         // We tried, but we don't want to crash just because virus scanner or similar won't release the file.
         Debug.Fail("Could not delete temp file during Dispose(): " + e.Message, e.ToString());
     }
     if (_folderToDelete != null)
     {
         RobustIO.DeleteDirectoryAndContents(_folderToDelete);
     }
 }
예제 #3
0
 public static bool DeleteDirectoryRobust(string path, bool overrideReadOnly = true)
 {
     return(RobustIO.DeleteDirectoryAndContents(path, overrideReadOnly));
 }