Table of Contents

Method With

Namespace
DocWright.Formats.Xlsx
Assembly
DocWright.Formats.Xlsx.dll

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

fontFamily string

The font family, or null to keep.

fontSizePoints decimal?

The font size in points, or null to keep.

bold bool?

Whether the font is bold, or null to keep.

italic bool?

Whether the font is italic, or null to keep.

underline bool?

Whether the text is underlined, or null to keep.

strike bool?

Whether the text is struck through, or null to keep.

fontColor ColorRgb?

The text colour, or null to keep.

backgroundColor ColorRgb?

The fill colour, or null to keep.

numberFormat string

The Excel number format code, or null to keep.

horizontalAlignment XlsxHorizontalAlignment?

The horizontal alignment, or null to keep.

verticalAlignment XlsxVerticalAlignment?

The vertical alignment, or null to keep.

wrapText bool?

Whether text wraps, or null to keep.

leftBorder XlsxBorder?

The left edge, or null to keep.

rightBorder XlsxBorder?

The right edge, or null to keep.

topBorder XlsxBorder?

The top edge, or null to keep.

bottomBorder XlsxBorder?

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.