|
@@ -257,9 +257,10 @@ namespace GFGEditor
|
|
FunctionSingleStr = FunctionSingleStr.Replace("{colValues}", colValues);
|
|
FunctionSingleStr = FunctionSingleStr.Replace("{colValues}", colValues);
|
|
FunctionSingleStr = FunctionSingleStr.Replace("{FunctionName}", functionName);
|
|
FunctionSingleStr = FunctionSingleStr.Replace("{FunctionName}", functionName);
|
|
FunctionSingleStr = FunctionSingleStr.Replace("{cfgsDicName}", cfgsDicName);
|
|
FunctionSingleStr = FunctionSingleStr.Replace("{cfgsDicName}", cfgsDicName);
|
|
-
|
|
|
|
|
|
+ //key名称
|
|
_assignmentBuilder.AppendFormat("\t\t\t{0} = \"{1}\";", key, string.Join("_", keyNames));
|
|
_assignmentBuilder.AppendFormat("\t\t\t{0} = \"{1}\";", key, string.Join("_", keyNames));
|
|
_assignmentBuilder.AppendLine();
|
|
_assignmentBuilder.AppendLine();
|
|
|
|
+ //创建索引,查询更快速
|
|
SQLiteHelper.Instance.CreateIndex(configArrayName, keyNames);
|
|
SQLiteHelper.Instance.CreateIndex(configArrayName, keyNames);
|
|
return FunctionSingleStr;
|
|
return FunctionSingleStr;
|
|
}
|
|
}
|
|
@@ -272,14 +273,15 @@ namespace GFGEditor
|
|
FunctionGroupStr = FunctionGroupStr.Replace("{colValues}", colValues);
|
|
FunctionGroupStr = FunctionGroupStr.Replace("{colValues}", colValues);
|
|
FunctionGroupStr = FunctionGroupStr.Replace("{FunctionName}", functionName);
|
|
FunctionGroupStr = FunctionGroupStr.Replace("{FunctionName}", functionName);
|
|
FunctionGroupStr = FunctionGroupStr.Replace("{cfgsGroupDicName}", cfgsGroupDicName);
|
|
FunctionGroupStr = FunctionGroupStr.Replace("{cfgsGroupDicName}", cfgsGroupDicName);
|
|
-
|
|
|
|
|
|
+ //组合key名称
|
|
_assignmentBuilder.AppendFormat("\t\t\t{0} = \"{1}\";", key, string.Join("_", groupNames));
|
|
_assignmentBuilder.AppendFormat("\t\t\t{0} = \"{1}\";", key, string.Join("_", groupNames));
|
|
_assignmentBuilder.AppendLine();
|
|
_assignmentBuilder.AppendLine();
|
|
|
|
+ //创建索引,查询更快速
|
|
SQLiteHelper.Instance.CreateIndex(configArrayName, groupNames);
|
|
SQLiteHelper.Instance.CreateIndex(configArrayName, groupNames);
|
|
return FunctionGroupStr;
|
|
return FunctionGroupStr;
|
|
|
|
|
|
}
|
|
}
|
|
- private static void ParseDataColumn(string annotation, string type, string name, string nameWhole, string typeWhole, int index)
|
|
|
|
|
|
+ private static void ParseDataColumn(string annotation, string type, string name, string nameWhole, string typeWhole, int column)
|
|
{
|
|
{
|
|
annotation = annotation.Replace("\n", " ");
|
|
annotation = annotation.Replace("\n", " ");
|
|
if (type.Length > 0 && name.Length > 0)
|
|
if (type.Length > 0 && name.Length > 0)
|
|
@@ -287,12 +289,13 @@ namespace GFGEditor
|
|
|
|
|
|
_allNames.Add(nameWhole);
|
|
_allNames.Add(nameWhole);
|
|
_allTypes.Add(typeWhole);
|
|
_allTypes.Add(typeWhole);
|
|
- _allIndexs.Add(index);
|
|
|
|
|
|
+ _allIndexs.Add(column);
|
|
|
|
|
|
if (_names.IndexOf(SQL_PREFIX + name) >= 0) return;
|
|
if (_names.IndexOf(SQL_PREFIX + name) >= 0) return;
|
|
_names.Add(SQL_PREFIX + name);
|
|
_names.Add(SQL_PREFIX + name);
|
|
_types.Add("TEXT");
|
|
_types.Add("TEXT");
|
|
- _indexs.Add(index);
|
|
|
|
|
|
+ _indexs.Add(column);
|
|
|
|
+ int indexName = _names.Count - 1;
|
|
|
|
|
|
//生成解析后的数据变量
|
|
//生成解析后的数据变量
|
|
_declarationBuilder.AppendFormat("\t\t//{0}", annotation.Split('#')[0]);
|
|
_declarationBuilder.AppendFormat("\t\t//{0}", annotation.Split('#')[0]);
|
|
@@ -315,22 +318,22 @@ namespace GFGEditor
|
|
if (type == "int")
|
|
if (type == "int")
|
|
{
|
|
{
|
|
//_assignmentBuilder.AppendFormat("\t\t\t{0} = ConfigUtil.GetInt(0, dataRow, {1});", name, index);
|
|
//_assignmentBuilder.AppendFormat("\t\t\t{0} = ConfigUtil.GetInt(0, dataRow, {1});", name, index);
|
|
- _assignmentBuilder.AppendFormat("\t\t\t{0} = ConfigUtil.GetInt(reader.GetString(reader.GetOrdinal(\"_{1}\")));", name, name);
|
|
|
|
|
|
+ _assignmentBuilder.AppendFormat("\t\t\t{0} = ConfigUtil.GetInt(reader.GetString({1}));", name, indexName);
|
|
_assignmentBuilder.AppendLine();
|
|
_assignmentBuilder.AppendLine();
|
|
}
|
|
}
|
|
else if (type == "float")
|
|
else if (type == "float")
|
|
{
|
|
{
|
|
- _assignmentBuilder.AppendFormat("\t\t\t{0} = ConfigUtil.GetFloat(reader.GetString(reader.GetOrdinal(\"_{1}\")));", name, name);
|
|
|
|
|
|
+ _assignmentBuilder.AppendFormat("\t\t\t{0} = ConfigUtil.GetFloat(reader.GetString({1}));", name, indexName);
|
|
_assignmentBuilder.AppendLine();
|
|
_assignmentBuilder.AppendLine();
|
|
}
|
|
}
|
|
else if (type == "string")
|
|
else if (type == "string")
|
|
{
|
|
{
|
|
- _assignmentBuilder.AppendFormat("\t\t\t{0} = reader.GetString(reader.GetOrdinal(\"_{1}\"));", name, name);
|
|
|
|
|
|
+ _assignmentBuilder.AppendFormat("\t\t\t{0} = reader.GetString({1});", name, indexName);
|
|
_assignmentBuilder.AppendLine();
|
|
_assignmentBuilder.AppendLine();
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- _assignmentBuilder.AppendFormat("\t\t\tvar temp{0} = reader.GetString(reader.GetOrdinal(\"_{1}\"));", name, name);
|
|
|
|
|
|
+ _assignmentBuilder.AppendFormat("\t\t\tvar temp{0} = reader.GetString({1});", name, indexName);
|
|
_assignmentBuilder.AppendLine();
|
|
_assignmentBuilder.AppendLine();
|
|
if (type.Contains("[][]"))
|
|
if (type.Contains("[][]"))
|
|
{
|
|
{
|