public bool GetNext()
{
Constraint candidate;
_currentObject = null;
while (_tables != null)
{
if (_constraints == null)
{
if (!_tables.MoveNext())
{
_tables = null;
return false;
}
_constraints = ((DataTable)_tables.Current).Constraints.GetEnumerator();
}
if (!_constraints.MoveNext())
{
_constraints = null;
continue;
}
Debug.Assert(_constraints.Current is Constraint, "ConstraintEnumerator, contains object which is not constraint");
candidate = (Constraint)_constraints.Current;
if (IsValidCandidate(candidate))
{
_currentObject = candidate;
return true;
}
}
return false;
}