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

DomCR / ACadSharp / 26020083793

18 May 2026 07:38AM UTC coverage: 76.862% (+0.01%) from 76.848%
26020083793

push

github

DomCR
Merge branch 'master' of https://github.com/DomCR/ACadSharp

8608 of 12139 branches covered (70.91%)

Branch coverage included in aggregate %.

20 of 27 new or added lines in 3 files covered. (74.07%)

8 existing lines in 3 files now uncovered.

30896 of 39257 relevant lines covered (78.7%)

157679.84 hits per line

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

95.52
/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,584✔
23
                                var data = new CellStyle
2,584✔
24
                                {
2,584✔
25
                                        Name = DataCellStyleName,
2,584✔
26
                                        StyleClass = CellStyleClass.Label,
2,584✔
27
                                        Id = 3,
2,584✔
28
                                        HasData = true,
2,584✔
29
                                };
2,584✔
30

31
                                return data;
2,584✔
32
                        }
2,584✔
33
                }
34

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

50
                                return data;
2,584✔
51
                        }
2,584✔
52
                }
53

54
                /// <summary>
55
                /// Gets the default cell style used for title cells.
56
                /// </summary>
57
                public static CellStyle DefaultTitleCellStyle
58
                {
59
                        get
60
                        {
2,584✔
61
                                var data = new CellStyle
2,584✔
62
                                {
2,584✔
63
                                        Name = TitleCellStyleName,
2,584✔
64
                                        StyleClass = CellStyleClass.Data,
2,584✔
65
                                        Id = 1,
2,584✔
66
                                        HasData = true,
2,584✔
67
                                };
2,584✔
68

69
                                return data;
2,584✔
70
                        }
2,584✔
71
                }
72

73
                /// <summary>
74
                /// Gets the default cell style used as the table's overall ("Table") style.
75
                /// </summary>
76
                public static CellStyle DefaultTableCellStyle
77
                {
78
                        get
79
                        {
2,584✔
80
                                var data = new CellStyle
2,584✔
81
                                {
2,584✔
82
                                        Name = TableCellStyleName,
2,584✔
83
                                        StyleClass = CellStyleClass.Label,
2,584✔
84
                                        Id = 4,
2,584✔
85
                                        HasData = true,
2,584✔
86
                                };
2,584✔
87

88
                                return data;
2,584✔
89
                        }
2,584✔
90
                }
91

92
                /// <summary>
93
                /// The name constant for the default table-level cell style.
94
                /// </summary>
95
                public const string TableCellStyleName = "Table";
96

97
                /// <summary>
98
                /// Gets or sets the background (fill) color of the cell content.
99
                /// Override applied at the cell level.
100
                /// </summary>
101
                [DxfCodeValue(63)]
102
                public Color BackgroundColor { get; set; }
5,610✔
103

104
                /// <summary>
105
                /// Gets or sets the bottom border style of the cell.
106
                /// </summary>
107
                public CellBorder BottomBorder { get; set; } = new(CellEdgeFlags.Bottom);
48,075✔
108

109
                /// <summary>
110
                /// Gets or sets the bottom margin of the cell.
111
                /// </summary>
112
                public double BottomMargin { get; set; }
4,666✔
113

114
                /// <summary>
115
                /// Gets or sets the alignment of the content within a cell.
116
                /// </summary>
117
                [DxfCodeValue(170)]
118
                public TableStyle.CellAlignmentType CellAlignment { get; set; }
10,265✔
119

120
                /// <summary>
121
                /// Gets or sets the color of cell content.
122
                /// Override applied at the cell level.
123
                /// </summary>
124
                [DxfCodeValue(64)]
125
                public Color ContentColor { get; internal set; }
300✔
126

127
                /// <summary>
128
                /// Gets or sets the layout flags that control how content is arranged within the cell.
129
                /// </summary>
130
                public CellContentLayoutFlags ContentLayoutFlags { get; set; }
3,933✔
131

132
                /// <summary>
133
                /// Gets or sets the horizontal inside border style of the cell.
134
                /// </summary>
135
                public CellBorder HorizontalInsideBorder { get; set; } = new(CellEdgeFlags.InsideHorizontal);
48,390✔
136

137
                /// <summary>
138
                /// Gets or sets the horizontal margin of the cell. Default is <c>0.06</c>.
139
                /// </summary>
