Exemple #1
0
        /// <summary>
        /// Gets the frame that creates cells associated to a property in a state.
        /// This overload uses selectors to choose the correct frame.
        /// </summary>
        /// <param name="state">The state.</param>
        /// <param name="propertyName">The property name.</param>
        /// <param name="selectorStack">A list of selectors to choose the correct frame.</param>
        public virtual IFocusFrame PropertyToFrame(IFocusNodeState state, string propertyName, IList <IFocusFrameSelectorList> selectorStack)
        {
            Type OwnerType              = state.Node.GetType();
            Type InterfaceType          = NodeTreeHelper.NodeTypeToInterfaceType(OwnerType);
            IFocusNodeTemplate Template = (IFocusNodeTemplate)NodeTypeToTemplate(InterfaceType);
            IFocusFrame        Frame    = Template.PropertyToFrame(propertyName, selectorStack);

            return(Frame);
        }
Exemple #2
0
        /// <summary>
        /// Gets the frame that creates cells associated to a comment in a state.
        /// This overload uses selectors to choose the correct frame.
        /// </summary>
        /// <param name="state">The state.</param>
        /// <param name="selectorStack">A list of selectors to choose the correct frame.</param>
        public virtual IFocusCommentFrame GetCommentFrame(IFocusNodeState state, IList <IFocusFrameSelectorList> selectorStack)
        {
            Type OwnerType              = state.Node.GetType();
            Type InterfaceType          = NodeTreeHelper.NodeTypeToInterfaceType(OwnerType);
            IFocusNodeTemplate Template = (IFocusNodeTemplate)NodeTypeToTemplate(InterfaceType);
            IFocusCommentFrame Frame    = Template.GetCommentFrame(selectorStack);

            return(Frame);
        }
Exemple #3
0
        /// <summary>
        /// Gets the frame that creates cells associated to a comment in a state.
        /// </summary>
        /// <param name="state">The state.</param>
        public virtual IFrameCommentFrame GetCommentFrame(IFrameNodeState state)
        {
            // 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);
            IFrameCommentFrame Frame    = Template.GetCommentFrame();

            return(Frame);
        }
Exemple #4
0
        /// <summary>
        /// Gets the frame that creates cells associated to states in the inner.
        /// This overload uses selectors to choose the correct frame.
        /// </summary>
        /// <param name="inner">The inner.</param>
        /// <param name="selectorStack">A list of selectors to choose the correct frame.</param>
        public virtual IFocusFrame InnerToFrame(IFocusInner <IFocusBrowsingChildIndex> inner, IList <IFocusFrameSelectorList> selectorStack)
        {
            IFocusNodeState    Owner         = inner.Owner;
            Type               OwnerType     = Owner.Node.GetType();
            Type               InterfaceType = NodeTreeHelper.NodeTypeToInterfaceType(OwnerType);
            IFocusNodeTemplate Template      = (IFocusNodeTemplate)NodeTypeToTemplate(InterfaceType);
            IFocusFrame        Frame         = Template.PropertyToFrame(inner.PropertyName, selectorStack);

            if (Frame is IFocusBlockListFrame AsBlockListFrame)
            {
                IFocusBlockListInner <IFocusBrowsingBlockNodeIndex> BlockListInner = inner as IFocusBlockListInner <IFocusBrowsingBlockNodeIndex>;
                Debug.Assert(BlockListInner != null);

                Type BlockType = NodeTreeHelperBlockList.BlockListBlockType(Owner.Node, BlockListInner.PropertyName);
                IFocusBlockTemplate BlockTemplate = (IFocusBlockTemplate)BlockTypeToTemplate(BlockType);

                Frame = (IFocusFrame)BlockTemplate.GetPlaceholderFrame();
            }

            return(Frame);
        }
Exemple #5
0
        /// <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, typeof(FrameTemplateSet));

            IFrameNodeState    Owner         = inner.Owner;
            Type               OwnerType     = Owner.Node.GetType();
            Type               InterfaceType = NodeTreeHelper.NodeTypeToInterfaceType(OwnerType);
            IFrameNodeTemplate Template      = NodeTypeToTemplate(InterfaceType);
            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);
        }