/// <summary>
        /// Prints the selection.
        /// </summary>
        public virtual void Print()
        {
            ILayoutControllerView ControllerView = StateView.ControllerView;

            Debug.Assert(ControllerView.PrintContext != null);
            ControllerView.UpdateLayout();

            Debug.Assert(RegionHelper.IsValid(StateView.ActualCellSize));

            ILayoutTemplateSet TemplateSet = ControllerView.TemplateSet;
            IList <IFocusFrameSelectorList> SelectorStack = StateView.GetSelectorStack();
            ILayoutDiscreteFrame            Frame         = (ILayoutDiscreteFrame)TemplateSet.PropertyToFrame(StateView.State, PropertyName, SelectorStack);

            Debug.Assert(Frame != null);

            int Value = NodeTreeHelper.GetEnumValue(StateView.State.Node, PropertyName);

            Frame.Print(ControllerView.PrintContext, Value, Point.Origin);
        }
Example #2
0
        /// <summary>
        /// Draws the cell.
        /// </summary>
        public virtual void Draw()
        {
            Debug.Assert(StateView != null);
            Debug.Assert(StateView.ControllerView != null);

            ILayoutDrawContext DrawContext = StateView.ControllerView.DrawContext;

            Debug.Assert(DrawContext != null);

            ILayoutDiscreteFrame AsDiscreteFrame = KeywordFrame.ParentFrame as ILayoutDiscreteFrame;

            Debug.Assert(AsDiscreteFrame != null);

            Debug.Assert(RegionHelper.IsFixed(ActualCellSize));

            CollectionWithSeparator.DrawBeforeItem(DrawContext, ReferenceContainer, CellOrigin, ActualCellSize, CellPadding);
            AsDiscreteFrame.Draw(DrawContext, this, CellOrigin, ActualCellSize, CellPadding);
            CollectionWithSeparator.DrawAfterItem(DrawContext, ReferenceContainer, CellOrigin, ActualCellSize, CellPadding);
        }
Example #3
0
        /// <summary>
        /// Prints the cell.
        /// </summary>
        /// <param name="origin">The origin from where to start printing.</param>
        public virtual void Print(Point origin)
        {
            Debug.Assert(StateView != null);
            Debug.Assert(StateView.ControllerView != null);

            ILayoutPrintContext PrintContext = StateView.ControllerView.PrintContext;

            Debug.Assert(PrintContext != null);

            ILayoutDiscreteFrame AsDiscreteFrame = KeywordFrame.ParentFrame as ILayoutDiscreteFrame;

            Debug.Assert(AsDiscreteFrame != null);

            Debug.Assert(RegionHelper.IsValid(ActualCellSize));

            origin = origin.Moved(CellOrigin.X, CellOrigin.Y);

            CollectionWithSeparator.PrintBeforeItem(PrintContext, ReferenceContainer, origin, ActualCellSize, CellPadding);
            AsDiscreteFrame.Print(PrintContext, this, origin, ActualCellSize, CellPadding);
            CollectionWithSeparator.PrintAfterItem(PrintContext, ReferenceContainer, origin, ActualCellSize, CellPadding);
        }
Example #4
0
        /// <summary>
        /// Measures the cell.
        /// </summary>
        /// <param name="collectionWithSeparator">A collection that can draw separators around the cell.</param>
        /// <param name="referenceContainer">The cell view in <paramref name="collectionWithSeparator"/> that contains this cell.</param>
        /// <param name="separatorLength">The length of the separator in <paramref name="collectionWithSeparator"/>.</param>
        public virtual void Measure(ILayoutCellViewCollection collectionWithSeparator, ILayoutCellView referenceContainer, Measure separatorLength)
        {
            CollectionWithSeparator = collectionWithSeparator;
            ReferenceContainer      = referenceContainer;
            SeparatorLength         = separatorLength;

            Debug.Assert(StateView != null);
            Debug.Assert(StateView.ControllerView != null);

            ILayoutMeasureContext MeasureContext = StateView.ControllerView.MeasureContext;

            Debug.Assert(MeasureContext != null);

            ILayoutDiscreteFrame AsDiscreteFrame = KeywordFrame.ParentFrame as ILayoutDiscreteFrame;

            Debug.Assert(AsDiscreteFrame != null);

            AsDiscreteFrame.Measure(MeasureContext, this, collectionWithSeparator, referenceContainer, separatorLength, out Size Size, out Padding Padding);
            CellSize       = Size;
            ActualCellSize = RegionHelper.InvalidSize;
            CellPadding    = Padding;

            Debug.Assert(RegionHelper.IsValid(CellSize));
        }