/// <summary> /// Initializes a new instance of ESCommon.Rtf.RtfTableCellStyle class. /// </summary> /// <param name="borderSetting">Cell border setting.</param> /// <param name="formatting">Formatting applied to paragraphs inside the cell by default.</param> /// <param name="align">Vertical align of the text inside the cell.</param> public RtfTableCellStyle(RtfBorderSetting borderSetting, RtfParagraphFormatting formatting, RtfTableCellVerticalAlign align) { SetBorders(borderSetting); _defaultParagraphFormatting = formatting; _verticalAlign = align; }
/// <summary> /// Sets border style. /// </summary> /// <param name="borderSetting">Cell border setting.</param> /// <param name="width">Width in points.</param> /// <param name="style">Border style.</param> /// <param name="colorIndex">Index of an entry in the color table.</param> public void SetBorders(RtfBorderSetting borderSetting, float width, RtfBorderStyle style, int colorIndex) { if ((borderSetting & RtfBorderSetting.Top) == RtfBorderSetting.Top) { Borders.Top.SetProperties(width, style, colorIndex); } else { Borders.Top.Width = 0; } if ((borderSetting & RtfBorderSetting.Left) == RtfBorderSetting.Left) { Borders.Left.SetProperties(width, style, colorIndex); } else { Borders.Left.Width = 0; } if ((borderSetting & RtfBorderSetting.Bottom) == RtfBorderSetting.Bottom) { Borders.Bottom.SetProperties(width, style, colorIndex); } else { Borders.Bottom.Width = 0; } if ((borderSetting & RtfBorderSetting.Right) == RtfBorderSetting.Right) { Borders.Right.SetProperties(width, style, colorIndex); } else { Borders.Right.Width = 0; } }
/// <summary> /// Initializes a new instance of ESCommon.Rtf.RtfTableCellStyle class. /// </summary> /// <param name="borderSetting">Cell border setting.</param> public RtfTableCellStyle(RtfBorderSetting borderSetting) { SetBorders(borderSetting); }
/// <summary> /// Sets border style. /// </summary> /// <param name="borderSetting">Cell border setting.</param> /// <param name="width">Width in points.</param> /// <param name="style">Border style.</param> public void SetBorders(RtfBorderSetting borderSetting, float width, RtfBorderStyle style) { SetBorders(borderSetting, width, style, -1); }
/// <summary> /// Sets border style. /// </summary> /// <param name="borderSetting">Cell border setting.</param> /// <param name="width">Width in points.</param> public void SetBorders(RtfBorderSetting borderSetting, float width) { SetBorders(borderSetting, width, RtfBorderStyle.SingleThicknessBorder, -1); }
/// <summary> /// Sets border style. /// </summary> /// <param name="borderSetting">Cell border setting.</param> public void SetBorders(RtfBorderSetting borderSetting) { SetBorders(borderSetting, .5F, RtfBorderStyle.SingleThicknessBorder, -1); }
/// <summary> /// Initializes a new instance of ESCommon.Rtf.RtfTableCellStyle class. /// </summary> /// <param name="borderSetting">Cell border setting.</param> /// <param name="formatting">Formatting applied to paragraphs inside the cell by default.</param> public RtfTableCellStyle(RtfBorderSetting borderSetting, RtfParagraphFormatting formatting) { SetBorders(borderSetting); _defaultParagraphFormatting = formatting; }