/// <summary>
        /// Changes the state view to that of a child state.
        /// </summary>
        /// <param name="childStateView">The new state view.</param>
        public void SetChildStateView(IFrameNodeStateView childStateView)
        {
            Debug.Assert(childStateView != StateView);
            Debug.Assert(childStateView.State.ParentState == StateView.State);

            StateView = childStateView;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="FrameVisibleCellView"/> class.
 /// </summary>
 /// <param name="stateView">The state view containing the tree with this cell.</param>
 /// <param name="parentCellView">The collection of cell views containing this view. Null for the root of the cell tree.</param>
 /// <param name="frame">The frame that created this cell view.</param>
 public FrameVisibleCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameFrame frame)
     : base(stateView, parentCellView)
 {
     Frame        = frame;
     LineNumber   = 0;
     ColumnNumber = 0;
 }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FrameBlockCellView"/> class.
        /// </summary>
        /// <param name="stateView">The state view containing the tree with this cell.</param>
        /// <param name="parentCellView">The collection of cell views containing this view. Null for the root of the cell tree.</param>
        /// <param name="blockStateView">The block state view of the state associated to this cell.</param>
        public FrameBlockCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, FrameBlockStateView blockStateView)
            : base(stateView, parentCellView)
        {
            Debug.Assert(blockStateView.RootCellView != null);

            BlockStateView = blockStateView;
        }
        /// <summary>
        /// Changes the state view to that of the parent state.
        /// </summary>
        /// <param name="parentStateView">The new state view.</param>
        public void RestoreParentStateView(IFrameNodeStateView parentStateView)
        {
            Debug.Assert(parentStateView != StateView);
            Debug.Assert(parentStateView.State == StateView.State.ParentState);

            StateView = parentStateView;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="FocusCellViewTreeContext"/> class.
 /// </summary>
 /// <param name="controllerView">The view in which cells are created.</param>
 /// <param name="stateView">The state view for which to create cells.</param>
 /// <param name="forcedCommentStateView">The state view for which the comment must be visible, even if empty.</param>
 public FocusCellViewTreeContext(IFrameControllerView controllerView, IFrameNodeStateView stateView, IFocusNodeStateView forcedCommentStateView)
     : base(controllerView, stateView)
 {
     ForcedCommentStateView = forcedCommentStateView;
     IsFrameVisible         = true;
     IsUserVisible          = false;
     SelectorTable          = new Dictionary <Type, string>();
 }
Пример #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FrameContainerCellView"/> class.
        /// </summary>
        /// <param name="stateView">The state view containing the tree with this cell.</param>
        /// <param name="parentCellView">The collection of cell views containing this view.</param>
        /// <param name="childStateView">The state view of the state associated to this cell.</param>
        /// <param name="frame">The frame that was used to create this cell.</param>
        public FrameContainerCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameNodeStateView childStateView, IFrameFrame frame)
            : base(stateView, parentCellView)
        {
            Debug.Assert(parentCellView != null);
            Debug.Assert(childStateView != null);
            Debug.Assert(frame != null);

            ChildStateView = childStateView;
            Frame          = frame;
        }
Пример #7
0
        /// <summary>
        /// Clears the cell view tree for this view.
        /// </summary>
        /// <param name="stateView">The state view for which to delete cells.</param>
        public virtual void ClearRootCellView(IFrameNodeStateView stateView)
        {
            if (RootCellView != null)
            {
                RootCellView.ClearCellTree();
            }

            RootCellView      = null;
            EmbeddingCellView = null;
        }
Пример #8
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);
        }
        /// <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)
        {
            IFrameBlockStateView BlockStateView = context.BlockStateView;
            IFrameBlockState     BlockState     = BlockStateView.BlockState;

            Debug.Assert(BlockState != null);

            IFrameBlockTemplate BlockTemplate = ParentTemplate as IFrameBlockTemplate;

            Debug.Assert(BlockTemplate != null);

            IFrameStateViewDictionary StateViewTable    = context.ControllerView.StateViewTable;
            IFrameCellViewList        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 = 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);
        }
Пример #10
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);
        }
