Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 9
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)
        {
            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;
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
            }
Ejemplo n.º 14
0
        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);
        }
Ejemplo n.º 15
0
 public void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame)
 {
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 20
0
 /// <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;
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 22
0
 bool ICollection <IFrameFrame> .Contains(IFrameFrame value)
 {
     return(Contains((ILayoutFrame)value));
 }
Ejemplo n.º 23
0
 bool ICollection <IFrameFrame> .Remove(IFrameFrame item)
 {
     return(Remove((ILayoutFrame)item));
 }
Ejemplo n.º 24
0
 void ICollection <IFrameFrame> .Add(IFrameFrame item)
 {
     Add((ILayoutFrame)item);
 }
Ejemplo n.º 25
0
 void IList <IFrameFrame> .Insert(int index, IFrameFrame item)
 {
     Insert(index, (IFocusFrame)item);
 }
Ejemplo n.º 26
0
 int IList <IFrameFrame> .IndexOf(IFrameFrame value)
 {
     return(IndexOf((ILayoutFrame)value));
 }
Ejemplo n.º 27
0
 void ICollection <IFrameFrame> .Add(IFrameFrame item)
 {
     Add((IFocusFrame)item);
 }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 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;
 }