private void syncCheckoutBtn_Click(object sender, EventArgs e) { int numberOfThreads = (int)thCount.Value; string targetFolder = textBoxDestination.Text; //Strat the timer sw.Start(); textBoxResult.Clear(); string files = GetFiles(); Item configuration = m_inn.newItem(); configuration.loadAML(files); // get checkout manager CheckoutManager checkoutManager2 = new CheckoutManager(configuration); // Lock all items in the configuration (!File, !Vault, !Located) // NOTE: In this particular example this call could be skipped as the configuration the way it's built does NOT have any items that have to be locked. Item lockResult = checkoutManager2.Lock(); if (lockResult.isError()) { MessageBox.Show(lockResult.getErrorString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } progressBar.Value = 0; // Download files synchronously System.Collections.Hashtable downloadResults = checkoutManager2.DownloadFiles(targetFolder, numberOfThreads); ProcessResult(downloadResults, configuration); }
private void syncCheckoutBtn_Click(object sender, EventArgs e) { int numberOfThreads = (int)thCount.Value; string targetFolder = textBoxDestination.Text; //Strat the timer sw.Start(); textBoxResult.Clear(); string files = GetFiles(); Item configuration = m_inn.newItem(); configuration.loadAML(files); // get checkout manager CheckoutManager checkoutManager2 = new CheckoutManager(configuration); // Lock all items in the configuration (!File, !Vault, !Located) // NOTE: In this particular example this call could be skipped as the configuration the way it's built does NOT have any items that have to be locked. Item lockResult = checkoutManager2.Lock(); if (lockResult.isError()) { MessageBox.Show(lockResult.getErrorString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } progressBar.Value = 0; // Download files synchronously System.Collections.Hashtable downloadResults = checkoutManager2.DownloadFiles(targetFolder, numberOfThreads); ProcessResult(downloadResults, configuration); }