Ejemplo n.º 1
0
        /// <summary>
        /// Draws the vertical line on the left of a block.
        /// </summary>
        /// <param name="origin">The location where to draw.</param>
        /// <param name="height">The separator height.</param>
        public virtual void DrawVerticalBlockGeometry(Point origin, Measure height)
        {
            Debug.Assert(WpfDrawingContext != null);

            Pen    LinePen = GetPen(PenSettings.BlockGeometry);
            double X       = PagePadding.Left.Draw + origin.X.Draw;
            double Y       = PagePadding.Top.Draw + origin.Y.Draw;
            double d0      = BlockGeometryWidth.Draw;
            double d1      = BlockGeometryWidth.Draw / 2;

            System.Windows.Point point0 = new System.Windows.Point(X + d0, Y);
            System.Windows.Point point1 = new System.Windows.Point(X + d1, Y);
            System.Windows.Point point2 = new System.Windows.Point(X + d1, Y + height.Draw);
            System.Windows.Point point3 = new System.Windows.Point(X + d0, Y + height.Draw);

            WpfDrawingContext.DrawLine(LinePen, point0, point1);
            WpfDrawingContext.DrawLine(LinePen, point1, point2);
            WpfDrawingContext.DrawLine(LinePen, point2, point3);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Draws the vertical separator above the specified origin and with the specified width.
        /// </summary>
        /// <param name="separator">The separator to draw.</param>
        /// <param name="origin">The location where to draw.</param>
        /// <param name="width">The separator width.</param>
        public virtual void DrawVerticalSeparator(VerticalSeparators separator, Point origin, Measure width)
        {
            Debug.Assert(WpfDrawingContext != null);

            switch (separator)
            {
            case VerticalSeparators.None:
                break;

            case VerticalSeparators.Line:
                Pen     LinePen = GetPen(PenSettings.VerticalSeparator);
                Measure Height  = VerticalSeparatorHeightTable[VerticalSeparators.Line];
                double  X       = PagePadding.Left.Draw + origin.X.Draw;
                double  Y       = PagePadding.Left.Draw + origin.Y.Draw - (Height.Draw / 2);

                System.Windows.Point Point0 = new System.Windows.Point(X, Y);
                System.Windows.Point Point1 = new System.Windows.Point(X + width.Draw, Y);
                WpfDrawingContext.DrawLine(LinePen, Point0, Point1);
                break;
            }
        }