private bool IsBoardValid() { System.Collections.IEnumerator i = board.GetEnumerator(); Square s; while (i.MoveNext()) { s = (Square)i.Current; if (s.IsValid == false) { return(false); } } return(true); }