示例#1
0
        /// <summary></summary>
        protected virtual void PrintGeometrySymbol(PrintableGeometry geometry, Point origin, Size size, Padding padding)
        {
            int X      = origin.X.Print + padding.Left.Print;
            int Y      = origin.Y.Print;
            int Width  = size.Width.Print - padding.Left.Print - padding.Right.Print;
            int Height = size.Height.Print;

            char[]        GeometryAtOrigin = geometry.Scale(Width, Height);
            BrushSettings Brush            = BrushSettings.Symbol;

            if (geometry.Orientation == PrintOrientations.Horizontal)
            {
                for (int n = 0; n < GeometryAtOrigin.Length; n++)
                {
                    PrintableArea.Print(GeometryAtOrigin[n], X + n, Y, Brush);
                }
            }
            else
            {
                for (int n = 0; n < GeometryAtOrigin.Length; n++)
                {
                    PrintableArea.Print(GeometryAtOrigin[n], X, Y + n, Brush);
                }
            }
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrintContext"/> class.
 /// </summary>
 protected PrintContext()
     : base(new Typeface("Consolas"), 10, CultureInfo.CurrentCulture, System.Windows.FlowDirection.LeftToRight, null, null)
 {
     PrintableArea             = new PrintableArea();
     LeftBracketGeometry       = new PrintableGeometry('[', '┌', '└', '│', '│', PrintOrientations.Vertical);
     RightBracketGeometry      = new PrintableGeometry(']', '┐', '┘', '│', '│', PrintOrientations.Vertical);
     LeftCurlyBracketGeometry  = new PrintableGeometry('{', '╔', '╚', '║', '║', PrintOrientations.Vertical);
     RightCurlyBracketGeometry = new PrintableGeometry('}', '╗', '╝', '║', '║', PrintOrientations.Vertical);
     LeftParenthesisGeometry   = new PrintableGeometry('(', '╭', '╰', '│', '│', PrintOrientations.Vertical);
     RightParenthesisGeometry  = new PrintableGeometry(')', '╮', '╯', '│', '│', PrintOrientations.Vertical);
     HorizontalLineGeometry    = new PrintableGeometry('─', '─', '─', '─', '─', PrintOrientations.Horizontal);
 }