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

◆ DiffInsertAt()

void System.Data.DataRowCollection.DiffInsertAt ( DataRow row,
int pos )
inlinepackage

Definition at line 61 of file DataRowCollection.cs.

62 {
63 if (pos < 0 || pos == _list.Count)
64 {
65 _table.AddRow(row, (pos > -1) ? (pos + 1) : (-1));
66 }
67 else if (_table.NestedParentRelations.Length != 0)
68 {
69 if (pos < _list.Count)
70 {
71 if (_list[pos] != null)
72 {
73 throw ExceptionBuilder.RowInsertTwice(pos, _table.TableName);
74 }
75 _list.RemoveAt(pos);
77 _table.InsertRow(row, pos + 1, pos);
78 }
79 else
80 {
81 while (pos > _list.Count)
82 {
83 _list.Add(null);
85 }
86 _table.AddRow(row, pos + 1);
87 }
88 }
89 else
90 {
91 _table.InsertRow(row, pos + 1, (pos > _list.Count) ? (-1) : pos);
92 }
93 }
void InsertRow(DataRow row, int proposedID, int pos)
void AddRow(DataRow row)
DataRelation[] NestedParentRelations
Definition DataTable.cs:586
int Add(K item)
Definition RBTree.cs:1225
void RemoveAt(int position)
Definition RBTree.cs:1269

References System.Data.DataRowCollection._list, System.Data.DataRowCollection._nullInList, System.Data.DataRowCollection._table, System.Data.RBTree< K >.Add(), System.Data.DataTable.AddRow(), System.Data.RBTree< K >.Count, System.Data.DataTable.InsertRow(), System.Data.DataTable.NestedParentRelations, System.Data.RBTree< K >.RemoveAt(), System.Data.ExceptionBuilder.RowInsertTwice(), and System.Data.DataTable.TableName.

Referenced by System.Data.XmlDataLoader.LoadTable(), System.Data.XMLDiffLoader.ProcessDiffs(), and System.Data.XMLDiffLoader.ProcessDiffs().