Exemple #1
0
        public void CopyTo(IWritableDirectory destination)
        {
            foreach (var file in Files)
            {
                destination.GetOrCreateFile(file.Name).CopyFrom(file);
            }

            foreach (var dir in Directories)
            {
                var subDir = destination.GetOrCreateDirectory(dir.Name);
                dir.CopyTo(subDir);
            }
        }
Exemple #2
0
        public void CopyTo(IWritableDirectory destination)
        {
            for (var i = 0; i < _files.Count; i++)
            {
                var c        = _files[i];
                var destFile = destination.GetOrCreateFile(c.Name);
                destFile.CopyFrom(c);
            }

            for (var i = 0; i < _directories.Count; i++)
            {
                var c      = _directories[i];
                var newDir = destination.GetOrCreateDirectory(c.Name);
                c.CopyTo(newDir);
            }
        }
Exemple #3
0
        public void CopyTo(IWritableDirectory destination)
        {
            for (var i = 0; i < _files.Count; i++)
            {
                var c        = _files[i];
                var destFile = destination.GetOrCreateFile(c.Name);
                using (var destStream = destFile.GetStream())
                {
                    c.CopyToStream(destStream);
                }
            }

            for (var i = 0; i < _directories.Count; i++)
            {
                var c      = _directories[i];
                var newDir = destination.GetOrCreateDirectory(c.Name);
                c.CopyTo(newDir);
            }
        }