void DeployFiles(List <string> newStrings, string trimmed) { var success = false; try { foreach (var file in Directory.GetFiles(Path.Combine(contentsFinder.ContentFilesPath, "Fody"))) { File.Copy(file, Path.Combine(trimmed, Path.GetFileName(file)), true); success = true; } var info = string.Format("Fody: Updated '{0}' to version {1}.", trimmed, CurrentVersion.Version); messageDisplayer.ShowInfo(info); } catch (Exception exception) { if (success) { var error = string.Format("Fody: Failed to update '{0}' to version {1} due to '{2}'. Please manually copy the contents of '{3}' to '{0}'.", trimmed, CurrentVersion.Version, exception.Message, contentsFinder.ContentFilesPath); messageDisplayer.ShowError(error); } else { var info = string.Format("Fody: Failed to update '{0}' to version {1} will try again later.", trimmed, CurrentVersion.Version); messageDisplayer.ShowInfo(info); newStrings.Add(trimmed); } } }
public void DisableCallback() { try { var projects = currentProjectFinder.GetCurrentProjects(); if (projects.Any(UnsaveProjectChecker.HasUnsavedPendingChanges)) { return; } foreach (var project in projects) { messageDisplayer.ShowInfo(string.Format("Fody: Removed from the project '{0}'. However no binary files will be removed in case they are being used by other projects.", project.Name)); new ProjectRemover(project.FullName); } } catch (COMException exception) { exceptionDialog.HandleException(exception); } catch (Exception exception) { exceptionDialog.HandleException(exception); } }