private void ParseDirListDeep(string path, FtpsItemCollection deepCol) { FtpsItemCollection list = GetDirList(path); deepCol.Merge(list); foreach (FtpsItem item in list) { // 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); } }