From 5210adaf7e9c09a29732bd18d66a0264df350739 Mon Sep 17 00:00:00 2001 From: sveinungf Date: Sat, 3 Feb 2024 23:43:46 +0100 Subject: [PATCH] Add XML doc for public types and methods --- .../SourceGeneration/EmptyWorksheetRowContext.cs | 8 ++++++++ SpreadCheetah/Spreadsheet.cs | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/SpreadCheetah/SourceGeneration/EmptyWorksheetRowContext.cs b/SpreadCheetah/SourceGeneration/EmptyWorksheetRowContext.cs index ff64f9ee..b6e19bcd 100644 --- a/SpreadCheetah/SourceGeneration/EmptyWorksheetRowContext.cs +++ b/SpreadCheetah/SourceGeneration/EmptyWorksheetRowContext.cs @@ -6,8 +6,16 @@ namespace SpreadCheetah.SourceGeneration; +/// +/// Used by the SpreadCheetah source generator for types without valid publicly visible getters. +/// Should not be used directly. +/// public static class EmptyWorksheetRowContext { + /// + /// Creates metadata for a type without valid publicly visible getters. + /// Should not be used directly. + /// public static WorksheetRowTypeInfo CreateTypeInfo() => WorksheetRowMetadataServices.CreateObjectInfo(AddHeaderRowAsync, AddAsRowAsync, AddRangeAsRowsAsync); private static ValueTask AddHeaderRowAsync(Spreadsheet spreadsheet, StyleId? _, CancellationToken token) diff --git a/SpreadCheetah/Spreadsheet.cs b/SpreadCheetah/Spreadsheet.cs index 3d2a16fc..2ebfb1d0 100644 --- a/SpreadCheetah/Spreadsheet.cs +++ b/SpreadCheetah/Spreadsheet.cs @@ -320,6 +320,12 @@ public ValueTask AddRowAsync(IList cells, RowOptions? options, Cance : Worksheet.AddRowAsync(cells, options, token); } + /// + /// Add a row of header names in the active worksheet. + /// The header name in each cell will match the property name from the given type. + /// A style can optionally be applied to all the cells in the row. + /// The type must be generated by a source generator. + /// public ValueTask AddHeaderRowAsync(WorksheetRowTypeInfo typeInfo, StyleId? styleId = null, CancellationToken token = default) { ArgumentNullException.ThrowIfNull(typeInfo);