Ejemplo n.º 1
0
 public void TearDown()
 {
     if (File.Exists(_widgetFile.Path))
     {
         File.Delete(_widgetFile.Path);
     }
     if (Directory.Exists(_secondActivityFolder))
     {
         RobustIO.DeleteDirectoryAndContents(_secondActivityFolder);
     }
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 3
0
 public static bool DeleteDirectoryRobust(string path, bool overrideReadOnly = true)
 {
     return(RobustIO.DeleteDirectoryAndContents(path, overrideReadOnly));
 }