private void UpdateFiles(List <string> filenames) { // filter out extensions filenames = filenames.Where(f => IsExtensionAllowed(f)).Distinct().ToList(); if (filenames.Count > 0) { var resourceIds = new List <Guid>(); try { SetStatusMessage("Start upload of {0} file{1}", filenames.Count, filenames.Count == 1 ? string.Empty : "s"); foreach (var f in filenames) { try { resourceIds.Add(_service.Upload(_folder, f)); } catch (Exception ex) { SetStatusMessage("FAILED! {0}", ex); } } var uids = resourceIds.Distinct().ToArray(); actionNotification("{0} files uploaded", uids.Length); SetStatusMessage("Start publish"); _service.Publish(uids); actionNotification("Publish completed"); // Add to solution?! var selectedsolution = this.getSolutionUniqueName(); if (!string.IsNullOrEmpty(selectedsolution)) { SetStatusMessage("Adding the files to '{0}'", selectedsolution); _service.AddToSolution(selectedsolution, uids); actionNotification("Adding to solution completed"); } SetStatusMessage("Done!"); } catch (Exception ex) { SetStatusMessage("ERROR! {0}", ex); } } }