Пример #1
0
Файл: Folder.cs Проект: LKND/FM
        public override IEnumerable<ProgressInfo> Copy(AbstractFolder newFolder)
        {
            Open();

            var progressInfo = new ProgressInfo
            {
                All = FilesList.Count + DirectoriesList.Count
            };

            Directory.CreateDirectory(newFolder.Path);

            foreach (AbstractFile item in FilesList)
            {
                AbstractFile destination = newFolder.CreateFile(item.Name);
                item.Copy(destination);
                progressInfo.Current++;

                yield return progressInfo;
            }
            foreach (AbstractFolder item in DirectoriesList)
            {
                AbstractFolder createdFolder = newFolder.CreateFolder(item.Name);
                item.Copy(createdFolder);
                progressInfo.Current++;

                yield return progressInfo;
            }
        }
Пример #2
0
 public abstract IEnumerable<ProgressInfo> Copy(AbstractFolder nodeElement);