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

◆ ProcessDiffs() [1/2]

void System.Data.XMLDiffLoader.ProcessDiffs ( ArrayList tableList,
XmlReader ssync )
inlinepackage

Definition at line 109 of file XMLDiffLoader.cs.

110 {
111 int pos = -1;
112 int depth = ssync.Depth;
113 ssync.Read();
114 while (depth < ssync.Depth)
115 {
116 DataTable table = null;
117 int num = -1;
118 string attribute = ssync.GetAttribute("id", "urn:schemas-microsoft-com:xml-diffgram-v1");
119 bool flag = ssync.GetAttribute("hasErrors", "urn:schemas-microsoft-com:xml-diffgram-v1") == "true";
120 num = ReadOldRowData(_dataSet, ref table, ref pos, ssync);
121 if (num == -1)
122 {
123 continue;
124 }
125 if (table == null)
126 {
127 throw ExceptionBuilder.DiffgramMissingSQL();
128 }
129 DataRow dataRow = (DataRow)table.RowDiffId[attribute];
130 if (dataRow != null)
131 {
132 dataRow._oldRecord = num;
133 table._recordManager[num] = dataRow;
134 continue;
135 }
136 dataRow = table.NewEmptyRow();
137 table._recordManager[num] = dataRow;
138 dataRow._oldRecord = num;
139 dataRow._newRecord = num;
140 table.Rows.DiffInsertAt(dataRow, pos);
141 dataRow.Delete();
142 if (flag)
143 {
144 table.RowDiffId[attribute] = dataRow;
145 }
146 }
147 }
int ReadOldRowData(DataSet ds, ref DataTable table, ref int pos, XmlReader row)

References System.Data.XMLDiffLoader._dataSet, System.Data.DataTable._recordManager, System.Xml.Dictionary, System.Data.ExceptionBuilder.DiffgramMissingSQL(), System.Data.DataRowCollection.DiffInsertAt(), System.Data.DataTable.NewEmptyRow(), System.Data.XMLDiffLoader.ReadOldRowData(), System.Data.DataTable.RowDiffId, and System.Data.DataTable.Rows.