Exemplo n.º 1
0
        /// <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));

            IFrameListInner <IFrameBrowsingListNodeIndex> Inner = State.InnerTable[PropertyName] as IFrameListInner <IFrameBrowsingListNodeIndex>;

            Debug.Assert(Inner != null);

            FrameNodeStateViewDictionary StateViewTable    = context.ControllerView.StateViewTable;
            FrameCellViewList            CellViewList      = CreateCellViewList();
            IFrameCellViewCollection     EmbeddingCellView = CreateEmbeddingCellView(context.StateView, parentCellView, CellViewList);

            ValidateEmbeddingCellView(context, EmbeddingCellView);

            foreach (IFrameNodeState ChildState in Inner.StateList)
            {
                Debug.Assert(StateViewTable.ContainsKey(ChildState));

                IFrameNodeStateView StateView      = context.StateView;
                IFrameNodeStateView ChildStateView = (IFrameNodeStateView)StateViewTable[ChildState];

                Debug.Assert(ChildStateView.RootCellView == null);
                context.SetChildStateView(ChildStateView);
                ChildStateView.BuildRootCellView(context);
                context.RestoreParentStateView(StateView);
                Debug.Assert(ChildStateView.RootCellView != null);

                IFrameContainerCellView FrameCellView = CreateFrameCellView(context.StateView, EmbeddingCellView, ChildStateView);
                ValidateContainerCellView(context.StateView, EmbeddingCellView, ChildStateView, FrameCellView);

                ChildStateView.SetContainerCellView(FrameCellView);

                CellViewList.Add(FrameCellView);
            }

            AssignEmbeddingCellView(context.StateView, EmbeddingCellView);

            return(EmbeddingCellView);
        }
Exemplo n.º 2
0
        /// <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)
        {
            FrameBlockStateView BlockStateView = context.BlockStateView;
            IFrameBlockState    BlockState     = BlockStateView.BlockState;

            Debug.Assert(BlockState != null);

            IFrameBlockTemplate BlockTemplate = ParentTemplate as IFrameBlockTemplate;

            Debug.Assert(BlockTemplate != null);

            FrameNodeStateViewDictionary StateViewTable    = context.ControllerView.StateViewTable;
            FrameCellViewList            CellViewList      = CreateCellViewList();
            IFrameCellViewCollection     EmbeddingCellView = CreateEmbeddingCellView(context.StateView, parentCellView, CellViewList);

            ValidateEmbeddingCellView(context, EmbeddingCellView);

            foreach (IFrameNodeState ChildState in BlockState.StateList)
            {
                Debug.Assert(StateViewTable.ContainsKey(ChildState));

                IFrameNodeStateView StateView      = context.StateView;
                IFrameNodeStateView ChildStateView = (IFrameNodeStateView)StateViewTable[ChildState];

                Debug.Assert(ChildStateView.RootCellView == null);
                context.SetChildStateView(ChildStateView);
                ChildStateView.BuildRootCellView(context);
                context.RestoreParentStateView(StateView);
                Debug.Assert(ChildStateView.RootCellView != null);

                IFrameContainerCellView FrameCellView = CreateFrameCellView(context.StateView, EmbeddingCellView, ChildStateView);
                ValidateContainerCellView(context.StateView, EmbeddingCellView, ChildStateView, FrameCellView);

                ChildStateView.SetContainerCellView(FrameCellView);

                CellViewList.Add(FrameCellView);
            }

            AssignEmbeddingCellView(BlockStateView, EmbeddingCellView);

            return(EmbeddingCellView);
        }
Exemplo n.º 3
0
        private protected virtual IFrameCellView BuildPlaceholderCells(IFrameCellViewTreeContext context, IFrameCellViewCollection parentCellView, IFrameNodeState childState, IFramePlaceholderFrame frame)
        {
            FrameNodeStateViewDictionary StateViewTable = context.ControllerView.StateViewTable;

            Debug.Assert(StateViewTable.ContainsKey(childState));

            IFrameNodeStateView StateView      = context.StateView;
            IFrameNodeStateView ChildStateView = (IFrameNodeStateView)StateViewTable[childState];

            Debug.Assert(ChildStateView.RootCellView == null);
            context.SetChildStateView(ChildStateView);
            ChildStateView.BuildRootCellView(context);
            context.RestoreParentStateView(StateView);
            Debug.Assert(ChildStateView.RootCellView != null);

            IFrameContainerCellView Result = CreateFrameCellView(context.StateView, parentCellView, ChildStateView, frame);

            ChildStateView.SetContainerCellView(Result);

            return(Result);
        }
Exemplo n.º 4
0
 /// <inheritdoc/>
 public FrameNodeStateViewReadOnlyDictionary(FrameNodeStateViewDictionary dictionary)
     : base(dictionary)
 {
 }