/// <summary> /// Gets the frame that creates cells associated to states in the inner. /// </summary> /// <param name="inner">The inner.</param> public virtual IFrameFrame InnerToFrame(IFrameInner <IFrameBrowsingChildIndex> inner) { // Call overloads of this method if they exist. ControllerTools.AssertNoOverride(this, Type.FromTypeof <FrameTemplateSet>()); IFrameNodeState Owner = inner.Owner; Type OwnerType = Type.FromGetType(Owner.Node); //Type InterfaceType = NodeTreeHelper.NodeTypeToInterfaceType(OwnerType); //IFrameNodeTemplate Template = NodeTypeToTemplate(InterfaceType); IFrameNodeTemplate Template = NodeTypeToTemplate(OwnerType); IFrameFrame Frame = Template.PropertyToFrame(inner.PropertyName); if (Frame is IFrameBlockListFrame AsBlockListFrame) { IFrameBlockListInner <IFrameBrowsingBlockNodeIndex> BlockListInner = inner as IFrameBlockListInner <IFrameBrowsingBlockNodeIndex>; Debug.Assert(BlockListInner != null); Type BlockType = NodeTreeHelperBlockList.BlockListBlockType(Owner.Node, BlockListInner.PropertyName); IFrameBlockTemplate BlockTemplate = BlockTypeToTemplate(BlockType); Frame = BlockTemplate.GetPlaceholderFrame(); } return(Frame); }
/// <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); }
/// <summary> /// Initializes a new instance of the <see cref="FrameBlockState{IInner}"/> class. /// </summary> /// <param name="parentInner">Inner containing the block state.</param> /// <param name="newBlockIndex">Index that was used to create the block state.</param> /// <param name="childBlock">The block.</param> public FrameBlockState(IFrameBlockListInner parentInner, IFrameBrowsingNewBlockNodeIndex newBlockIndex, IBlock childBlock) : base(parentInner, newBlockIndex, childBlock) { }