2008-09-05 Raja R Harinath <harinath@hurrynot.org>
+ * DataRow.cs (_hasParentCollection): Remove. Implied by _rowId >= 0.
+ (HasParentCollection): Remove.
+ * DataRowCollection.cs (AddInternal, InsertAt): Update to changes.
+
* DataTable.cs (NewRowArray): Special case size == 0 to avoid
creating a lot of garbage.
internal int xmlRowID = 0;
internal bool _nullConstraintViolation;
private string _nullConstraintMessage;
- private bool _hasParentCollection;
private bool _inChangingEvent;
private int _rowId;
internal bool _rowChanged = false;
Original = -1;
_rowId = -1;
- _hasParentCollection = false;
}
internal void ImportRecord (int record)
private void CheckValue (object v, DataColumn col, bool doROCheck)
{
- if (doROCheck && _hasParentCollection && col.ReadOnly)
+ if (doROCheck && _rowId != -1 && col.ReadOnly)
throw new ReadOnlyException ();
if (v == null || v == DBNull.Value) {
return false;
}
- internal bool HasParentCollection {
- get { return _hasParentCollection; }
- set { _hasParentCollection = value; }
- }
-
internal void Validate ()
{
Table.AddRowToIndexes (this);
internal void AddInternal (DataRow row, DataRowAction action)
{
row.Table.ChangingDataRow (row, action);
- row.HasParentCollection = true;
List.Add (row);
row.RowID = List.Count - 1;
row.AttachRow ();
((DataRow) List [i]).RowID = i;
}
- row.HasParentCollection = true;
row.AttachRow ();
row.Table.ChangedDataRow (row, DataRowAction.Add);
}