private void SetShaper(Shaper<RecordState> shaper, CoordinatorFactory<RecordState> coordinatorFactory, int depth) { _shaper = shaper; _coordinatorFactory = coordinatorFactory; _dataRecord = new BridgeDataRecord(shaper, depth); // To determine whether there are any rows for this coordinator at this place in // the root enumerator, we pretty much just look at it's current record (we'll read // one if there isn't one waiting) and if it matches our coordinator, we've got rows. _hasRows = false; if (!_shaper.DataWaiting) { _shaper.DataWaiting = _shaper.RootEnumerator.MoveNext(); } if (_shaper.DataWaiting) { var currentRecord = _shaper.RootEnumerator.Current; if (null != currentRecord) { _hasRows = (currentRecord.CoordinatorFactory == _coordinatorFactory); } } // Once we've created the root enumerator, we can get the default record state _defaultRecordState = coordinatorFactory.GetDefaultRecordState(_shaper); Debug.Assert(null != _defaultRecordState, "no default?"); }