示例#1
0
 public IBorderSpecification WithDiagonal(BorderStyle style, IBuilderSpecification <Color> colorSpecification, BorderDiagonal diagonal)
 {
     return(new BorderSpecification(this)
     {
         Diagonal = new Tuple <BorderStyle, IBuilderSpecification <Color>, BorderDiagonal>(style, colorSpecification, diagonal)
     });
 }
示例#2
0
 public ISpreadsheetWriter WithSheet(IBuilderSpecification <Sheet> specification)
 {
     return(new SpreadsheetWriter
     {
         WorkSheets = WorkSheets.Append(specification)
     });
 }
示例#3
0
        public IExpectCellFormat WithContent(DateTime value)
        {
            DefaultCellFormat = Specification.CellFormat()
                                .WithNumberFormat(Specification.NumberFormat().WithFormat(StandardNumberFormat.ShortDate));

            return(WithContent(value.ToOADate().ToString(CultureInfo.InvariantCulture), CellType.Date));
        }
示例#4
0
 public IBorderSpecification WithRight(BorderStyle style, IBuilderSpecification <Color> colorSpecification)
 {
     return(new BorderSpecification(this)
     {
         Right = new Tuple <BorderStyle, IBuilderSpecification <Color> >(style, colorSpecification)
     });
 }
示例#5
0
 private CellSpecification(CellSpecification cellSpecification)
 {
     Row               = cellSpecification.Row;
     Column            = cellSpecification.Column;
     CellType          = cellSpecification.CellType;
     Content           = cellSpecification.Content;
     CellFormat        = cellSpecification.CellFormat;
     DefaultCellFormat = cellSpecification.DefaultCellFormat;
 }
示例#6
0
        public IBuilderSpecification <Border> WithOutline(BorderStyle style, IBuilderSpecification <Color> colorSpecification)
        {
            var tuple = new Tuple <BorderStyle, IBuilderSpecification <Color> >(style, colorSpecification);

            return(new BorderSpecification(this)
            {
                Top = tuple,
                Bottom = tuple,
                Left = tuple,
                Right = tuple
            });
        }
示例#7
0
        private CellFormatSpecification(CellFormatSpecification specification)
        {
            if (specification == null)
            {
                throw new ArgumentNullException(nameof(specification));
            }

            AlignmentSpecification    = specification.AlignmentSpecification;
            BorderSpecification       = specification.BorderSpecification;
            FillSpecification         = specification.FillSpecification;
            FontSpecification         = specification.FontSpecification;
            NumberFormatSpecification = specification.NumberFormatSpecification;
        }
示例#8
0
 public IBuildingCellFormatSpecification WithBorder(IBuilderSpecification <Border> borderSpecification)
 => new CellFormatSpecification(this)
 {
     BorderSpecification = borderSpecification
 };
示例#9
0
 public IExpectFontOptions WithColor(IBuilderSpecification <Color> colorSpecification)
 => new FontSpecification(this)
 {
     ColorSpecification = colorSpecification
 };
示例#10
0
 public IFillSpecification WithForegroundColor(IBuilderSpecification <Color> colorSpecification)
 => new FillSpecification
 {
     PatternType = PatternType, BackgroundColor = BackgroundColor, ForegroundColor = colorSpecification
 };
示例#11
0
 public IBuildingCellFormatSpecification WithNumberFormat(IBuilderSpecification <NumberFormat> numberFormatSpecification)
 => new CellFormatSpecification(this)
 {
     NumberFormatSpecification = numberFormatSpecification
 };
示例#12
0
 public IBuildingCellFormatSpecification WithFont(IBuilderSpecification <Font> fontSpecification)
 => new CellFormatSpecification(this)
 {
     FontSpecification = fontSpecification
 };
示例#13
0
 public IBuildingCellFormatSpecification WithFill(IBuilderSpecification <Fill> fillSpecification)
 => new CellFormatSpecification(this)
 {
     FillSpecification = fillSpecification
 };
示例#14
0
 public IExpectCellRow WithStyle(IBuilderSpecification <CellFormat> formatSpecification)
 => new CellSpecification(this)
 {
     CellFormat = formatSpecification
 };
示例#15
0
 public IBuildingCellFormatSpecification WithAlignment(IBuilderSpecification <Alignment> alignmentSpecification)
 => new CellFormatSpecification(this)
 {
     AlignmentSpecification = alignmentSpecification
 };
示例#16
0
        public IExpectSheetContent WithMergedCell(IBuilderSpecification <MergeCell> specification)
        {
            var merge = mergeCellSpecifications.Append(specification);

            return(new SheetSpecification(name, columnSpecifications, rowSpecifications, merge));
        }
示例#17
0
        public IExpectSheetContent WithRow(IBuilderSpecification <Row> rowSpecification)
        {
            var rows = rowSpecifications.Append(rowSpecification);

            return(new SheetSpecification(name, columnSpecifications, rows, mergeCellSpecifications));
        }
示例#18
0
        public IExpectSheetContent WithColumn(IBuilderSpecification <Column> columnSpecification)
        {
            var cols = columnSpecifications.Append(columnSpecification);

            return(new SheetSpecification(name, cols, rowSpecifications, mergeCellSpecifications));
        }