public SheetRange SetInsideBorder(BorderEdge style) { for (var row = Range.Cell1.Row; row <= Range.Cell2.Row; row++) { for (var col = Range.Cell1.Col; col <= Range.Cell2.Col; col++) { if (col > Range.Cell1.Col) { Sheet[row, col].Style.Border.Left = style; } if (col < Range.Cell2.Col) { Sheet[row, col].Style.Border.Right = style; } if (row > Range.Cell1.Row) { Sheet[row, col].Style.Border.Top = style; } if (row < Range.Cell2.Row) { Sheet[row, col].Style.Border.Bottom = style; } } } return(this); }
public SheetRange SetOutsideBorder(BorderEdge style) { for (var row = Range.Cell1.Row; row <= Range.Cell2.Row; row++) { Sheet[row, Range.Cell1.Col].Style.Border.Left = style; Sheet[row, Range.Cell2.Col].Style.Border.Right = style; } for (var col = Range.Cell1.Col; col <= Range.Cell2.Col; col++) { Sheet[Range.Cell1.Row, col].Style.Border.Top = style; Sheet[Range.Cell2.Row, col].Style.Border.Bottom = style; } return(this); }
public SheetRange SetBorder(BorderEdge style) { for (var row = Range.Cell1.Row; row <= Range.Cell2.Row; row++) { var rowRange = Sheet[row]; for (var col = Range.Cell1.Col; col <= Range.Cell2.Col; col++) { var border = rowRange[col].Style.Border; border.Left = style; border.Right = style; border.Top = style; border.Bottom = style; } } return(this); }
public static BorderEdge ToBorderEdge(this BorderEdgeStyle style) { var res = new BorderEdge { Style = GetBorderStyle(style) }; if (style.Color != null) res.Color = style.Color.ToColor(); return res; }
public void SetBorder(BorderEdge style) { for (var row = Range.Cell1.Row; row <= Range.Cell2.Row; row++) { var rowRange = Sheet[row]; for (var col = Range.Cell1.Col; col <= Range.Cell2.Col; col++) { var border = rowRange[col].Style.Border; border.Left = style; border.Right = style; border.Top = style; border.Bottom = style; } } }
public void SetOutsideBorder(BorderEdge style) { for (var row = Range.Cell1.Row; row <= Range.Cell2.Row; row++) { Sheet[row, Range.Cell1.Col].Style.Border.Left = style; Sheet[row, Range.Cell2.Col].Style.Border.Right = style; } for (var col = Range.Cell1.Col; col <= Range.Cell2.Col; col++) { Sheet[Range.Cell1.Row, col].Style.Border.Top = style; Sheet[Range.Cell2.Row, col].Style.Border.Bottom = style; } }