Completed code generation new method

This commit is contained in:
2014-12-09 00:52:02 +01:00
parent 1a78dcc16d
commit e0bcb9a91a
3 changed files with 88 additions and 47 deletions

View File

@ -11,7 +11,7 @@ namespace CobXmlSupport
private CobRow qualifiedRow;
private List<CobRow> qualRows;
private Dictionary<string, string> locIndexis;
private string qfhCode, qfhInd ;
private string qfhCode, qfhInd, qfhRedInd ;
private string[] indexStrs;
public CobRow qualCobRow
@ -27,6 +27,11 @@ namespace CobXmlSupport
get { return qfhInd; }
}
public string indexRedText
{
get { return qfhRedInd; }
}
public string[] indexStrings
{
get { return indexStrs; }
@ -69,7 +74,7 @@ namespace CobXmlSupport
{
if (qfhCode.Length > 0)
{
qfhCode += " OF ";
qfhCode += " OF ";
}
if (exp) qfhCode += localCobRow.FieldName.Replace(S.ettingPrefix, S.ettingExpPrefix);
else qfhCode += localCobRow.FieldName;
@ -91,26 +96,44 @@ namespace CobXmlSupport
private void initLocIndexTxt()
{
qfhInd = "";
qfhRedInd = "";
indexStrs = null;
if (locIndexis!=null && locIndexis.Count > 0)
{
indexStrs=new string[locIndexis.Count];
int indCnt = 0;
foreach (KeyValuePair<string, string> tmpInd in locIndexis)
indexStrs = locIndexis.Values.ToArray();
foreach (KeyValuePair<string, string> tmpInd in locIndexis.Reverse())
{
indexStrs[indCnt++] = tmpInd.Value;
if (qfhInd.Length == 0)
{
qfhInd = "( " + tmpInd.Value;
qfhInd = " ( " + tmpInd.Value;
}
else
{
qfhInd += ",\r\n" + tmpInd.Value;
qfhInd += ",\r\n " + tmpInd.Value;
}
}
qfhInd += " )\r\n";
if (locIndexis.Count > 1)
{
foreach (KeyValuePair<string, string> tmpInd in locIndexis.Reverse())
{
indCnt++;
if (indCnt == locIndexis.Count) break;
if (qfhRedInd.Length == 0)
{
qfhRedInd = " ( " + tmpInd.Value;
}
else
{
qfhRedInd += ",\r\n " + tmpInd.Value;
}
}
qfhRedInd += " )\r\n";
}
}
}
@ -143,6 +166,7 @@ namespace CobXmlSupport
else break;
}
initLocIndexTxt();
}
public override string ToString()