コード例 #1
0
            public void Apply()
            {
                string newRelativePath;
                string newShortRelativePath;

                if (!_oldFullPath.StartsWithIgnoreCase(_rootDirectory))
                {
                    if (IsFileAllowed(_rootDirectory, _fullPath, _fileSystem, _fileSystemFilter, out newRelativePath, out newShortRelativePath))
                    {
                        _entries.AddFile(newRelativePath, newShortRelativePath);
                    }

                    return;
                }

                var oldRelativePath = PathHelper.MakeRelative(_rootDirectory, _oldFullPath);

                if (IsFileAllowed(_rootDirectory, _fullPath, _fileSystem, _fileSystemFilter, out newRelativePath, out newShortRelativePath))
                {
                    _entries.RenameFile(oldRelativePath, newRelativePath, newShortRelativePath);
                }
                else
                {
                    _entries.DeleteFile(oldRelativePath);
                }
            }
コード例 #2
0
            public void Apply()
            {
                if (!_fullPath.StartsWithIgnoreCase(_rootDirectory))
                {
                    return;
                }

                var relativePath = PathHelper.MakeRelative(_rootDirectory, _fullPath);

                _entries.DeleteFile(relativePath);
            }