/// <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> /// 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 the properties of the current border. /// </summary> /// <param name="width">Width in points.</param> /// <param name="style">Border style.</param> /// <param name="colorIndex">Index of entry in the color table.</param> public void SetProperties(float width, RtfBorderStyle style, int colorIndex) { Width = TwipConverter.ToTwip(width, MetricUnit.Point); Style = style; ColorIndex = colorIndex; }