我具有以下功能,当选择一个表时,该函数可以很好地工作并产生结果。但是,当选择了两个表时,我的_newList函数只是替换数组中的字段,我将尽力以图形形式向您显示。
private void genXmlSchema_Click(object sender, EventArgs e)
{
List<TableDefnition> _newList = new List<TableDefnition>();
PersistentObject _testObjects = new PersistentObject();
List<GridViewRowInfo> _checkRows = GetCheckedRows(rgTableNames);
List<PersistentObject> _testObjectsList = new List<PersistentObject>();
foreach (GridViewRowInfo row in _checkRows)
{
var currentRow = (TableNames)row.DataBoundItem;
_newList = db.GetALLTableDeiniations(currentRow.TABLE_NAME);
rgFieldsOfTable.DataSource = db.GetALLTableDeiniations(currentRow.TABLE_NAME);
_testObjectsList.Add( BuildSchema(_newList, currentRow.TABLE_NAME));
}
_newPObject.PersistentObjects.AddRange(_testObjectsList);
_newPObject.ClassPrefix = "Persistent";
_newPObject.ClassSuffix = "";
_newPObject.Language = "VB";
_newPObject.Path = @"C:\Sage200SchemaExtensions";
_newPObject.GenerateSeparateFiles = "false";
_newPObject.GenerateBusinessObjects = "false";
_newPObject.BaselineSchema = @"C:\Program Files (x86)\Sage 200 SDK\SageObjectStore.xml";
_newPObject.DataTypes = "";
_newPObject.Enumerations = "";
_newPObject.MemberVariablePrefix = "_";
_newPObject.ApplicationNamespace = "BusinessObjects";
schemeContent.Text = HelperXml.ToXML(_newPObject);
}
在第二遍中,您将复制两个列表中的第二张表。
第二遍之后的第一个数组编号
第二遍之后的第二个数组编号
您可以清楚地看到它完全失去了对第一个具有4列的表的引用,我无法轻松创建和销毁列表,但无法弄清楚