Пример #11
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));

            IFramePlaceholderInner <IFrameBrowsingPlaceholderNodeIndex> Inner = State.InnerTable[PropertyName] as IFramePlaceholderInner <IFrameBrowsingPlaceholderNodeIndex>;

            Debug.Assert(Inner != null);
            Debug.Assert(Inner.ChildState != null);
            IFrameNodeState ChildState = Inner.ChildState;

            IFrameStateViewDictionary StateViewTable = context.ControllerView.StateViewTable;

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

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

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

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

            ValidateContainerCellView(context.StateView, parentCellView, ChildStateView, EmbeddingCellView);

            ChildStateView.SetContainerCellView(EmbeddingCellView);

            AssignEmbeddingCellView(context.StateView, EmbeddingCellView);

            return(EmbeddingCellView);
        }
Пример #12
0
 private protected override void ValidateContainerCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameNodeStateView childStateView, IFrameContainerCellView containerCellView)
 {
     Debug.Assert(((ILayoutContainerCellView)containerCellView).StateView == (ILayoutNodeStateView)stateView);
     Debug.Assert(((ILayoutContainerCellView)containerCellView).ParentCellView == (ILayoutCellViewCollection)parentCellView);
     Debug.Assert(((ILayoutContainerCellView)containerCellView).ChildStateView == (ILayoutNodeStateView)childStateView);
 }
Пример #13
0
 /// <summary>
 /// Creates a IxxxCellViewCollection object.
 /// </summary>
 private protected override IFrameCellViewCollection CreateEmbeddingCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameCellViewList list)
 {
     ControllerTools.AssertNoOverride(this, typeof(LayoutVerticalPanelFrame));
     return(new LayoutColumn((ILayoutNodeStateView)stateView, (ILayoutCellViewCollection)parentCellView, (ILayoutCellViewList)list, this));
 }
Пример #14
0
 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);
 }
Пример #15
0
 /// <summary>
 /// Creates a IxxxCellViewCollection object.
 /// </summary>
 private protected override IFrameCellViewCollection CreateEmbeddingCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, FrameCellViewList list)
 {
     ControllerTools.AssertNoOverride(this, Type.FromTypeof <FrameHorizontalPanelFrame>());
     return(new FrameLine(stateView, parentCellView, list, this));
 }
Пример #16
0
 private protected virtual void AssignEmbeddingCellView(IFrameNodeStateView stateView, IFrameAssignableCellView embeddingCellView)
 {
     embeddingCellView.AssignToCellViewTable();
     ((IFrameReplaceableStateView)stateView).AssignCellViewTable(PropertyName, embeddingCellView);
 }
 /// <summary>
 /// Creates a IxxxCellViewCollection object.
 /// </summary>
 private protected override IFrameCellViewCollection CreateEmbeddingCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, FrameCellViewList list)
 {
     ControllerTools.AssertNoOverride(this, Type.FromTypeof <LayoutVerticalCollectionPlaceholderFrame>());
     return(new LayoutColumn((ILayoutNodeStateView)stateView, (ILayoutCellViewCollection)parentCellView, (LayoutCellViewList)list, this));
 }
 /// <summary>
 /// Creates a IxxxFocusableCellView object.
 /// </summary>
 private protected override IFrameFocusableCellView CreateFocusableCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView)
 {
     ControllerTools.AssertNoOverride(this, Type.FromTypeof <FocusInsertFrame>());
     return(new FocusFocusableCellView((IFocusNodeStateView)stateView, (IFocusCellViewCollection)parentCellView, this));
 }
Пример #19
0
 private protected virtual void ValidateContainerCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameNodeStateView childStateView, IFrameContainerCellView containerCellView)
 {
     Debug.Assert(containerCellView.StateView == stateView);
     Debug.Assert(containerCellView.ParentCellView == parentCellView);
     Debug.Assert(containerCellView.ChildStateView == childStateView);
 }
 /// <summary>
 /// Creates a IxxxContainerCellView object.
 /// </summary>
 private protected override IFrameContainerCellView CreateFrameCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameNodeStateView childStateView)
 {
     ControllerTools.AssertNoOverride(this, Type.FromTypeof <FocusVerticalCollectionPlaceholderFrame>());
     return(new FocusContainerCellView((IFocusNodeStateView)stateView, (IFocusCellViewCollection)parentCellView, (IFocusNodeStateView)childStateView, this));
 }
