Пример #1
0
        /// <summary>
        /// Unschedules the delete.
        /// </summary>
        /// <param name="path">The path.</param>
        public void UnscheduleDelete(string path)
        {
            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentNullException("path");
            }

            path = QQnPath.EnsureRelativePath(_directory, path);

            if (!_data.Files.Contains(path))
            {
                return;                 // Not in DirectoryMap
            }
            DirectoryMapFile file = DoGetFile(path);

            file.ToBeDeleted = false;
        }
Пример #2
0
        /// <summary>
        /// Deletes the specified file if it is within the DirectoryMap
        /// </summary>
        /// <param name="path"></param>
        public void DeleteFile(string path)
        {
            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentNullException("path");
            }

            path = QQnPath.EnsureRelativePath(_directory, path);

            if (!_data.Files.Contains(path))
            {
                return;                 // Not in DirectoryMap
            }
            DirectoryMapFile file = DoGetFile(path);

            if (file.Exists)
            {
                File.Delete(file.FullName);
            }

            _data.Files.Remove(path);
        }