public void Act() { if (deletedFile == null) { deletedFile = recycleBin.Send(oldPath); } notifyAct?.Invoke(oldPath); }
protected bool DeleteFile(string path, DeleteOptions delete) { try { if (delete == DeleteOptions.Permanent) { _logger.Log($"[DELETE] {path}"); FileSystem.File.Delete(path); } else { _logger.Log($"[RECYCLE] {path}"); _recycleBin.Send(path); } return(true); } catch (Exception exc) { _logger.Log($"Failed to delete '{path}': {exc.Message}"); return(false); } }