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); } } }
/// <summary> /// Raised when an error occurs into datagrid control /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvOS_DataError(object sender, DataGridViewDataErrorEventArgs e) { // Trace begin function message if (m_TraceSwitch.TraceInfo) { TraceLog.Write("ModifyOS", "dgvOS_DataError", "Begin function", this.Text, TraceLog.TraceMsgLevel.Message, m_TraceSwitch); } // Get and display error message m_MessageDisplayer.ShowError(e.Exception.Message); // Close exception e.ThrowException = false; // Trace error message if (m_TraceSwitch.TraceError) { TraceLog.Write("ModifyOS", "dgvOS_DataError", "Error while data processing. Cause : " + e.Exception.Message, e.Exception.Source, TraceLog.TraceMsgLevel.Error, m_TraceSwitch); } // Trace end function message if (m_TraceSwitch.TraceInfo) { TraceLog.Write("ModifyOS", "dgvOS_DataError", "End function", this.Text, TraceLog.TraceMsgLevel.Message, m_TraceSwitch); } }
public void ProcessTaskFile(string solutionDirectory) { try { var fodyDir = FodyDirectoryFinder.TreeWalkForToolsFodyDir(solutionDirectory); if (fodyDir != null) { var fodyFile = Path.Combine(fodyDir, "Fody.dll"); if (File.Exists(fodyFile)) { Check(fodyFile); return; } } foreach (var filePath in Directory.EnumerateFiles(solutionDirectory, "Fody.dll", SearchOption.AllDirectories)) { Check(filePath); } } catch (Exception exception) { messageDisplayer.ShowError(string.Format("Fody: An exception occured while trying to check for updates.\r\nException: {0}.", exception)); } }