Commit a95c6f04b1462a169043d986988290ebbf9fd1db
1 parent
41698df2
v1.10.1
- hiba javítása és az interaktív argument paraméter érték megvalósítása
Showing
2 changed files
with
22 additions
and
4 deletions
Show diff stats
Vrh.Log4Pro.MaintenanceConsole/Manager - MaintenanceToolManager.cs
@@ -63,7 +63,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.MaintenanceToolManagerNS | @@ -63,7 +63,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.MaintenanceToolManagerNS | ||
63 | ExternalProcess.StartInfo.FileName = config.Exe; | 63 | ExternalProcess.StartInfo.FileName = config.Exe; |
64 | ExternalProcess.StartInfo.WindowStyle = config.ProcessWindowsStyle; | 64 | ExternalProcess.StartInfo.WindowStyle = config.ProcessWindowsStyle; |
65 | 65 | ||
66 | - ExternalProcess.StartInfo.Arguments = config.Arguments; | 66 | + ExternalProcess.StartInfo.Arguments = config.ResolveArguments(); |
67 | ExternalProcess.Start(); | 67 | ExternalProcess.Start(); |
68 | int waitingtime = config.WaitForExit ? -1 : 0; | 68 | int waitingtime = config.WaitForExit ? -1 : 0; |
69 | ExternalProcess.WaitForExit(waitingtime); | 69 | ExternalProcess.WaitForExit(waitingtime); |
@@ -389,7 +389,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.MaintenanceToolManagerNS | @@ -389,7 +389,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.MaintenanceToolManagerNS | ||
389 | 389 | ||
390 | Key = VRH.Common.StringConstructor.ResolveConstructorR(ArgumentParametersDictionary, GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Key), x, ""), "{}@@"); | 390 | Key = VRH.Common.StringConstructor.ResolveConstructorR(ArgumentParametersDictionary, GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Key), x, ""), "{}@@"); |
391 | Description = VRH.Common.StringConstructor.ResolveConstructorR(ArgumentParametersDictionary, GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Description), x, Exe), "{}@@"); | 391 | Description = VRH.Common.StringConstructor.ResolveConstructorR(ArgumentParametersDictionary, GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Description), x, Exe), "{}@@"); |
392 | - Arguments = VRH.Common.StringConstructor.ResolveConstructorR(ArgumentParametersDictionary, GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Arguments), x, XmlStructure.ExternalUtility.Attributes.Arguments.Values.DEFAULT), "{}@@"); | 392 | + Arguments = GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Arguments), x, XmlStructure.ExternalUtility.Attributes.Arguments.Values.DEFAULT); |
393 | 393 | ||
394 | Exe = GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Exe), x, ""); | 394 | Exe = GetValue(nameof(XmlStructure.ExternalUtility.Attributes.Exe), x, ""); |
395 | ProcessWindowsStyle = GetValue<ProcessWindowStyle>(nameof(XmlStructure.ExternalUtility.Attributes.WindowStyle), x, XmlStructure.ExternalUtility.Attributes.WindowStyle.Values.DEFAULT); | 395 | ProcessWindowsStyle = GetValue<ProcessWindowStyle>(nameof(XmlStructure.ExternalUtility.Attributes.WindowStyle), x, XmlStructure.ExternalUtility.Attributes.WindowStyle.Values.DEFAULT); |
@@ -418,6 +418,24 @@ namespace Vrh.Log4Pro.MaintenanceConsole.MaintenanceToolManagerNS | @@ -418,6 +418,24 @@ namespace Vrh.Log4Pro.MaintenanceConsole.MaintenanceToolManagerNS | ||
418 | } | 418 | } |
419 | catch { return new KeyValuePair<string, string>(kvpk, null); } | 419 | catch { return new KeyValuePair<string, string>(kvpk, null); } |
420 | } | 420 | } |
421 | + public string ResolveArguments() | ||
422 | + { | ||
423 | + var resolveddictionary = new Dictionary<string, string>(); | ||
424 | + foreach (var kvp in ArgumentParametersDictionary) | ||
425 | + { | ||
426 | + if (!kvp.Value.StartsWith("?")) { resolveddictionary.Add(kvp.Key, kvp.Value); } | ||
427 | + else | ||
428 | + { | ||
429 | + string prompt; | ||
430 | + if (kvp.Value.Length == 1) { prompt = $"Enter value for {kvp.Key}:"; } | ||
431 | + else { prompt = kvp.Value.Substring(1); } | ||
432 | + string value = ColorConsole.ReadLine(prompt, ConsoleColor.Yellow); | ||
433 | + if (value.ToLower() == "ex") { Valid = false; return null; } | ||
434 | + resolveddictionary.Add(kvp.Key, value); | ||
435 | + } | ||
436 | + } | ||
437 | + return VRH.Common.StringConstructor.ResolveConstructorR(resolveddictionary, Arguments, "{}@@"); | ||
438 | + } | ||
421 | } | 439 | } |
422 | public XElement RegexpTesterConfig; | 440 | public XElement RegexpTesterConfig; |
423 | public XElement PingerConfigXml; | 441 | public XElement PingerConfigXml; |
Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices; | @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; | ||
32 | // You can specify all the values or you can default the Build and Revision Numbers | 32 | // You can specify all the values or you can default the Build and Revision Numbers |
33 | // by using the '*' as shown below: | 33 | // by using the '*' as shown below: |
34 | // [assembly: AssemblyVersion("1.0.*")] | 34 | // [assembly: AssemblyVersion("1.0.*")] |
35 | -[assembly: AssemblyVersion("1.10.0.0")] | ||
36 | -[assembly: AssemblyFileVersion("1.10.0.0")] | 35 | +[assembly: AssemblyVersion("1.10.1.0")] |
36 | +[assembly: AssemblyFileVersion("1.10.1.0")] |