/// <summary> /// Builds the cell view tree for this view. /// </summary> /// <param name="context">Context used to build the cell view tree.</param> public virtual void BuildRootCellView(IFrameCellViewTreeContext context) { Debug.Assert(context.StateView == this); IOptionalReference Optional = State.Optional; Debug.Assert(Optional != null); InitCellViewTable(true); Debug.Assert(RootCellView == null); IFrameCellView CellView; if (Optional.IsAssigned) { IFrameNodeTemplate NodeTemplate = Template as IFrameNodeTemplate; Debug.Assert(NodeTemplate != null); CellView = NodeTemplate.BuildNodeCells(context); } else { IFrameEmptyCellView EmptyCellView = CreateEmptyCellView(this, null); ValidateEmptyCellView(context, EmptyCellView); CellView = EmptyCellView; } SetRootCellView(CellView); SealCellViewTable(); }
/// <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) { IDocument Documentation = context.StateView.State.Node.Documentation; string Text = CommentHelper.Get(Documentation); if (IsDisplayed(context, Text)) { IFrameVisibleCellView CellView = CreateCommentCellView(context.StateView, parentCellView, context.StateView.State.Node.Documentation); ValidateVisibleCellView(context, CellView); if (context.StateView.State is IFrameOptionalNodeState AsOptionalNodeState) { Debug.Assert(AsOptionalNodeState.ParentInner.IsAssigned); } return(CellView); } else { IFrameEmptyCellView CellView = CreateEmptyCellView(context.StateView, parentCellView); ValidateEmptyCellView(context, CellView); return(CellView); } }
/// <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 collection of cell views containing this view. Null for the root of the cell tree.</param> public virtual IFrameCellView BuildBlockCells(IFrameCellViewTreeContext context, IFrameCellViewCollection parentCellView) { IDocument Documentation = context.BlockStateView.BlockState.ChildBlock.Documentation; string Text = CommentHelper.Get(Documentation); if (IsDisplayed(context, Text)) { IFrameVisibleCellView CellView = CreateCommentCellView(context.StateView, parentCellView, Documentation); ValidateVisibleCellView(context, CellView); return(CellView); } else { IFrameEmptyCellView CellView = CreateEmptyCellView(context.StateView, parentCellView); ValidateEmptyCellView(context, CellView); return(CellView); } }
private protected virtual void ValidateEmptyCellView(IFrameCellViewTreeContext context, IFrameEmptyCellView emptyCellView) { Debug.Assert(emptyCellView.StateView == context.StateView); IFrameCellViewCollection ParentCellView = emptyCellView.ParentCellView; }
private protected override void ValidateEmptyCellView(IFrameCellViewTreeContext context, IFrameEmptyCellView emptyCellView) { Debug.Assert(((ILayoutEmptyCellView)emptyCellView).StateView == ((ILayoutCellViewTreeContext)context).StateView); ILayoutCellViewCollection ParentCellView = ((ILayoutEmptyCellView)emptyCellView).ParentCellView; }