CheckoutManager DownloadFilesAsync - How to use for downloading large amounts of files?

Hi Community,

does anyone of you have sample code for "downloadFilesAsync" C# function?

Aras Innovator provides the CheckoutManager to download Files from the Filevault to the server. There are a couple of examples that show how to use "DownloadFiles", but I have found none that shows how to use "DownloadFilesAsync".

This piece of code does nothing:

// Create a checkout manager to download all of the files to the server
Aras.IOME.CheckoutManager cm = new Aras.IOME.CheckoutManager(files);
//cm.DownloadFiles(filePath, 4);
cm.DownloadFilesAsync(filePath, 4);

When comparing Aras version of "DownloadFileAsync" to regular WebClient DownloadFilesAsync code, I think Async downloads need some additional event handlers. 

So I tried something like this:

// Create a checkout manager to download all of the files to the server
using(Aras.IOME.CheckoutManager cm = new Aras.IOME.CheckoutManager(files))
{
    //cm.DownloadFiles(filePath, 4);
    cm.DownloadFilesAsync(filePath, 4);
    cm.DownloadFileCompleted += DownloadFileCompletedEventHandler;
}


return this;
}
// Handle the DownloadFileCompleted event
private static void DownloadFileCompletedEventHandler(object sender, EventArgs e)
{

"DownloadFileCompleted" is not listed in the official Aras Innovator 12.0 .NET API Reference. But when using this function I didn´t get an error message in the Method editor, so the Innovator API definitely supports it.

But the 2nd sample of course still does nothing. 

Does anyone know more?

Best regards!

Angela

Parents Reply Children