Table of Contents

Class XlsxCellStyle

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

Everything about how one cell looks: its font, its fill, its edges, its alignment and the number format its value is displayed through.

public sealed class XlsxCellStyle : IEquatable<XlsxCellStyle>
Inheritance
XlsxCellStyle
Implements
Inherited Members

Remarks

A style is a value, not a resource. Two cells given equal styles share one record in the workbook's style table, which the writer deduplicates on the way out — so a caller builds one of these per cell without thinking about it and the file still carries each distinct combination once.

Equality is what makes that work, so every member takes part in it and the type is immutable. With(string?, decimal?, bool?, bool?, bool?, bool?, ColorRgb?, ColorRgb?, string?, XlsxHorizontalAlignment?, XlsxVerticalAlignment?, bool?, XlsxBorder?, XlsxBorder?, XlsxBorder?, XlsxBorder?) produces a modified copy.

Fields

Default

The style a cell has when it is given none: Excel's defaults throughout.

Properties

BackgroundColor

Gets the cell's fill colour, or null for no fill.

Bold

Gets whether the font is bold.

BottomBorder

Gets the bottom edge.

FontColor

Gets the text colour, or null for Excel's default.

FontFamily

Gets the font family. Never null or empty.

FontSizePoints

Gets the font size in points.

HorizontalAlignment

Gets the horizontal alignment.

Italic

Gets whether the font is italic.

LeftBorder

Gets the left edge.

NumberFormat

Gets the number format code, or null for the general format.

RightBorder

Gets the right edge.

Strike

Gets whether the text is struck through.

TopBorder

Gets the top edge.

Underline

Gets whether the text is underlined.

VerticalAlignment

Gets the vertical alignment.

WrapText

Gets whether text wraps inside the cell.

Methods

Equals(XlsxCellStyle?)
Equals(object?)
GetHashCode()
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.