• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DomCR / ACadSharp / 25257777259

02 May 2026 05:35PM UTC coverage: 76.965% (-0.1%) from 77.076%
25257777259

push

github

web-flow
Merge pull request #1040 from DomCR/issue/1000_tableentity-DwgWriter

TableEntity dwg support

8557 of 12075 branches covered (70.87%)

Branch coverage included in aggregate %.

960 of 1507 new or added lines in 29 files covered. (63.7%)

38 existing lines in 5 files now uncovered.

30799 of 39060 relevant lines covered (78.85%)

152916.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/src/ACadSharp/Objects/TableStyle.CellStyle.cs
1
using ACadSharp.Attributes;
2

3
namespace ACadSharp.Objects;
4

5
public partial class TableStyle
6
{
7
        /// <summary>
8
        /// Represents the cell style of a table cell. Cell styles are defined at the table level and can be overridden at the cell level.
9
        /// </summary>
10
        /// <remarks>
11
        /// A <see cref="CellStyle"/> defines visual and layout properties such as colors, margins, borders, and text alignment
12
        /// for cells in a <see cref="TableStyle"/>. Default cell styles are provided for data, header, and title cells.
13
        /// </remarks>
14
        public class CellStyle : ContentFormat
15
        {
16
                /// <summary>
17
                /// Gets the default cell style used for data cells.
18
                /// </summary>
19
                public static CellStyle DefaultDataCellStyle
20
                {
21
                        get
22
                        {
2,479✔
23
                                var data = new CellStyle
2,479✔
24
                                {
2,479✔
25
                                        Name = DataCellStyleName,
2,479✔
26
                                        StyleClass = CellStyleClass.Label,
2,479✔
27
                                };
2,479✔
28

29
                                return data;
2,479✔
30
                        }
2,479✔
31
                }
32

33
                /// <summary>
34
                /// Gets the default cell style used for header cells.
35
                /// </summary>
36
                public static CellStyle DefaultHeaderCellStyle
37
                {
38
                        get
39
                        {
2,479✔
40
                                var data = new CellStyle
2,479✔
41
                                {
2,479✔
42
                                        Name = HeaderCellStyleName,
2,479✔
43
                                        StyleClass = CellStyleClass.Data,
2,479✔
44
                                };
2,479✔
45

46
                                return data;
2,479✔
47
                        }
2,479✔
48
                }
49

50
                /// <summary>
51
                /// Gets the default cell style used for title cells.
52
                /// </summary>
53
                public static CellStyle DefaultTitleCellStyle
54
                {
55
                        get
56
                        {
2,479✔
57
                                var data = new CellStyle
2,479✔
58
                                {
2,479✔
59
                                        Name = TitleCellStyleName,
2,479✔
60
                                        StyleClass = CellStyleClass.Data,
2,479✔
61
                                };
2,479✔
62

63
                                return data;
2,479✔
64
                        }
2,479✔
65
                }
66

67
                /// <summary>
68
                /// Gets or sets the background (fill) color of the cell content.
69
                /// Override applied at the cell level.
70
                /// </summary>
71
                [DxfCodeValue(63)]
72
                public Color BackgroundColor { get; set; }
4,457✔
73

74
                /// <summary>
75
                /// Gets or sets the bottom border style of the cell.
76
                /// </summary>
77
                public CellBorder BottomBorder { get; set; } = new(CellEdgeFlags.Bottom);
43,907✔
78

79
                /// <summary>
80
                /// Gets or sets the bottom margin of the cell.
81
                /// </summary>
82
                public double BottomMargin { get; set; }
4,412✔
83

84
                /// <summary>
85
                /// Gets or sets the alignment of the content within a cell.
86
                /// </summary>
87
                [DxfCodeValue(170)]
88
                public TableStyle.CellAlignmentType CellAlignment { get; set; }
9,685✔
89

90
                /// <summary>
91
                /// Gets or sets the color of cell content.
92
                /// Override applied at the cell level.
93
                /// </summary>
94
                [DxfCodeValue(64)]
95
                public Color ContentColor { get; internal set; }
284✔
96

97
                /// <summary>
98
                /// Gets or sets the layout flags that control how content is arranged within the cell.
99
                /// </summary>
100
                public CellContentLayoutFlags ContentLayoutFlags { get; set; }
2,856✔
101

102
                /// <summary>
103
                /// Gets or sets the horizontal inside border style of the cell.
104
                /// </summary>
105
                public CellBorder HorizontalInsideBorder { get; set; } = new(CellEdgeFlags.InsideHorizontal);
44,207✔
106

107
                /// <summary>
108
                /// Gets or sets the horizontal margin of the cell. Default is <c>0.06</c>.
109
                /// </summary>
110
                public double HorizontalMargin { get; set; } = 0.06d;
44,893✔
111

112
                /// <summary>
113
                /// Gets or sets a value indicating whether the fill color is enabled.
114
                /// Override applied at the cell level.
115
                /// </summary>
116
                [DxfCodeValue(283)]
117
                public bool IsFillColorOn { get; set; }
1,601✔
118

119
                /// <summary>
120
                /// Gets or sets the left border style of the cell.
121
                /// </summary>
122
                public CellBorder LeftBorder { get; set; } = new(CellEdgeFlags.Left);
47,735✔
123

124
                /// <summary>
125
                /// Gets or sets the horizontal spacing between cell margins.
126
                /// </summary>
127
                public double MarginHorizontalSpacing { get; set; }
4,412✔
128

129
                /// <summary>
130
                /// Gets or sets the flags that indicate which margin overrides are applied.
131
                /// </summary>
132
                [DxfCodeValue(171)]
133
                public MarginFlags MarginOverrideFlags { get; set; }
11,216✔
134

135
                /// <summary>
136
                /// Gets or sets the vertical spacing between cell margins.
137
                /// </summary>
138
                public double MarginVerticalSpacing { get; set; }
4,412✔
139

140
                /// <summary>
141
                /// Gets or sets the name of the cell style.
142
                /// </summary>
143
                [DxfCodeValue(300)]
144
                public string Name { get; set; }
12,330✔
145

146
                /// <summary>
147
                /// Gets or sets the right border style of the cell.
148
                /// </summary>
149
                public CellBorder RightBorder { get; set; } = new(CellEdgeFlags.Right);
45,743✔
150

151
                /// <summary>
152
                /// Gets or sets the right margin of the cell.
153
                /// </summary>
154
                public double RightMargin { get; set; }
4,412✔
155

156
                /// <summary>
157
                /// Gets or sets the class of the cell style, which categorizes the style type.
158
                /// </summary>
159
                [DxfCodeValue(91)]
160
                public CellStyleClass StyleClass { get; set; }
14,528✔
161

162
                /// <summary>
163
                /// Gets or sets the property flags that define which table cell style properties are applied.
164
                /// </summary>
165
                [DxfCodeValue(92)]
166
                public CellStylePropertyFlags TableCellStylePropertyFlags { get; set; }
8,360✔
167

168
                /// <summary>
169
                /// Gets or sets the text color of the cell content.
170
                /// </summary>
171
                [DxfCodeValue(62)]
172
                public Color TextColor { get; set; }
6,230✔
173

174
                /// <summary>
175
                /// Gets or sets the top border style of the cell.
176
                /// </summary>
177
                public CellBorder TopBorder { get; set; } = new(CellEdgeFlags.Right);
48,323✔
178

179
                /// <summary>
180
                /// Gets or sets the type of the cell style.
181
                /// </summary>
182
                [DxfCodeValue(90)]
183
                public CellStyleType Type { get; set; }
13,444✔
184

185
                /// <summary>
186
                /// Gets or sets the vertical inside border style of the cell.
187
                /// </summary>
188
                public CellBorder VerticalInsideBorder { get; set; } = new(CellEdgeFlags.InsideVertical);
44,447✔
189

190
                /// <summary>
191
                /// Gets or sets the vertical margin of the cell. Default is <c>0.06</c>.
192
                /// </summary>
193
                public double VerticalMargin { get; set; } = 0.06d;
44,893✔
194

195
                /// <summary>
196
                /// Gets or sets the internal identifier of the cell style.
197
                /// </summary>
198
                internal int Id { get; set; }
1,188✔
199

200
                /// <summary>
201
                /// The name constant for the default data cell style.
202
                /// </summary>
203
                public const string DataCellStyleName = "_DATA";
204

205
                /// <summary>
206
                /// The name constant for the default header cell style.
207
                /// </summary>
208
                public const string HeaderCellStyleName = "_HEADER";
209

210
                /// <summary>
211
                /// The name constant for the default title cell style.
212
                /// </summary>
213
                public const string TitleCellStyleName = "_TITLE";
214

215
                /// <inheritdoc/>
216
                public override string ToString()
NEW
217
                {
×
NEW
218
                        return $"{Id}|{Name}";
×
NEW
219
                }
×
220
        }
221
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc