protected HierarchyDirectoryTransfer(HierarchyDirectoryTransfer other) : base(other) { other.progressUpdateLock?.EnterWriteLock(); this.ProgressTracker = other.ProgressTracker.Copy(); lock (other.continuationTokenLock) { foreach (var subDirTransfer in other.subDirectories) { this.subDirectories.Enqueue(subDirTransfer); } foreach (var subDirTransfer in other.ongoingSubDirTransfers) { var newSubDirTransfer = new SubDirectoryTransfer(subDirTransfer.Key); this.ongoingSubDirTransfers.TryAdd(newSubDirTransfer, new object()); } // copy transfers this.subTransfers = other.subTransfers.Copy(); this.enumerationStarted = other.enumerationStarted; } this.subTransfers.OverallProgressTracker.Parent = this.ProgressTracker; other.progressUpdateLock?.ExitWriteLock(); }
public SubDirectoryTransfer( HierarchyDirectoryTransfer baseDirectoryTransfer, string relativePath) { this.enumerateContinuationToken = new SerializableListContinuationToken(null); this.baseDirectoryTransfer = baseDirectoryTransfer; this.relativePath = relativePath; this.baseDirectoryTransfer.GetSubDirLocation(this.relativePath, out this.source, out this.dest); this.InitializeEnumerator(); }
public void Update(HierarchyDirectoryTransfer baseDirectoryTransferInstance) { this.baseDirectoryTransfer = baseDirectoryTransferInstance; this.baseDirectoryTransfer.GetSubDirLocation(this.relativePath, out this.source, out this.dest); this.InitializeEnumerator(); }