// If we're not in a DataSet relations collection, we need to verify on every property get that we're // still a good relation object. internal override void CheckState() { if (_DataSet == null) { // Make sure columns arrays are valid parentKey.CheckState(); childKey.CheckState(); if (parentKey.Table.DataSet != childKey.Table.DataSet) { throw ExceptionBuilder.TablesInDifferentSets(); } for (int i = 0; i < parentKey.Columns.Length; i++) { if (parentKey.Columns[i].DataType != childKey.Columns[i].DataType) { throw ExceptionBuilder.ColumnsTypeMismatch(); } } if (childKey.ColumnsEqual(parentKey)) { throw ExceptionBuilder.KeyColumnsIdentical(); } } }
// If we're not in a dataSet relations collection, we need to verify on every property get that we're // still a good relation object. internal void CheckState() { if (_dataSet == null) { _parentKey.CheckState(); _childKey.CheckState(); if (_parentKey.Table.DataSet != _childKey.Table.DataSet) { throw ExceptionBuilder.RelationDataSetMismatch(); } if (_childKey.ColumnsEqual(_parentKey)) { throw ExceptionBuilder.KeyColumnsIdentical(); } for (int i = 0; i < _parentKey.ColumnsReference.Length; i++) { if ((_parentKey.ColumnsReference[i].DataType != _childKey.ColumnsReference[i].DataType) || ((_parentKey.ColumnsReference[i].DataType == typeof(DateTime)) && (_parentKey.ColumnsReference[i].DateTimeMode != _childKey.ColumnsReference[i].DateTimeMode) && ((_parentKey.ColumnsReference[i].DateTimeMode & _childKey.ColumnsReference[i].DateTimeMode) != DataSetDateTime.Unspecified))) { // allow unspecified and unspecifiedlocal throw ExceptionBuilder.ColumnsTypeMismatch(); } } } }
private void NonVirtualCheckState() { if (_DataSet == null) { // Make sure columns arrays are valid _parentKey.CheckState(); _childKey.CheckState(); if (_parentKey.Table.DataSet != _childKey.Table.DataSet) { throw ExceptionBuilder.TablesInDifferentSets(); } for (int i = 0; i < _parentKey.ColumnsReference.Length; i++) { if (_parentKey.ColumnsReference[i].DataType != _childKey.ColumnsReference[i].DataType || ((_parentKey.ColumnsReference[i].DataType == typeof(DateTime)) && (_parentKey.ColumnsReference[i].DateTimeMode != _childKey.ColumnsReference[i].DateTimeMode) && ((_parentKey.ColumnsReference[i].DateTimeMode & _childKey.ColumnsReference[i].DateTimeMode) != DataSetDateTime.Unspecified))) { throw ExceptionBuilder.ColumnsTypeMismatch(); } } if (_childKey.ColumnsEqual(_parentKey)) { throw ExceptionBuilder.KeyColumnsIdentical(); } } }
// If we're not in a dataSet relations collection, we need to verify on every property get that we're // still a good relation object. internal void CheckState() { if (dataSet == null) { parentKey.CheckState(); childKey.CheckState(); if (parentKey.Table.DataSet != childKey.Table.DataSet) { throw ExceptionBuilder.RelationDataSetMismatch(); } if (childKey.ColumnsEqual(parentKey)) { throw ExceptionBuilder.KeyColumnsIdentical(); } for (int i = 0; i < parentKey.Columns.Length; i++) { if (parentKey.Columns[i].DataType != childKey.Columns[i].DataType) { throw ExceptionBuilder.ColumnsTypeMismatch(); } } } }
private void NonVirtualCheckState() { _key.CheckState(); }
internal override void CheckState() { key.CheckState(); }