private void SetBorderWidth(IHaveABorderAndShading borderHolder, string width) { this.SetBorderWidth(borderHolder, width, TableData.Positions.Top); this.SetBorderWidth(borderHolder, width, TableData.Positions.Bottom); this.SetBorderWidth(borderHolder, width, TableData.Positions.Left); this.SetBorderWidth(borderHolder, width, TableData.Positions.Right); }
private void SetShading(IHaveABorderAndShading shadingHolder, string shading) { if (!shading.Equals("Transparent")) { string text2 = shadingHolder.BackgroundColor = WordOpenXmlUtils.RgbColor(new RPLReportColor(shading).ToColor()); } }
private void SetBorderStyle(IHaveABorderAndShading borderHolder, RPLFormat.BorderStyles style) { this.SetBorderStyle(borderHolder, style, TableData.Positions.Top); this.SetBorderStyle(borderHolder, style, TableData.Positions.Bottom); this.SetBorderStyle(borderHolder, style, TableData.Positions.Left); this.SetBorderStyle(borderHolder, style, TableData.Positions.Right); }
private void SetBorderColor(IHaveABorderAndShading borderHolder, string color) { this.SetBorderColor(borderHolder, color, TableData.Positions.Bottom); this.SetBorderColor(borderHolder, color, TableData.Positions.Left); this.SetBorderColor(borderHolder, color, TableData.Positions.Right); this.SetBorderColor(borderHolder, color, TableData.Positions.Top); }
private void SetBorderColor(IHaveABorderAndShading borderHolder, string color, TableData.Positions side) { switch (side) { case TableData.Positions.Top: borderHolder.BorderTop.Color = WordOpenXmlUtils.RgbColor(new RPLReportColor(color).ToColor()); break; case TableData.Positions.Bottom: borderHolder.BorderBottom.Color = WordOpenXmlUtils.RgbColor(new RPLReportColor(color).ToColor()); break; case TableData.Positions.Left: borderHolder.BorderLeft.Color = WordOpenXmlUtils.RgbColor(new RPLReportColor(color).ToColor()); break; case TableData.Positions.Right: borderHolder.BorderRight.Color = WordOpenXmlUtils.RgbColor(new RPLReportColor(color).ToColor()); break; } }
private void SetBorderStyle(IHaveABorderAndShading borderHolder, RPLFormat.BorderStyles style, TableData.Positions side) { OpenXmlBorderPropertiesModel.BorderStyle style2 = this.RPLFormatToBorderStyle(style); switch (side) { case TableData.Positions.Top: borderHolder.BorderTop.Style = style2; break; case TableData.Positions.Bottom: borderHolder.BorderBottom.Style = style2; break; case TableData.Positions.Left: borderHolder.BorderLeft.Style = style2; break; case TableData.Positions.Right: borderHolder.BorderRight.Style = style2; break; } }
private void SetBorderWidth(IHaveABorderAndShading borderHolder, string width, TableData.Positions side) { int widthInEighthPoints = (int)Math.Floor(new RPLReportSize(width).ToPoints() * 8.0); switch (side) { case TableData.Positions.Top: borderHolder.BorderTop.WidthInEighthPoints = widthInEighthPoints; break; case TableData.Positions.Bottom: borderHolder.BorderBottom.WidthInEighthPoints = widthInEighthPoints; break; case TableData.Positions.Left: borderHolder.BorderLeft.WidthInEighthPoints = widthInEighthPoints; break; case TableData.Positions.Right: borderHolder.BorderRight.WidthInEighthPoints = widthInEighthPoints; break; } }
public void AddCellStyleProp(int cellIndex, byte code, object value) { if (value != null) { IHaveABorderAndShading cellProperties = this._document.TableContext.CurrentCell.CellProperties; switch (code) { case 15: case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 27: case 28: case 29: case 31: case 32: case 33: case 35: break; case 0: this.SetBorderColor(cellProperties, (string)value); break; case 1: this.SetBorderColor(cellProperties, (string)value, TableData.Positions.Left); break; case 2: this.SetBorderColor(cellProperties, (string)value, TableData.Positions.Right); break; case 3: this.SetBorderColor(cellProperties, (string)value, TableData.Positions.Top); break; case 4: this.SetBorderColor(cellProperties, (string)value, TableData.Positions.Bottom); break; case 5: this.SetBorderStyle(cellProperties, (RPLFormat.BorderStyles)value); break; case 6: this.SetBorderStyle(cellProperties, (RPLFormat.BorderStyles)value, TableData.Positions.Left); break; case 7: this.SetBorderStyle(cellProperties, (RPLFormat.BorderStyles)value, TableData.Positions.Right); break; case 8: this.SetBorderStyle(cellProperties, (RPLFormat.BorderStyles)value, TableData.Positions.Top); break; case 9: this.SetBorderStyle(cellProperties, (RPLFormat.BorderStyles)value, TableData.Positions.Bottom); break; case 10: this.SetBorderWidth(cellProperties, (string)value); break; case 11: this.SetBorderWidth(cellProperties, (string)value, TableData.Positions.Left); break; case 12: this.SetBorderWidth(cellProperties, (string)value, TableData.Positions.Right); break; case 13: this.SetBorderWidth(cellProperties, (string)value, TableData.Positions.Top); break; case 14: this.SetBorderWidth(cellProperties, (string)value, TableData.Positions.Bottom); break; case 26: this.SetVerticalAlign((RPLFormat.VerticalAlignments)value); break; case 30: this.SetWritingMode((RPLFormat.WritingModes)value); break; case 34: this.SetShading(cellProperties, (string)value); break; } } }
public void AddTableStyleProp(byte code, object value) { if (value != null) { IHaveABorderAndShading tableProperties = this._document.TableContext.CurrentTable.TableProperties; switch (code) { case 15: case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31: case 32: case 33: case 35: case 36: case 37: break; case 0: this.SetBorderColor(tableProperties, (string)value); break; case 1: this.SetBorderColor(tableProperties, (string)value, TableData.Positions.Left); break; case 2: this.SetBorderColor(tableProperties, (string)value, TableData.Positions.Right); break; case 3: this.SetBorderColor(tableProperties, (string)value, TableData.Positions.Top); break; case 4: this.SetBorderColor(tableProperties, (string)value, TableData.Positions.Bottom); break; case 5: this.SetBorderStyle(tableProperties, (RPLFormat.BorderStyles)value); break; case 6: this.SetBorderStyle(tableProperties, (RPLFormat.BorderStyles)value, TableData.Positions.Left); break; case 7: this.SetBorderStyle(tableProperties, (RPLFormat.BorderStyles)value, TableData.Positions.Right); break; case 8: this.SetBorderStyle(tableProperties, (RPLFormat.BorderStyles)value, TableData.Positions.Top); break; case 9: this.SetBorderStyle(tableProperties, (RPLFormat.BorderStyles)value, TableData.Positions.Bottom); break; case 10: this.SetBorderWidth(tableProperties, (string)value); break; case 11: this.SetBorderWidth(tableProperties, (string)value, TableData.Positions.Left); break; case 12: this.SetBorderWidth(tableProperties, (string)value, TableData.Positions.Right); break; case 13: this.SetBorderWidth(tableProperties, (string)value, TableData.Positions.Top); break; case 14: this.SetBorderWidth(tableProperties, (string)value, TableData.Positions.Bottom); break; case 34: this.SetShading(tableProperties, (string)value); break; } } }