public void CopyTo(DirectoryName path) { //refactor this out? if (!System.IO.Directory.Exists(path.GetPath())) System.IO.Directory.CreateDirectory(path.GetPath()); // Copy all files. var files = GetFiles(); foreach (var file in files) { var fileDestination = FileName.GetFileName(path, file.Name.GetName()); file.CopyTo(fileDestination); } // Process subdirectories. var dirs = GetDirectories(); foreach (var dir in dirs) { var destinationDir = DirectoryName.GetDirectoryName(path, dir.Name.GetName()); dir.CopyTo(destinationDir); } }
public static FileName GetFileName(DirectoryName directoryName, string child) { return GetFileName(directoryName.Name.Combine(child)); }
public Directory GetDirectory(DirectoryName name) { Directory directory = ResolveDirectory(name.Name); return directory; }
public DotNetDirectory(DirectoryName directoryName) { Name = directoryName; }
public abstract DirectoryName Combine(DirectoryName child);