/// <summary> /// Create cells for the provided state view. /// </summary> /// <param name="context">Context used to build the cell view tree.</param> /// <param name="parentCellView">The parent cell view.</param> public virtual IFrameCellView BuildNodeCells(IFrameCellViewTreeContext context, IFrameCellViewCollection parentCellView) { IFrameNodeState State = context.StateView.State; Debug.Assert(State != null); Debug.Assert(State.InnerTable != null); Debug.Assert(State.InnerTable.ContainsKey(PropertyName)); IFrameBlockListInner <IFrameBrowsingBlockNodeIndex> Inner = State.InnerTable[PropertyName] as IFrameBlockListInner <IFrameBrowsingBlockNodeIndex>; Debug.Assert(Inner != null); FrameBlockStateViewDictionary BlockStateViewTable = context.ControllerView.BlockStateViewTable; FrameCellViewList CellViewList = CreateCellViewList(); IFrameCellViewCollection EmbeddingCellView = CreateEmbeddingCellView(context.StateView, parentCellView, CellViewList); ValidateEmbeddingCellView(context, EmbeddingCellView); Type BlockType = Inner.BlockType; IFrameTemplateSet TemplateSet = context.ControllerView.TemplateSet; IFrameBlockTemplate BlockTemplate = TemplateSet.BlockTypeToTemplate(BlockType); foreach (IFrameBlockState BlockState in Inner.BlockStateList) { Debug.Assert(context.ControllerView.BlockStateViewTable.ContainsKey(BlockState)); FrameBlockStateView BlockStateView = (FrameBlockStateView)context.ControllerView.BlockStateViewTable[BlockState]; context.SetBlockStateView(BlockStateView); BlockStateView.BuildRootCellView(context); IFrameBlockCellView BlockCellView = CreateBlockCellView(context.StateView, EmbeddingCellView, BlockStateView); ValidateBlockCellView(context.StateView, EmbeddingCellView, BlockStateView, BlockCellView); CellViewList.Add(BlockCellView); } AssignEmbeddingCellView(context.StateView, EmbeddingCellView); return(EmbeddingCellView); }
private protected override void ValidateBlockCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, FrameBlockStateView blockStateView, IFrameBlockCellView blockCellView) { Debug.Assert(((ILayoutBlockCellView)blockCellView).StateView == (ILayoutNodeStateView)stateView); Debug.Assert(((ILayoutBlockCellView)blockCellView).ParentCellView == (ILayoutCellViewCollection)parentCellView); Debug.Assert(((ILayoutBlockCellView)blockCellView).BlockStateView == (LayoutBlockStateView)blockStateView); }
private protected virtual void ValidateBlockCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, FrameBlockStateView blockStateView, IFrameBlockCellView blockCellView) { Debug.Assert(blockCellView.StateView == stateView); Debug.Assert(blockCellView.ParentCellView == parentCellView); Debug.Assert(blockCellView.BlockStateView == blockStateView); }