/// <summary> /// Builds the cell view tree for this view. /// </summary> /// <param name="context">Context used to build the cell view tree.</param> public virtual void BuildRootCellView(IFrameCellViewTreeContext context) { Debug.Assert(context.StateView == this); IOptionalReference Optional = State.Optional; Debug.Assert(Optional != null); InitCellViewTable(true); Debug.Assert(RootCellView == null); IFrameCellView CellView; if (Optional.IsAssigned) { IFrameNodeTemplate NodeTemplate = Template as IFrameNodeTemplate; Debug.Assert(NodeTemplate != null); CellView = NodeTemplate.BuildNodeCells(context); } else { IFrameEmptyCellView EmptyCellView = CreateEmptyCellView(this, null); ValidateEmptyCellView(context, EmptyCellView); CellView = EmptyCellView; } SetRootCellView(CellView); SealCellViewTable(); }
/// <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); }
/// <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); }
/// <summary> /// Builds the cell view tree for this view. /// </summary> /// <param name="context">Context used to build the cell view tree.</param> public virtual void BuildRootCellView(IFrameCellViewTreeContext context) { Debug.Assert(context.StateView == this); Debug.Assert(RootCellView == null); InitCellViewTable(); IFrameNodeTemplate NodeTemplate = Template as IFrameNodeTemplate; Debug.Assert(NodeTemplate != null); SetRootCellView(NodeTemplate.BuildNodeCells(context)); SealCellViewTable(); }
/// <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, Type.FromTypeof <FrameTemplateSet>()); Type OwnerType = Type.FromGetType(state.Node); //Type InterfaceType = NodeTreeHelper.NodeTypeToInterfaceType(OwnerType); //IFrameNodeTemplate Template = NodeTypeToTemplate(InterfaceType); IFrameNodeTemplate Template = NodeTypeToTemplate(OwnerType); IFrameFrame Frame = Template.PropertyToFrame(propertyName); return(Frame); }