diff --git a/QWERTYkez.WordProcessor/Builders/CellProps.cs b/QWERTYkez.WordProcessor/Builders/CellProps.cs index 4da50ba..a0e52ea 100644 --- a/QWERTYkez.WordProcessor/Builders/CellProps.cs +++ b/QWERTYkez.WordProcessor/Builders/CellProps.cs @@ -3,7 +3,7 @@ public readonly struct CellProps(double? width = null!) { public double? Width { get; init; } = width; - public TableVerticalAlignmentValues? VerticalAlignment { get; init; } = default; + public VerticalAlignments? VerticalAlignment { get; init; } = default; public MergedCell? Merge { get; init; } = default; public TextDirection TextDirection { get; init; } = TextDirection.LeftToRight; @@ -24,7 +24,16 @@ public readonly struct CellProps(double? width = null!) { list = [ - new TableCellVerticalAlignment() { Val = VerticalAlignment ?? TableVerticalAlignmentValues.Center }, + new TableCellVerticalAlignment() + { + Val = (VerticalAlignment ?? VerticalAlignments.Center) switch + { + VerticalAlignments.Top => TableVerticalAlignmentValues.Top, + VerticalAlignments.Center => TableVerticalAlignmentValues.Center, + VerticalAlignments.Bottom => TableVerticalAlignmentValues.Bottom, + _ => throw new NotImplementedException(), + } + }, new TableCellMargin() { TopMargin = new TopMargin() { Width = "0" }, @@ -110,4 +119,6 @@ public enum TextDirection BottomToTop, /// ⇓ ⇓ ⇓ Сверху вниз TopToBottom, -} \ No newline at end of file +} + +public enum VerticalAlignments { Top, Center, Bottom } \ No newline at end of file