Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CheckNestedRelations()

void System.Data.DataRelation.CheckNestedRelations ( )
inlinepackage

Definition at line 446 of file DataRelation.cs.

447 {
448 DataCommonEventSource.Log.Trace("<ds.DataRelation.CheckNestedRelations|INFO> {0}", ObjectID);
449 if (ChildTable == ParentTable)
450 {
451 if (string.Compare(ChildTable.TableName, ChildTable.DataSet.DataSetName, ignoreCase: true, ChildTable.DataSet.Locale) == 0)
452 {
453 throw ExceptionBuilder.SelfnestedDatasetConflictingName(ChildTable.TableName);
454 }
455 return;
456 }
458 list.Add(ChildTable);
459 for (int i = 0; i < list.Count; i++)
460 {
461 DataRelation[] nestedParentRelations = list[i].NestedParentRelations;
463 foreach (DataRelation dataRelation in array)
464 {
465 if (dataRelation.ParentTable == ChildTable && dataRelation.ChildTable != ChildTable)
466 {
467 throw ExceptionBuilder.LoopInNestedRelations(ChildTable.TableName);
468 }
469 if (!list.Contains(dataRelation.ParentTable))
470 {
471 list.Add(dataRelation.ParentTable);
472 }
473 }
474 }
475 }
void Add(TKey key, TValue value)
DataRelation(string? relationName, DataColumn parentColumn, DataColumn childColumn)
virtual DataTable ParentTable
virtual ? DataSet DataSet
virtual DataTable ChildTable

References System.array, System.Data.DataRelation.ChildTable, System.list, System.Data.DataCommonEventSource.Log, System.Data.ExceptionBuilder.LoopInNestedRelations(), System.Data.DataRelation.ObjectID, System.Data.DataRelation.ParentTable, and System.Data.ExceptionBuilder.SelfnestedDatasetConflictingName().

Referenced by System.Data.DataRelationCollection.DataSetRelationCollection.AddCore().