Method With
With(string?, decimal?, bool?, bool?, bool?, bool?, ColorRgb?, ColorRgb?, string?, XlsxHorizontalAlignment?, XlsxVerticalAlignment?, bool?, XlsxBorder?, XlsxBorder?, XlsxBorder?, XlsxBorder?)
Returns a copy with the members named by the arguments replaced.
public XlsxCellStyle With(string? fontFamily = null, decimal? fontSizePoints = null, bool? bold = null, bool? italic = null, bool? underline = null, bool? strike = null, ColorRgb? fontColor = null, ColorRgb? backgroundColor = null, string? numberFormat = null, XlsxHorizontalAlignment? horizontalAlignment = null, XlsxVerticalAlignment? verticalAlignment = null, bool? wrapText = null, XlsxBorder? leftBorder = null, XlsxBorder? rightBorder = null, XlsxBorder? topBorder = null, XlsxBorder? bottomBorder = null)
Parameters
fontFamilystringThe font family, or null to keep.
fontSizePointsdecimal?The font size in points, or null to keep.
boldbool?Whether the font is bold, or null to keep.
italicbool?Whether the font is italic, or null to keep.
underlinebool?Whether the text is underlined, or null to keep.
strikebool?Whether the text is struck through, or null to keep.
fontColorColorRgb?The text colour, or null to keep.
backgroundColorColorRgb?The fill colour, or null to keep.
numberFormatstringThe Excel number format code, or null to keep.
horizontalAlignmentXlsxHorizontalAlignment?The horizontal alignment, or null to keep.
verticalAlignmentXlsxVerticalAlignment?The vertical alignment, or null to keep.
wrapTextbool?Whether text wraps, or null to keep.
leftBorderXlsxBorder?The left edge, or null to keep.
rightBorderXlsxBorder?The right edge, or null to keep.
topBorderXlsxBorder?The top edge, or null to keep.
bottomBorderXlsxBorder?The bottom edge, or null to keep.
Returns
- XlsxCellStyle
The modified copy.
Remarks
Every argument is optional and null means "leave this one alone", which is why a colour cannot be cleared through this method — Default is where a caller starts again from nothing.