private void CopyDirectory(IDirectoryInfo source, IDirectoryInfo target) { _currentDirectory = new DirectoryProgressInfo(source, source.Size); if (DirectoryStarted != null) { var fileSystemItemStartedEventArgs = new FileSystemItemStartedEventArgs(_currentDirectory.Directory.FullName, target.FullName, _currentDirectory.Size); OnDirectoryStarted(fileSystemItemStartedEventArgs); if (fileSystemItemStartedEventArgs.Cancel) { return; } } _currentDirectory.Stopwatch.Start(); CopyDirectoryHelper(source, target); _currentDirectory.Stopwatch.Stop(); if (DirectoryComplete != null) { OnDirectoryComplete(new FileSystemItemCompleteEventArgs(_currentDirectory.Directory.FullName, target.FullName, _currentDirectory.Size, _currentDirectory.Stopwatch.Elapsed)); } }
private void Initialize() { _currentFile = null; _currentDirectory = null; _averageTransferRate = new TransferRateInfo(); _fileChunkStopwatch = new Stopwatch(); _stopPending = false; }