Skip to content

Commit

Permalink
Fix readme formatting
Browse files Browse the repository at this point in the history
update tools
  • Loading branch information
ErikEJ committed Oct 23, 2023
1 parent d3122fb commit 9159664
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ await VS.MessageBox.ShowAsync(

var readmePath = Path.Combine(Path.GetTempPath(), readmeName);

finalText = AddResultToFinalText(finalText, revEngResult);
finalText = reverseEngineerHelper.AddResultToFinalText(finalText, revEngResult);

File.WriteAllText(readmePath, finalText, Encoding.UTF8);

Expand Down Expand Up @@ -698,30 +698,6 @@ private async Task ApplyNavigationRenamersAsync(Project project, string referenc
}
}

private string AddResultToFinalText(string finalText, ReverseEngineerResult revEngResult)
{
if (revEngResult.HasIssues)
{
var warningText = new StringBuilder();

warningText.AppendLine("Some issues were discovered during reverse engineering, consider addressing them:");

foreach (var errorItem in revEngResult.EntityErrors)
{
warningText.AppendLine(errorItem);
}

foreach (var warningItem in revEngResult.EntityWarnings)
{
warningText.AppendLine(warningItem);
}

finalText = finalText + Environment.NewLine + warningText.ToString();
}

return finalText;
}

private async System.Threading.Tasks.Task SaveOptionsAsync(Project project, string optionsPath, ReverseEngineerOptions options, Tuple<List<Schema>, string> renamingOptions)
{
if (File.Exists(optionsPath) && File.GetAttributes(optionsPath).HasFlag(FileAttributes.ReadOnly))
Expand Down
27 changes: 27 additions & 0 deletions src/GUI/Shared/Helpers/ReverseEngineerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,33 @@ public string GetReadMeText(ReverseEngineerOptions options, string content, List
.Replace("[ContextName]", options.ContextClassName);
}

public string AddResultToFinalText(string finalText, ReverseEngineerResult revEngResult)
{
if (revEngResult.HasIssues)
{
var warningText = new StringBuilder();

warningText.AppendLine("Some issues were discovered during reverse engineering, consider addressing them:");
warningText.AppendLine();

foreach (var errorItem in revEngResult.EntityErrors)
{
warningText.AppendLine(errorItem);
warningText.AppendLine();
}

foreach (var warningItem in revEngResult.EntityWarnings)
{
warningText.AppendLine(warningItem);
warningText.AppendLine();
}

finalText = finalText + Environment.NewLine + warningText.ToString();
}

return finalText;
}

public bool IsDirectoryEmpty(string path)
{
return !Directory.EnumerateFileSystemEntries(path).Any();
Expand Down
Binary file modified src/GUI/lib/efreveng60.exe.zip
Binary file not shown.
Binary file modified src/GUI/lib/efreveng70.exe.zip
Binary file not shown.
Binary file modified src/GUI/lib/efreveng80.exe.zip
Binary file not shown.

0 comments on commit 9159664

Please sign in to comment.