feat(ExcelIO): add ColumnDefinition for fluent mapping
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
namespace JdeScoping.ExcelIO.Mapping;
|
||||
|
||||
/// <summary>
|
||||
/// Defines how a property maps to an Excel column.
|
||||
/// </summary>
|
||||
public sealed class ColumnDefinition
|
||||
{
|
||||
/// <summary>Property name for debugging/error messages.</summary>
|
||||
public required string PropertyName { get; init; }
|
||||
|
||||
/// <summary>Compiled delegate to get property value from object.</summary>
|
||||
public required Func<object, object?> ValueGetter { get; init; }
|
||||
|
||||
/// <summary>Property type for formatting decisions.</summary>
|
||||
public required Type PropertyType { get; init; }
|
||||
|
||||
/// <summary>Column display order (lower = leftmost).</summary>
|
||||
public int Order { get; set; }
|
||||
|
||||
/// <summary>Column header text.</summary>
|
||||
public string HeaderText { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>Excel number format string.</summary>
|
||||
public string Format { get; set; } = "@";
|
||||
|
||||
/// <summary>Auto-size column width.</summary>
|
||||
public bool AutoWidth { get; set; } = true;
|
||||
|
||||
/// <summary>Manual column width (when AutoWidth = false).</summary>
|
||||
public double Width { get; set; }
|
||||
|
||||
/// <summary>Enable text wrapping.</summary>
|
||||
public bool WrapText { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user