Пример #21
0
 /// <summary>
 /// Creates a IxxxContainerCellView object.
 /// </summary>
 private protected virtual IFrameContainerCellView CreateFrameCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameNodeStateView childStateView)
 {
     ControllerTools.AssertNoOverride(this, typeof(FramePlaceholderFrame));
     return(new FrameContainerCellView(stateView, parentCellView, childStateView, this));
 }
 /// <summary>
 /// Creates a IxxxCellViewCollection object.
 /// </summary>
 private protected override IFrameCellViewCollection CreateEmbeddingCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameCellViewList list)
 {
     ControllerTools.AssertNoOverride(this, typeof(FrameVerticalListFrame));
     return(new FrameColumn(stateView, parentCellView, list, this));
 }
Пример #23
0
 /// <summary>
 /// Creates a IxxxContainerCellView object.
 /// </summary>
 private protected override IFrameContainerCellView CreateFrameCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameNodeStateView childStateView, IFramePlaceholderFrame frame)
 {
     ControllerTools.AssertNoOverride(this, typeof(FocusVerticalPanelFrame));
     return(new FocusContainerCellView((IFocusNodeStateView)stateView, (IFocusCellViewCollection)parentCellView, (IFocusNodeStateView)childStateView, (IFocusPlaceholderFrame)frame));
 }
Пример #24
0
 /// <summary>
 /// Creates a IxxxEmptyCellView object.
 /// </summary>
 private protected virtual IFrameEmptyCellView CreateEmptyCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView)
 {
     ControllerTools.AssertNoOverride(this, typeof(FrameOptionalNodeStateView));
     return(new FrameEmptyCellView(stateView, parentCellView));
 }
Пример #25
0
 /// <summary>
 /// Creates a IxxxBlockCellView object.
 /// </summary>
 private protected override IFrameBlockCellView CreateBlockCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, FrameBlockStateView blockStateView)
 {
     ControllerTools.AssertNoOverride(this, Type.FromTypeof <LayoutVerticalBlockListFrame>());
     return(new LayoutBlockCellView((ILayoutNodeStateView)stateView, (ILayoutCellViewCollection)parentCellView, (LayoutBlockStateView)blockStateView));
 }
Пример #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FrameContentFocusableCellView"/> class.
 /// </summary>
 /// <param name="stateView">The state view containing the tree with this cell.</param>
 /// <param name="parentCellView">The collection of cell views containing this view. Null for the root of the cell tree.</param>
 /// <param name="frame">The frame that created this cell view.</param>
 /// <param name="propertyName">Property corresponding to the component of the node.</param>
 public FrameContentFocusableCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameFrame frame, string propertyName)
     : base(stateView, parentCellView, frame)
 {
     PropertyName = propertyName;
 }
Пример #27
0
 /// <summary>
 /// Creates a IxxxDiscreteContentFocusableCellView object.
 /// </summary>
 private protected override IFrameDiscreteContentFocusableCellView CreateDiscreteContentFocusableCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameKeywordFrame keywordFrame)
 {
     ControllerTools.AssertNoOverride(this, Type.FromTypeof <FocusDiscreteFrame>());
     return(new FocusDiscreteContentFocusableCellView((IFocusNodeStateView)stateView, (IFocusCellViewCollection)parentCellView, this, PropertyName, (IFocusKeywordFrame)keywordFrame));
 }
Пример #28
0
 /// <summary>
 /// Creates a IxxxContainerCellView object.
 /// </summary>
 private protected virtual IFrameContainerCellView CreateFrameCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameNodeStateView childStateView)
 {
     ControllerTools.AssertNoOverride(this, Type.FromTypeof <FrameListFrame>());
     return(new FrameContainerCellView(stateView, parentCellView, childStateView, this));
 }
Пример #29
0
 /// <summary>
 /// Creates a IxxxContainerCellView object.
 /// </summary>
 private protected override IFrameContainerCellView CreateFrameCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameNodeStateView childStateView)
 {
     ControllerTools.AssertNoOverride(this, typeof(LayoutPlaceholderFrame));
     return(new LayoutContainerCellView((ILayoutNodeStateView)stateView, (ILayoutCellViewCollection)parentCellView, (ILayoutNodeStateView)childStateView, this));
 }
Пример #30
0
 /// <summary>
 /// Creates a IxxxCellViewCollection object.
 /// </summary>
 private protected abstract IFrameCellViewCollection CreateEmbeddingCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, FrameCellViewList list);