Beispiel #1
0
 public bool DeleteFile()
 {
     if (CanDeleteFile)
     {
         RecycleBin.DeleteFileOrFolder(Path);
         return(true);
     }
     return(false);
 }
Beispiel #2
0
 public override bool DeleteFile(bool silent = false)
 {
     if (CanDeleteFile)
     {
         try
         {
             RecycleBin.DeleteFileOrFolder(Path);
             return(true);
         }
         catch (Exception e)
         {
             if (!silent)
             {
                 System.Windows.MessageBox.Show(e.Message, "Thrash Directory Failure", System.Windows.MessageBoxButton.OKCancel, System.Windows.MessageBoxImage.Exclamation);
             }
         }
     }
     return(false);
 }