Version string -> Prepare

This commit is contained in:
Matt Nadareski
2020-12-11 23:06:40 -08:00
parent 056b0634f0
commit 2e7f70b535
3 changed files with 11 additions and 10 deletions

View File

@@ -22,7 +22,7 @@ namespace RombaSharp.Features
public override void ProcessFeatures(Dictionary<string, Feature> features) public override void ProcessFeatures(Dictionary<string, Feature> features)
{ {
base.ProcessFeatures(features); base.ProcessFeatures(features);
logger.User($"RombaSharp version: {Constants.Version}"); logger.User($"RombaSharp version: {Prepare.Version}");
} }
} }
} }

View File

@@ -8,13 +8,6 @@ namespace SabreTools.Core
/// </summary> /// </summary>
public static class Constants public static class Constants
{ {
/// <summary>
/// The current toolset version to be used by all child applications
/// </summary>
//public readonly static string Version = $"v1.0.4";
public readonly static string Version = $"v1.0.4-{File.GetCreationTime(Assembly.GetExecutingAssembly().Location):yyyy-MM-dd HH:mm:ss}";
public const int HeaderHeight = 3;
#region 0-byte file constants #region 0-byte file constants
public const long SizeZero = 0; public const long SizeZero = 0;

View File

@@ -1,4 +1,6 @@
using System; using System;
using System.IO;
using System.Reflection;
namespace SabreTools.Core namespace SabreTools.Core
{ {
@@ -7,6 +9,12 @@ namespace SabreTools.Core
/// </summary> /// </summary>
public static class Prepare public static class Prepare
{ {
/// <summary>
/// The current toolset version to be used by all child applications
/// </summary>
//public readonly static string Version = $"v1.0.4";
public readonly static string Version = $"v1.0.4-{File.GetCreationTime(Assembly.GetExecutingAssembly().Location):yyyy-MM-dd HH:mm:ss}";
/// <summary> /// <summary>
/// Readies the console and outputs the header /// Readies the console and outputs the header
/// </summary> /// </summary>
@@ -16,7 +24,7 @@ namespace SabreTools.Core
// Dynamically create the header string, adapted from http://stackoverflow.com/questions/8200661/how-to-align-string-in-fixed-length-string // 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; int width = Console.WindowWidth - 3;
string border = $"+{new string('-', width)}+"; string border = $"+{new string('-', width)}+";
string mid = $"{program} {Constants.Version}"; string mid = $"{program} {Version}";
mid = $"|{mid.PadLeft(((width - mid.Length) / 2) + mid.Length).PadRight(width)}|"; mid = $"|{mid.PadLeft(((width - mid.Length) / 2) + mid.Length).PadRight(width)}|";
// If we're outputting to console, do fancy things // If we're outputting to console, do fancy things
@@ -34,7 +42,7 @@ namespace SabreTools.Core
Console.BackgroundColor = ConsoleColor.Blue; Console.BackgroundColor = ConsoleColor.Blue;
} }
Console.Title = $"{program} {Constants.Version}"; Console.Title = $"{program} {Version}";
// Output the header // Output the header
Console.WriteLine(border); Console.WriteLine(border);