示例#1
0
        /// <summary>
        /// Update the reference to the parent frame.
        /// </summary>
        /// <param name="parentTemplate">The parent template.</param>
        /// <param name="parentFrame">The parent frame.</param>
        public override void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame)
        {
            base.UpdateParent(parentTemplate, parentFrame);

            Debug.Assert(ParentTemplate == parentTemplate);
            Debug.Assert(ParentFrame == parentFrame);
        }
        private protected virtual bool GetFirstNamedFrame(IFrameFrame root, string propertyName, out IFrameNamedFrame frame)
        {
            bool Found = false;

            frame = null;

            if (root is IFrameNamedFrame AsNamedFrame)
            {
                if (AsNamedFrame.PropertyName == propertyName)
                {
                    frame = AsNamedFrame;
                    Found = true;
                }
            }

            if (!Found && root is IFramePanelFrame AsPanelFrame)
            {
                foreach (IFrameFrame Item in AsPanelFrame.Items)
                {
                    if (GetFirstNamedFrame(Item, propertyName, out frame))
                    {
                        Found = true;
                        break;
                    }
                }
            }

            return(Found);
        }
        /// <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);
        }
        private protected virtual bool GetFirstCommentFrame(IFrameFrame root, out IFrameCommentFrame frame)
        {
            bool Found = false;

            frame = null;

            if (root is IFrameCommentFrame AsCommentFrame)
            {
                frame = AsCommentFrame;
                Found = true;
            }

            if (!Found && root is IFramePanelFrame AsPanelFrame)
            {
                foreach (IFrameFrame Item in AsPanelFrame.Items)
                {
                    if (GetFirstCommentFrame(Item, out frame))
                    {
                        Found = true;
                        break;
                    }
                }
            }

            return(Found);
        }
 /// <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;
 }
        /// <summary>
        /// Update the reference to the parent frame.
        /// </summary>
        /// <param name="parentTemplate">The parent template.</param>
        /// <param name="parentFrame">The parent frame.</param>
        public override void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame)
        {
            base.UpdateParent(parentTemplate, parentFrame);

            foreach (IFrameKeywordFrame Item in Items)
            {
                Item.UpdateParent(parentTemplate, this);
            }
        }
示例#7
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;
        }
示例#8
0
        /// <summary>
        /// Update the reference to the parent frame.
        /// </summary>
        /// <param name="parentTemplate">The parent template.</param>
        /// <param name="parentFrame">The parent frame.</param>
        public virtual void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame)
        {
            Debug.Assert(parentTemplate != null);
            Debug.Assert(parentFrame != null);

            Debug.Assert(ParentTemplate == null);
            ParentTemplate = parentTemplate;

            Debug.Assert(ParentFrame == null);
            ParentFrame = parentFrame;
        }
        /// <summary>
        /// Update the reference to the parent frame.
        /// </summary>
        /// <param name="parentTemplate">The parent template.</param>
        /// <param name="parentFrame">The parent frame.</param>
        public virtual void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame)
        {
            Contract.RequireNotNull(parentTemplate, out IFrameTemplate ParentTemplate);
            Contract.RequireNotNull(parentFrame, out IFrameFrame ParentFrame);

            Debug.Assert(this.ParentTemplate == null);
            this.ParentTemplate = ParentTemplate;

            Debug.Assert(this.ParentFrame == null);
            this.ParentFrame = ParentFrame;
        }
示例#10
0
        /// <summary>
        /// Gets the frame that creates cells associated to a property in a state.
        /// </summary>
        /// <param name="state">The state.</param>
        /// <param name="propertyName">The property name.</param>
        public virtual IFrameFrame PropertyToFrame(IFrameNodeState state, string propertyName)
        {
            // Call overloads of this method if they exist.
            ControllerTools.AssertNoOverride(this, typeof(FrameTemplateSet));

            Type OwnerType              = state.Node.GetType();
            Type InterfaceType          = NodeTreeHelper.NodeTypeToInterfaceType(OwnerType);
            IFrameNodeTemplate Template = NodeTypeToTemplate(InterfaceType);
            IFrameFrame        Frame    = Template.PropertyToFrame(propertyName);

            return(Frame);
        }
        /// <summary>
        /// Update the reference to the parent frame.
        /// </summary>
        /// <param name="parentTemplate">The parent template.</param>
        /// <param name="parentFrame">The parent frame.</param>
        public override void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame)
        {
            base.UpdateParent(parentTemplate, parentFrame);

            Debug.Assert(ParentTemplate == parentTemplate);
            Debug.Assert(ParentFrame == parentFrame);

            foreach (IFocusSelectableFrame Item in Items)
            {
                Item.UpdateParent(parentTemplate, this);
            }
        }
