/// <summary> /// Creates and initializes a new block state in the inner. /// </summary> /// <param name="newBlockIndex">Index of the new block state to create.</param> /// <returns>The created block state.</returns> public virtual IReadOnlyBlockState InitNewBlock(IReadOnlyBrowsingNewBlockNodeIndex newBlockIndex) { Debug.Assert(newBlockIndex != null); Debug.Assert(newBlockIndex.PropertyName == PropertyName); int BlockIndex = newBlockIndex.BlockIndex; Debug.Assert(BlockIndex == BlockStateList.Count); NodeTreeHelperBlockList.GetChildBlock(Owner.Node, PropertyName, BlockIndex, out IBlock ChildBlock); IReadOnlyBlockState BlockState = CreateBlockState(newBlockIndex, ChildBlock); Debug.Assert(BlockState.ToString() != null); // For code coverage. InsertInBlockStateList(BlockIndex, BlockState); return(BlockState); }