140
                public double HorizontalMargin { get; set; } = 0.06d;
47,314✔
141

142
                /// <summary>
143
                /// Gets or sets a value indicating whether the fill color is enabled.
144
                /// Override applied at the cell level.
145
                /// </summary>
146
                [DxfCodeValue(283)]
147
                public bool IsFillColorOn { get; set; }
1,677✔
148

149
                /// <summary>
150
                /// Gets or sets the left border style of the cell.
151
                /// </summary>
152
                public CellBorder LeftBorder { get; set; } = new(CellEdgeFlags.Left);
52,116✔
153

154
                /// <summary>
155
                /// Gets or sets the horizontal spacing between cell margins.
156
                /// </summary>
157
                public double MarginHorizontalSpacing { get; set; }
4,666✔
158

159
                /// <summary>
160
                /// Gets or sets the flags that indicate which margin overrides are applied.
161
                /// </summary>
162
                [DxfCodeValue(171)]
163
                public MarginFlags MarginOverrideFlags { get; set; }
13,714✔
164

165
                /// <summary>
166
                /// Gets or sets the vertical spacing between cell margins.
167
                /// </summary>
168
                public double MarginVerticalSpacing { get; set; }
4,666✔
169

170
                /// <summary>
171
                /// Gets or sets the name of the cell style.
172
                /// </summary>
173
                [DxfCodeValue(300)]
174
                public string Name { get; set; }
15,457✔
175

176
                /// <summary>
177
                /// Gets or sets the right border style of the cell.
178
                /// </summary>
179
                public CellBorder RightBorder { get; set; } = new(CellEdgeFlags.Right);
50,010✔
180

181
                /// <summary>
182
                /// Gets or sets the right margin of the cell.
183
                /// </summary>
184
                public double RightMargin { get; set; }
4,666✔
185

186
                /// <summary>
187
                /// Gets or sets the class of the cell style, which categorizes the style type.
188
                /// </summary>
189
                [DxfCodeValue(91)]
190
                public CellStyleClass StyleClass { get; set; }
17,831✔
191

192
                /// <summary>
193
                /// Gets or sets the property flags that define which table cell style properties are applied.
194
                /// </summary>
195
                [DxfCodeValue(92)]
196
                public CellStylePropertyFlags TableCellStylePropertyFlags { get; set; }
9,781✔
197

198
                /// <summary>
199
                /// Gets or sets the text color of the cell content.
200
                /// </summary>
201
                [DxfCodeValue(62)]
202
                public Color TextColor { get; set; }
6,598✔
203

204
                /// <summary>
205
                /// Gets or sets the top border style of the cell.
206
                /// </summary>
207
                public CellBorder TopBorder { get; set; } = new(CellEdgeFlags.Right);
52,737✔
208

209
                /// <summary>
210
                /// Gets or sets the type of the cell style.
211
                /// </summary>
212
                [DxfCodeValue(90)]
213
                public CellStyleType Type { get; set; }
14,198✔
214

215
                /// <summary>
216
                /// Gets or sets the vertical inside border style of the cell.
217
                /// </summary>
218
                public CellBorder VerticalInsideBorder { get; set; } = new(CellEdgeFlags.InsideVertical);
48,642✔
219

220
                /// <summary>
221
                /// Gets or sets the vertical margin of the cell. Default is <c>0.06</c>.
222
                /// </summary>
223
                public double VerticalMargin { get; set; } = 0.06d;
47,314✔
224

225
                /// <summary>
226
                /// Gets or sets the internal identifier of the cell style.
227
                /// </summary>
228
                internal int Id { get; set; }
11,560✔
229

230
                /// <summary>
231
                /// The name constant for the default data cell style.
232
                /// </summary>
233
                public const string DataCellStyleName = "_DATA";
234

235
                /// <summary>
236
                /// The name constant for the default header cell style.
237
                /// </summary>
238
                public const string HeaderCellStyleName = "_HEADER";
239

240
                /// <summary>
241
                /// The name constant for the default title cell style.
242
                /// </summary>
243
                public const string TitleCellStyleName = "_TITLE";
244

245
                /// <inheritdoc/>
246
                public override string ToString()
UNCOV
247
                {
×
UNCOV
248
                        return $"{Id}|{Name}";
×
UNCOV
249
                }
×
250
        }
251
}
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