示例#12
0
        /// <summary>
        /// Update the reference to the parent frame.
        /// </summary>
        /// <param name="parentTemplate">The parent template.</param>
        /// <param name="parentFrame">The parent frame.</param>
        public virtual void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame)
        {
            Debug.Assert(parentTemplate is IFocusTemplate);
            Debug.Assert(parentFrame is IFocusFrame);

            Debug.Assert(ParentTemplate == null);
            ParentTemplate = (IFocusTemplate)parentTemplate;

            Debug.Assert(ParentFrame == null);
            ParentFrame = (IFocusFrame)parentFrame;

            Content.UpdateParent(parentTemplate, this);
        }
示例#13
0
            public FocusRootFrame()
            {
                UpdateParent(null, null);
                int CommentFrameCount = 0;

                Debug.Assert(ParentTemplate == null);
                Debug.Assert(ParentFrame == null);
                Debug.Assert(!IsValid(null, null, ref CommentFrameCount));

                IFrameFrame AsFrameFrame = this;

                Debug.Assert(AsFrameFrame.ParentTemplate == null);
                Debug.Assert(AsFrameFrame.ParentFrame == null);
            }
        private protected bool GetFirstCollectionPlaceholderFrame(IFrameFrame root, out IFrameCollectionPlaceholderFrame frame)
        {
            if (root is IFrameCollectionPlaceholderFrame AsCollectionPlaceholderFrame)
            {
                frame = AsCollectionPlaceholderFrame;
                return(true);
            }

            if (root is IFramePanelFrame AsPanelFrame)
            {
                foreach (IFrameFrame Item in AsPanelFrame.Items)
                {
                    if (GetFirstCollectionPlaceholderFrame(Item, out frame))
                    {
                        return(true);
                    }
                }
            }

            frame = null;
            return(false);
        }
示例#15
0
 public void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame)
 {
 }
示例#16
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;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FrameFocusableCellView"/> 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 FrameFocusableCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameFrame frame)
     : base(stateView, parentCellView, frame)
 {
 }
        /// <summary>
        /// Update the reference to the parent frame.
        /// </summary>
        /// <param name="parentTemplate">The parent template.</param>
        /// <param name="parentFrame">The parent frame.</param>
        public override void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame)
        {
            base.UpdateParent(parentTemplate, parentFrame);

            UpdateInterfaceType(parentTemplate.NodeType);
        }
示例#19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FocusContainerCellView"/> 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 FocusContainerCellView(IFocusNodeStateView stateView, IFocusCellViewCollection parentCellView, IFocusNodeStateView childStateView, IFrameFrame frame)
     : base(stateView, parentCellView, childStateView, frame)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FrameCommentCellView"/> 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="documentation">The comment this cell is displaying.</param>
 public FrameCommentCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameFrame frame, IDocument documentation)
     : base(stateView, parentCellView, frame)
 {
     Documentation = documentation;
 }
示例#21
0
 /// <summary>
 /// Creates a IxxxContainerCellView object.
 /// </summary>
 private protected override IFrameContainerCellView CreateFrameCellView(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameNodeStateView childStateView, IFrameFrame frame)
 {
     ControllerTools.AssertNoOverride(this, Type.FromTypeof <FocusControllerView>());
     return(new FocusContainerCellView((IFocusNodeStateView)stateView, (IFocusCellViewCollection)parentCellView, (IFocusNodeStateView)childStateView, (IFocusFrame)frame));
 }
示例#22
0
 bool ICollection <IFrameFrame> .Contains(IFrameFrame value)
 {
     return(Contains((ILayoutFrame)value));
 }
示例#23
0
 bool ICollection <IFrameFrame> .Remove(IFrameFrame item)
 {
     return(Remove((ILayoutFrame)item));
 }
示例#24
0
 void ICollection <IFrameFrame> .Add(IFrameFrame item)
 {
     Add((ILayoutFrame)item);
 }
示例#25
0
 void IList <IFrameFrame> .Insert(int index, IFrameFrame item)
 {
     Insert(index, (IFocusFrame)item);
 }
示例#26
0
 int IList <IFrameFrame> .IndexOf(IFrameFrame value)
 {
     return(IndexOf((ILayoutFrame)value));
 }
示例#27
0
 void ICollection <IFrameFrame> .Add(IFrameFrame item)
 {
     Add((IFocusFrame)item);
 }
示例#28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FrameColumn"/> 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="cellViewList">The list of child cell views.</param>
 /// <param name="frame">The frame that was used to create this cell. Can be null.</param>
 public FrameColumn(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameCellViewList cellViewList, IFrameFrame frame)
     : base(stateView, parentCellView, cellViewList, frame)
 {
 }
示例#29
0
 void IList <IFrameFrame> .Insert(int index, IFrameFrame item)
 {
     Insert(index, (ILayoutFrame)item);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FrameCellViewCollection"/> 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="cellViewList">The list of child cell views.</param>
 /// <param name="frame">The frame that was used to create this cell. Can be null.</param>
 public FrameCellViewCollection(IFrameNodeStateView stateView, IFrameCellViewCollection parentCellView, IFrameCellViewList cellViewList, IFrameFrame frame)
     : base(stateView, parentCellView)
 {
     Frame        = frame;
     CellViewList = cellViewList;
 }