From a95c6f04b1462a169043d986988290ebbf9fd1db Mon Sep 17 00:00:00 2001 From: Schwirg László Date: Tue, 30 Nov 2021 16:17:42 +0100 Subject: [PATCH] v1.10.1 - hiba javítása és az interaktív argument paraméter érték megvalósítása --- Vrh.Log4Pro.MaintenanceConsole/Manager - MaintenanceToolManager.cs | 22 ++++++++++++++++++++-- Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Vrh.Log4Pro.MaintenanceConsole/Manager - MaintenanceToolManager.cs b/Vrh.Log4Pro.MaintenanceConsole/Manager - MaintenanceToolManager.cs index 2d6d81b..07ef467 100644 --- a/Vrh.Log4Pro.MaintenanceConsole/Manager - MaintenanceToolManager.cs +++ b/Vrh.Log4Pro.MaintenanceConsole/Manager - MaintenanceToolManager.cs @@ -63,7 +63,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.MaintenanceToolManagerNS ExternalProcess.StartInfo.FileName = config.Exe; ExternalProcess.StartInfo.WindowStyle = config.ProcessWindowsStyle; - ExternalProcess.StartInfo.Arguments = config.Arguments; + ExternalProcess.StartInfo.Arguments = config.ResolveArguments(); ExternalProcess.Start(); int waitingtime = config.WaitForExit ? -1 : 0; ExternalProcess.WaitForExit(waitingtime); @@ -389,7 +389,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.MaintenanceToolManagerNS Key = VRH.Common.StringConstructor.ResolveConstructorR(ArgumentParametersDictionary, GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Key), x, ""), "{}@@"); Description = VRH.Common.StringConstructor.ResolveConstructorR(ArgumentParametersDictionary, GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Description), x, Exe), "{}@@"); - Arguments = VRH.Common.StringConstructor.ResolveConstructorR(ArgumentParametersDictionary, GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Arguments), x, XmlStructure.ExternalUtility.Attributes.Arguments.Values.DEFAULT), "{}@@"); + Arguments = GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Arguments), x, XmlStructure.ExternalUtility.Attributes.Arguments.Values.DEFAULT); Exe = GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Exe), x, ""); ProcessWindowsStyle = GetValue(nameof(XmlStructure.ExternalUtility.Attributes.WindowStyle), x, XmlStructure.ExternalUtility.Attributes.WindowStyle.Values.DEFAULT); @@ -418,6 +418,24 @@ namespace Vrh.Log4Pro.MaintenanceConsole.MaintenanceToolManagerNS } catch { return new KeyValuePair(kvpk, null); } } + public string ResolveArguments() + { + var resolveddictionary = new Dictionary(); + foreach (var kvp in ArgumentParametersDictionary) + { + if (!kvp.Value.StartsWith("?")) { resolveddictionary.Add(kvp.Key, kvp.Value); } + else + { + string prompt; + if (kvp.Value.Length == 1) { prompt = $"Enter value for {kvp.Key}:"; } + else { prompt = kvp.Value.Substring(1); } + string value = ColorConsole.ReadLine(prompt, ConsoleColor.Yellow); + if (value.ToLower() == "ex") { Valid = false; return null; } + resolveddictionary.Add(kvp.Key, value); + } + } + return VRH.Common.StringConstructor.ResolveConstructorR(resolveddictionary, Arguments, "{}@@"); + } } public XElement RegexpTesterConfig; public XElement PingerConfigXml; diff --git a/Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs b/Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs index 4803fc5..54cfaa4 100644 --- a/Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs +++ b/Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 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.10.0.0")] -[assembly: AssemblyFileVersion("1.10.0.0")] +[assembly: AssemblyVersion("1.10.1.0")] +[assembly: AssemblyFileVersion("1.10.1.0")] -- libgit2 0.21.2