Cleanup and overhaul (#21)

* Syntax cleanup

* More minor cleanup, use Linq

* Fix broken features by using correct values

* Feature flags the same

* Features are modular

* No AlphaFS, more .NET versions

* Fix appveyor

* Put back identifiers, for some reason

* String interpolation, modernization

* Better use of GetField

* XmlTextWriter to remove possible issues

* Fix header for OpenMSX
This commit is contained in:
Matt Nadareski
2020-06-10 22:37:19 -07:00
committed by GitHub
parent f01e47444c
commit 4ad77d6be6
75 changed files with 6945 additions and 7249 deletions

View File

@@ -18,14 +18,14 @@ namespace SabreTools.Library.Data
/// <summary>
/// Readies the console and outputs the header
/// </summary>
/// <param name="name">The name to be displayed as the program</param>B
/// <param name="name">The name to be displayed as the program</param>
public static void PrepareConsole(string name)
{
// Dynamically create the header string, adapted from http://stackoverflow.com/questions/8200661/how-to-align-string-in-fixed-length-string
int width = Console.WindowWidth - 3;
string border = "+" + new string('-', width) + "+";
string mid = name + " " + Constants.Version;
mid = "|" + mid.PadLeft(((width - mid.Length) / 2) + mid.Length).PadRight(width) + "|";
string border = $"+{new string('-', width)}+";
string mid = $"{name} {Constants.Version}";
mid = $"|{mid.PadLeft(((width - mid.Length) / 2) + mid.Length).PadRight(width)}|";
// If we're outputting to console, do fancy things
if (!Console.IsOutputRedirected)
@@ -42,7 +42,7 @@ namespace SabreTools.Library.Data
Console.BackgroundColor = ConsoleColor.Blue;
}
Console.Title = name + " " + Constants.Version;
Console.Title = $"{name} {Constants.Version}";
// Output the header
Console.WriteLine(border);