private BorderSpecification(BorderSpecification specification) { if (specification == null) { throw new ArgumentNullException(nameof(specification)); } Top = specification.Top; Bottom = specification.Bottom; Left = specification.Left; Right = specification.Right; Diagonal = specification.Diagonal; }
public CellFormat Build(IBuildContext context) { var font = FontSpecification?.Build(context); var fill = FillSpecification?.Build(context); var border = BorderSpecification?.Build(context); var numberFormat = NumberFormatSpecification?.Build(context); var alignment = AlignmentSpecification?.Build(context); return(new CellFormat( fontId: font == null ? (uint?)null : context.Stylesheet.Add(font), fillId: fill == null ? (uint?)null : context.Stylesheet.Add(fill), borderId: border == null ? (uint?)null : context.Stylesheet.Add(border), numberFormatId: numberFormat?.Id, alignment: alignment)); }