예제 #1
0
        public async Task CopyTo(string destinationPath)
        {
            await Task.Run(async() =>
            {
                try
                {
                    IO.Directory.CreateDirectory(destinationPath);
                }
                catch { }

                foreach (var item in _items)
                {
                    await item.CopyTo(IO.Path.Combine(destinationPath, item.Name));
                }

                CopiedFromToEvent?.Invoke(_itemFactory.CreateDirectory(destinationPath, ExcludedExtensions), destinationPath);
            }).ConfigureAwait(false);
        }
예제 #2
0
 /// <summary>
 /// Создание директории.
 /// </summary>
 /// <param name="directoryPath">Полный путь к директории.</param>
 /// <param name="excludedExtensions">Расширения файлов, которые не нужно считывать при загрузке директории.</param>
 /// <returns>Созданная директория.</returns>
 public IDirectory CreateDirectory(string directoryPath, string[] excludedExtensions)
 {
     return(_itemFactory.CreateDirectory(directoryPath, excludedExtensions));
 }