private void ParseDirListDeep(string path, FtpItemCollection deepCol) { FtpItemCollection itemCol = GetDirList(path); deepCol.Merge(itemCol); foreach (FtpItem item in itemCol) { // if the this call is being completed asynchronously and the user requests a cancellation // then stop processing the items and return if (base.AsyncWorker != null && base.AsyncWorker.CancellationPending) return; // if the item is of type Directory then parse the directory list recursively if (item.ItemType == FtpItemType.Directory) ParseDirListDeep(item.FullPath, deepCol); } }
private void ParseDirListDeep(string path, FtpItemCollection deepCol) { FtpItemCollection itemCol = GetDirList(path); deepCol.Merge(itemCol); foreach (FtpItem item in itemCol) { if (base.AsyncWorker != null && base.AsyncWorker.CancellationPending) { return; } if (item.ItemType == FtpItemType.Directory) { ParseDirListDeep(item.FullPath, deepCol); } } }