private void PendingGetCompletion(object sender, PendingGetResult result) { try { result.EnsureSuccess(); ProcessFoundItems(result, true); ProcessNotFoundItems(result); } catch (Exception ex) { ProcessError(result, ex); } }
internal async Task <PendingGetResult> DownloadAsyncImpl(IList <ItemKey> keys, IList <string> typeVersions, PendingGetCompletionDelegate callback, CancellationToken cancelToken) { if (callback != null) { // // Run the download in the background. // Return what we have right away, and notify caller when pending items arrive // Task task = DownloadItems(keys, typeVersions, callback, cancelToken); return(null); } // // Wait for download to complete... // PendingGetResult result = await DownloadItems(keys, typeVersions, callback, cancelToken); result.EnsureSuccess(); return(result); }