/// <summary>Deletes or recycles the file based on the conditional value.</summary>
 ///
 /// <param name="file">The path of the file to delete.</param>
 /// <param name="recycle">True if the file should be recycled.</param>
 /// <returns>True if the operation was successful.</returns>
 public bool DeleteOrRecycleFile(string file, bool recycle)
 {
     return(ui.Invoke(() => {
         FileOperationFlags flags = FileOperationFlags.None;
         if (recycle)
         {
             flags = FileOperationFlags.AllowUndo | FileOperationFlags.WarnFilesTooBigForRecycleBin;
         }
         SHFileOperationStruct fileOp = new SHFileOperationStruct {
             wFunc = FileOperationFunc.Delete,
             pFrom = file + '\0' + '\0',
             fFlags = flags,
         };
         return !SHFileOperation(ref fileOp);
     }));
 }
 public static extern bool SHFileOperation(ref SHFileOperationStruct FileOp);