private void SerializeRelations(SerializationInfo info, StreamingContext context)
{
ArrayList relationList = new ArrayList();
foreach (DataRelation rel in Relations)
{
int[] parentInfo = new int[rel.ParentColumns.Length + 1];
parentInfo[0] = Tables.IndexOf(rel.ParentTable);
for (int j = 1; j < parentInfo.Length; j++)
{
parentInfo[j] = rel.ParentColumns[j - 1].Ordinal;
}
int[] childInfo = new int[rel.ChildColumns.Length + 1];
childInfo[0] = Tables.IndexOf(rel.ChildTable);
for (int j = 1; j < childInfo.Length; j++)
{
childInfo[j] = rel.ChildColumns[j - 1].Ordinal;
}
ArrayList list = new ArrayList();
list.Add(rel.RelationName);
list.Add(parentInfo);
list.Add(childInfo);
list.Add(rel.Nested);
list.Add(rel._extendedProperties);
relationList.Add(list);
}
info.AddValue("DataSet.Relations", relationList);
}