コード例 #1
0
        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);
            }
        }
コード例 #2
0
 public static FileName GetFileName(DirectoryName directoryName, string child)
 {
     return GetFileName(directoryName.Name.Combine(child));
 }
コード例 #3
0
        public Directory GetDirectory(DirectoryName name)
        {
            Directory directory = ResolveDirectory(name.Name);

            return directory;
        }
コード例 #4
0
 public DotNetDirectory(DirectoryName directoryName)
 {
     Name = directoryName;
 }
コード例 #5
0
 public abstract DirectoryName Combine(DirectoryName child);