protected void OnDirectoryStarted(FileSystemItemStartedEventArgs e)
 {
     if (DirectoryStarted != null)
     {
         DirectoryStarted(this, e);
     }
 }
        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));
            }
        }
 protected void OnFileStarted(FileSystemItemStartedEventArgs e)
 {
     if (FileStarted != null)
     {
         FileStarted(this, e);
     }
 }
        private void CopyFile(IFileInfo source, IFileInfo target)
        {
            _currentFile = new FileProgressInfo(source);
            if (FileStarted != null)
            {
                var fileSystemItemStartedEventArgs = new FileSystemItemStartedEventArgs(source.FullName, target.FullName,
                                                                                        source.Length);
                OnFileStarted(fileSystemItemStartedEventArgs);
                if (fileSystemItemStartedEventArgs.Cancel)
                {
                    return;
                }
            }

            CopyFileHelper(source, target);

            if (FileComplete != null)
            {
                OnFileComplete(new FileSystemItemCompleteEventArgs(source.FullName, target.FullName, source.Length,
                                                                   _currentFile.Stopwatch.Elapsed));
            }
        }