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

◆ CopyRecord()

int System.Data.RecordManager.CopyRecord ( DataTable src,
int record,
int copy )
inlinepackage

Definition at line 198 of file RecordManager.cs.

199 {
200 if (record == -1)
201 {
202 return copy;
203 }
204 int record2 = -1;
205 try
206 {
209 for (int i = 0; i < count; i++)
210 {
211 DataColumn dataColumn = _table.Columns[i];
212 DataColumn dataColumn2 = src.Columns[dataColumn.ColumnName];
213 if (dataColumn2 != null)
214 {
215 object obj = dataColumn2[record];
216 if (obj is ICloneable cloneable)
217 {
218 dataColumn[record2] = cloneable.Clone();
219 }
220 else
221 {
223 }
224 }
225 else if (-1 == copy)
226 {
227 dataColumn.Init(record2);
228 }
229 }
230 return record2;
231 }
232 catch (Exception e) when (ADP.IsCatchableOrSecurityExceptionType(e))
233 {
234 if (-1 == copy)
235 {
237 }
238 throw;
239 }
240 }
static bool IsCatchableOrSecurityExceptionType(Exception e)
Definition ADP.cs:800
DataColumnCollection Columns
Definition DataTable.cs:327
readonly DataTable _table
void FreeRecord(ref int record)

References System.Data.RecordManager._table, System.Data.DataTable.Columns, System.Data.InternalDataCollectionBase.Count, System.count, System.Data.RecordManager.FreeRecord(), System.Data.Common.ADP.IsCatchableOrSecurityExceptionType(), System.Data.DataTable.NewUninitializedRecord(), and System.obj.

Referenced by System.Data.RecordManager.ImportRecord(), and System.Data.DataTable.MergeRow().