From 3d70d1017518e86b85c6ad2fa48b27b732f0490f Mon Sep 17 00:00:00 2001 From: rcktrncn Date: Tue, 3 Aug 2021 21:55:23 +0900 Subject: [PATCH] fix substring condition --- taskt/UI/CustomControls/CommandControls.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/taskt/UI/CustomControls/CommandControls.cs b/taskt/UI/CustomControls/CommandControls.cs index 90c76ef0b..229ad4bfc 100644 --- a/taskt/UI/CustomControls/CommandControls.cs +++ b/taskt/UI/CustomControls/CommandControls.cs @@ -1201,7 +1201,7 @@ public static ComboBox AddVariableNames(this ComboBox cbo, UI.Forms.frmCommandEd return cbo; } - public static string GetDataGridViewRowInfoText(Core.Automation.Attributes.PropertyAttributes.PropertyDataGridViewRowInfo rowInfo) + public static string GetDataGridViewRowInfoText(Core.Automation.Attributes.PropertyAttributes.PropertyAddtionalParameterInfo rowInfo) { if (rowInfo == null) { @@ -1241,14 +1241,24 @@ private static string getTextMDFormat(this string targetString) idxTable = targetString.IndexOf("\\|"); if (idxAster >= 0 || idxTable >= 0) { - if (idxAster < idxTable) + if ((idxAster >= 0) && (idxTable < 0)) { ret += targetString.Substring(0, idxAster).removeMDFormat() + "*"; targetString = targetString.Substring(idxAster + 1); } - else + else if ((idxTable >= 0) && (idxAster < 0)) + { + ret += targetString.Substring(0, idxTable).removeMDFormat() + "|"; + targetString = targetString.Substring(idxTable + 1); + } + else if (idxAster < idxTable) + { + ret += targetString.Substring(0, idxAster).removeMDFormat() + "*"; + targetString = targetString.Substring(idxAster + 1); + } + else if (idxTable < idxAster) { - ret += targetString.Substring(0, idxTable).removeMDFormat() + "*"; + ret += targetString.Substring(0, idxTable).removeMDFormat() + "|"; targetString = targetString.Substring(idxTable + 1); } }