示例#1
0
        private void DownloadTools(ILongWaitBroker waitBroker,
                                   IEnumerable <ToolUpdateInfo> tools,
                                   out ICollection <ToolUpdateInfo> successfulDownloads,
                                   out ICollection <string> failedDownloads)
        {
            successfulDownloads = new Collection <ToolUpdateInfo>();
            failedDownloads     = new Collection <string>();
            ToolDir             = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "ToolDir")); // Not L10N

            foreach (var tool in tools)
            {
                var individualDir = Directory.CreateDirectory(Path.Combine(ToolDir.FullName, tool._packageName));
                try
                {
                    tool.FilePath = _updateHelper.GetToolZipFile(waitBroker, tool._packageIdentifer, individualDir.FullName);
                    successfulDownloads.Add(tool);
                }
                catch (ToolExecutionException)
                {
                    failedDownloads.Add(tool._packageName);
                }
            }
        }