// 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();
}
}
}