Пример #1
0
        private void RenderBorderLine(
            IRenderer renderer,
            BorderLine borderLine,
            Drawing.Pen pen,
            Point pageOffset)
        {
            var page = renderer.GetPage(borderLine.PageNumber).Offset(pageOffset);
            var line = borderLine.ToLine(pen);

            page.RenderLine(line);
        }
Пример #2
0
 public CellBorder(
     BorderLine top,
     BorderLine bottom,
     IEnumerable <BorderLine> left,
     IEnumerable <BorderLine> right)
 {
     this.Top    = top;
     this.Bottom = bottom;
     this.Left   = left;
     this.Right  = right;
 }
Пример #3
0
        public CellBorder GetBorder(GridPosition position)
        {
            var space = this.CalculateHorizontalCellSpace(position);
            var lx    = new Point(space.X, 0);
            var rx    = new Point(space.RightX, 0);

            BorderLine?topLine    = null;
            BorderLine?bottomLine = null;
            var        leftLines  = new List <BorderLine>();
            var        rightLines = new List <BorderLine>();

            for (var i = position.Row; i < position.Row + position.RowSpan; i++)
            {
                var regions = this.FindPageRegionsOfRow(i);
                if (i == position.Row)
                {
                    var(pagePosition, region) = regions.First();
                    var start = region.TopLeft + lx;
                    var end   = region.TopLeft + rx;

                    topLine = new BorderLine(pagePosition.PageNumber, start, end);
                }

                foreach (var reg in regions)
                {
                    leftLines.Add(new BorderLine(reg.page.PageNumber, reg.region.TopLeft + lx, reg.region.BottomLeft + lx));
                    rightLines.Add(new BorderLine(reg.page.PageNumber, reg.region.TopLeft + rx, reg.region.BottomLeft + rx));
                }

                if (i == position.Row + position.RowSpan - 1)
                {
                    var(pagePosition, region) = regions.Last();
                    var start = new Point(region.X + space.X, region.BottomY);
                    var end   = new Point(region.X + space.RightX, region.BottomY);

                    bottomLine = new BorderLine(pagePosition.PageNumber, start, end);
                }
            }

            return(new CellBorder(topLine, bottomLine, leftLines, rightLines));
        }