Skip to content

Commit

Permalink
Add XML doc for public types and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinungf committed Feb 3, 2024
1 parent 79db1b2 commit 5210ada
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions SpreadCheetah/SourceGeneration/EmptyWorksheetRowContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@

namespace SpreadCheetah.SourceGeneration;

/// <summary>
/// Used by the SpreadCheetah source generator for types without valid publicly visible getters.
/// Should not be used directly.
/// </summary>
public static class EmptyWorksheetRowContext
{
/// <summary>
/// Creates metadata for a type without valid publicly visible getters.
/// Should not be used directly.
/// </summary>
public static WorksheetRowTypeInfo<T> CreateTypeInfo<T>() => WorksheetRowMetadataServices.CreateObjectInfo<T>(AddHeaderRowAsync, AddAsRowAsync, AddRangeAsRowsAsync);

private static ValueTask AddHeaderRowAsync(Spreadsheet spreadsheet, StyleId? _, CancellationToken token)
Expand Down
6 changes: 6 additions & 0 deletions SpreadCheetah/Spreadsheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ public ValueTask AddRowAsync(IList<StyledCell> cells, RowOptions? options, Cance
: Worksheet.AddRowAsync(cells, options, token);
}

/// <summary>
/// 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 <see cref="WorksheetRowTypeInfo{T}"/> type must be generated by a source generator.
/// </summary>
public ValueTask AddHeaderRowAsync<T>(WorksheetRowTypeInfo<T> typeInfo, StyleId? styleId = null, CancellationToken token = default)
{
ArgumentNullException.ThrowIfNull(typeInfo);
Expand Down

0 comments on commit 5210ada

Please sign in to comment.