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

◆ InsertRow() [3/3]

void System.Data.DataTable.InsertRow ( DataRow row,
long proposedID,
int pos,
bool fireEvent )
inlinepackageinherited

Definition at line 2476 of file DataTable.cs.

2477 {
2478 Exception deferredException = null;
2479 if (row == null)
2480 {
2481 throw ExceptionBuilder.ArgumentNull("row");
2482 }
2483 if (row.Table != this)
2484 {
2485 throw ExceptionBuilder.RowAlreadyInOtherCollection();
2486 }
2487 if (row.rowID != -1)
2488 {
2489 throw ExceptionBuilder.RowAlreadyInTheCollection();
2490 }
2491 row.BeginEdit();
2492 int tempRecord = row._tempRecord;
2493 row._tempRecord = -1;
2494 if (proposedID == -1)
2495 {
2497 }
2498 bool flag;
2499 if (flag = _nextRowID <= proposedID)
2500 {
2502 }
2503 try
2504 {
2505 try
2506 {
2509 }
2510 catch
2511 {
2512 if (flag && _nextRowID == proposedID + 1)
2513 {
2515 }
2516 row.rowID = -1L;
2518 throw;
2519 }
2520 if (deferredException != null)
2521 {
2522 throw deferredException;
2523 }
2524 if (!EnforceConstraints)
2525 {
2526 return;
2527 }
2529 for (int i = 0; i < count; i++)
2530 {
2531 DataColumn dataColumn = _columnCollection[i];
2532 if (dataColumn.Computed)
2533 {
2534 dataColumn.CheckColumnConstraint(row, DataRowAction.Add);
2535 }
2536 }
2537 }
2538 finally
2539 {
2540 row.ResetLastChangedColumn();
2541 }
2542 }
void Add(TKey key, TValue value)
void SetNewRecordWorker(DataRow row, int proposedRecord, DataRowAction action, bool isInMerge, bool suppressEnsurePropertyChanged, int position, bool fireEvent, out Exception deferredException)
readonly DataColumnCollection _columnCollection
Definition DataTable.cs:64

References System.Data.DataTable._columnCollection, System.Data.DataTable._nextRowID, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Data.ExceptionBuilder.ArgumentNull(), System.Data.InternalDataCollectionBase.Count, System.count, System.Runtime.Serialization.Dictionary, System.Data.DataTable.EnforceConstraints, System.L, System.Data.ExceptionBuilder.RowAlreadyInOtherCollection(), System.Data.ExceptionBuilder.RowAlreadyInTheCollection(), and System.Data.DataTable.SetNewRecordWorker().