From 7a005deb8ad53f9667ebdb8daada87ad80cb9a74 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 13 Feb 2026 09:03:41 -0800 Subject: [PATCH] case 4642 --- devutil/TimeStamp/Program.cs | 152 ++++++++++++++++++ devutil/TimeStamp/Properties/AssemblyInfo.cs | 35 ++++ .../Properties/Resources.Designer.cs | 71 ++++++++ devutil/TimeStamp/Properties/Resources.resx | 117 ++++++++++++++ .../TimeStamp/Properties/Settings.Designer.cs | 30 ++++ .../TimeStamp/Properties/Settings.settings | 7 + devutil/TimeStamp/TimeStamp.csproj | 98 +++++++++++ 7 files changed, 510 insertions(+) create mode 100644 devutil/TimeStamp/Program.cs create mode 100644 devutil/TimeStamp/Properties/AssemblyInfo.cs create mode 100644 devutil/TimeStamp/Properties/Resources.Designer.cs create mode 100644 devutil/TimeStamp/Properties/Resources.resx create mode 100644 devutil/TimeStamp/Properties/Settings.Designer.cs create mode 100644 devutil/TimeStamp/Properties/Settings.settings create mode 100644 devutil/TimeStamp/TimeStamp.csproj diff --git a/devutil/TimeStamp/Program.cs b/devutil/TimeStamp/Program.cs new file mode 100644 index 0000000..492d92f --- /dev/null +++ b/devutil/TimeStamp/Program.cs @@ -0,0 +1,152 @@ +using System; +using System.IO; + +namespace GenerateTimeStampFile +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + {//Severity Code Description Project File Line Suppression State + //Error The command "C:\data\code\ravenqbi\devutil\TimeStamp\TimeStamp.exe" "C:\data\code\ravenqbi\AyaNovaQBI\Timestamp.cs" "/N:AyaNovaQBI"" exited with code 123. AyaNovaQBI + + string[] args = Environment.GetCommandLineArgs(); + if (args.Length > 1) + { + // Assume new file required + string fileName = null; + string nameSpace = "TimeStamp"; + string[] TimestampFile = new string[] + {@"using System;", + @"// The namespace can be overidden by the /N option:", + @"// GenerateTimeStampFile file.cs /N:MyNameSpace", + @"// Such settings will override your value here.", + @"namespace TimeStamp", + @" {", + @" /// ", + @" /// Static Timestamp related data.", + @" /// ", + @" /// ", + @" /// THIS FILE IS CHANGED BY EXTERNAL PROGRAMS.", + @" /// Do not modify the namespace, as it may be overwritten. You can", + @" /// set the namespace with the /N option.", + @" /// Do not modify the definition of BuildAt as your changes will be discarded.", + @" /// Do not modify the definition of TimeStampedBy as your changes will be discarded.", + @" /// ", + @" public static class Timestamp", + @" {", + @" /// ", + @" /// The time stamp", + @" /// ", + @" /// ", + @" /// Do not modify the definition of BuildAt as your changes will be discarded.", + @" /// ", + @" public static DateTime BuildAt { get { return new DateTime(???); } } //--**", + @" /// ", + @" /// The program that time stamped it.", + @" /// ", + @" /// ", + @" /// Do not modify the definition of TimeStampedBy as your changes will be discarded.", + @" /// ", + @" public static string TimeStampedBy { get { return @""???""; } } //--**", + @" }", + @" }" }; + for (int i = 1; i < args.Length; i++) + { + if (!args[i].StartsWith("/")) + { + // File name + fileName = args[i]; + if (File.Exists(fileName)) + { + TimestampFile = File.ReadAllLines(fileName); + } + } + else + { + // It's an option + if (args[i].StartsWith("/N:")) + { + // Set the namespace for the Timestamp class. + nameSpace = args[i].Substring(3); + } + } + } + if (!string.IsNullOrWhiteSpace(fileName)) + { + // We have an output location. + // Replace the namespace and timestamp. + for (int i = 0; i < TimestampFile.Length; i++) + { + string line = TimestampFile[i].Trim(); + if (line.StartsWith("namespace")) + { + TimestampFile[i] = "namespace " + nameSpace; + } + else if (line.EndsWith("//--**")) + { + // Special + if (line.Contains("DateTime BuildAt")) + { + TimestampFile[i] = @" public static DateTime BuildAt { get { return new DateTime(" + + DateTime.Now.Ticks.ToString() + + @"); } } //--**"; + } + else if (line.Contains("string TimeStampedBy")) + { + TimestampFile[i] = @" public static string TimeStampedBy { get { return @""GZTW.AyaNova.BLL.TS""; } } //--**"; + } + } + } + File.WriteAllLines(fileName, TimestampFile); + } + } + Environment.ExitCode = 0; //Set no error + } + } +} + + + + + + + + + + + + + + + + + + + + + +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Windows.Forms; + +//namespace TimeStamp +//{ +// static class Program +// { +// /// +// /// The main entry point for the application. +// /// +// [STAThread] +// static void Main() +// { +// Application.EnableVisualStyles(); +// Application.SetCompatibleTextRenderingDefault(false); +// Application.Run(new Form1()); +// } +// } +//} diff --git a/devutil/TimeStamp/Properties/AssemblyInfo.cs b/devutil/TimeStamp/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6882720 --- /dev/null +++ b/devutil/TimeStamp/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("TimeStamp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TimeStamp")] +[assembly: AssemblyCopyright("Copyright © 2017 - 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8207194c-c959-4416-942f-ab86ea0e4420")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/devutil/TimeStamp/Properties/Resources.Designer.cs b/devutil/TimeStamp/Properties/Resources.Designer.cs new file mode 100644 index 0000000..5ab04a7 --- /dev/null +++ b/devutil/TimeStamp/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1008 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace TimeStamp.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TimeStamp.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/devutil/TimeStamp/Properties/Resources.resx b/devutil/TimeStamp/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/devutil/TimeStamp/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/devutil/TimeStamp/Properties/Settings.Designer.cs b/devutil/TimeStamp/Properties/Settings.Designer.cs new file mode 100644 index 0000000..14e5b92 --- /dev/null +++ b/devutil/TimeStamp/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1008 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace TimeStamp.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/devutil/TimeStamp/Properties/Settings.settings b/devutil/TimeStamp/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/devutil/TimeStamp/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/devutil/TimeStamp/TimeStamp.csproj b/devutil/TimeStamp/TimeStamp.csproj new file mode 100644 index 0000000..8e157dd --- /dev/null +++ b/devutil/TimeStamp/TimeStamp.csproj @@ -0,0 +1,98 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {CE73BA18-914D-4426-8888-1DA0F0FC4764} + WinExe + Properties + TimeStamp + TimeStamp + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\Debug\ + DEBUG;TRACE + full + AnyCPU + prompt + false + false + + + bin\Release\ + TRACE + true + pdbonly + AnyCPU + prompt + false + false + + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + \ No newline at end of file