Example #1
0
        public void Act()
        {
            if (deletedFile == null)
            {
                deletedFile = recycleBin.Send(oldPath);
            }

            notifyAct?.Invoke(oldPath);
        }
Example #2
0
        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);
            }
        }