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

DomCR / ACadSharp / 17737836230

15 Sep 2025 03:12PM UTC coverage: 2.092% (-76.2%) from 78.245%
17737836230

push

github

web-flow
Merge pull request #790 from DomCR/addflag-refactor

addflag refactor

141 of 9225 branches covered (1.53%)

Branch coverage included in aggregate %.

0 of 93 new or added lines in 10 files covered. (0.0%)

24910 existing lines in 372 files now uncovered.

724 of 32119 relevant lines covered (2.25%)

5.76 hits per line

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

0.0
/src/ACadSharp/Classes/DxfClassCollection.cs
1
using System;
2
using System.Collections;
3
using System.Collections.Generic;
4
using System.Linq;
5

6
namespace ACadSharp.Classes
7
{
8
        public class DxfClassCollection : ICollection<DxfClass>
9
        {
10
                /// <inheritdoc/>
UNCOV
11
                public int Count { get { return this._entries.Count; } }
×
12

13
                /// <inheritdoc/>
14
                public bool IsReadOnly => false;
×
15

UNCOV
16
                public Dictionary<string, DxfClass> _entries = new Dictionary<string, DxfClass>(StringComparer.OrdinalIgnoreCase);
×
17

18
                /// <summary>
19
                /// Adds or updates the classes in a specific document
20
                /// </summary>
21
                /// <param name="doc"></param>
22
                public static void UpdateDxfClasses(CadDocument doc)
UNCOV
23
                {
×
24
                        //AcDbDictionaryWithDefault
UNCOV
25
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
26
                        {
×
UNCOV
27
                                CppClassName = DxfSubclassMarker.DictionaryWithDefault,
×
UNCOV
28
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
29
                                DwgVersion = (ACadVersion)22,
×
UNCOV
30
                                DxfName = DxfFileToken.ObjectDictionaryWithDefault,
×
UNCOV
31
                                ItemClassId = 499,
×
UNCOV
32
                                MaintenanceVersion = 42,
×
UNCOV
33
                                ProxyFlags = ProxyFlags.R13FormatProxy,
×
UNCOV
34
                                WasZombie = false,
×
UNCOV
35
                        });
×
36

37
                        //AcDbPlaceHolder
UNCOV
38
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
39
                        {
×
UNCOV
40
                                CppClassName = DxfSubclassMarker.AcDbPlaceHolder,
×
UNCOV
41
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
42
                                DwgVersion = (ACadVersion)0,
×
UNCOV
43
                                DxfName = DxfFileToken.ObjectPlaceholder,
×
UNCOV
44
                                ItemClassId = 499,
×
UNCOV
45
                                MaintenanceVersion = 0,
×
UNCOV
46
                                ProxyFlags = ProxyFlags.None,
×
UNCOV
47
                                WasZombie = false,
×
UNCOV
48
                        });
×
49

50
                        //AcDbLayout
UNCOV
51
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
52
                        {
×
UNCOV
53
                                CppClassName = DxfSubclassMarker.Layout,
×
UNCOV
54
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
55
                                DwgVersion = (ACadVersion)0,
×
UNCOV
56
                                DxfName = DxfFileToken.ObjectLayout,
×
UNCOV
57
                                ItemClassId = 499,
×
UNCOV
58
                                MaintenanceVersion = 0,
×
UNCOV
59
                                ProxyFlags = ProxyFlags.None,
×
UNCOV
60
                                WasZombie = false,
×
UNCOV
61
                        });
×
62

63
                        //AcDbDictionaryVar
UNCOV
64
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
65
                        {
×
UNCOV
66
                                CppClassName = DxfSubclassMarker.DictionaryVar,
×
UNCOV
67
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
68
                                DwgVersion = (ACadVersion)20,
×
UNCOV
69
                                DxfName = DxfFileToken.ObjectDictionaryVar,
×
UNCOV
70
                                ItemClassId = 499,
×
UNCOV
71
                                MaintenanceVersion = 0,
×
UNCOV
72
                                ProxyFlags = ProxyFlags.None,
×
UNCOV
73
                                WasZombie = false,
×
UNCOV
74
                        });
×
75

76
                        //AcDbTableStyle
UNCOV
77
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
78
                        {
×
UNCOV
79
                                CppClassName = DxfSubclassMarker.TableStyle,
×
UNCOV
80
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
81
                                DwgVersion = ACadVersion.AC1018,
×
UNCOV
82
                                DxfName = DxfFileToken.ObjectTableStyle,
×
UNCOV
83
                                ItemClassId = 499,
×
UNCOV
84
                                MaintenanceVersion = 0,
×
UNCOV
85
                                ProxyFlags = (ProxyFlags)4095,
×
UNCOV
86
                                WasZombie = false,
×
UNCOV
87
                        });
×
88

89
                        //AcDbMaterial
UNCOV
90
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
91
                        {
×
UNCOV
92
                                CppClassName = DxfSubclassMarker.Material,
×
UNCOV
93
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
94
                                DwgVersion = 0,
×
UNCOV
95
                                DxfName = DxfFileToken.ObjectMaterial,
×
UNCOV
96
                                ItemClassId = 499,
×
UNCOV
97
                                MaintenanceVersion = 0,
×
UNCOV
98
                                ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
99
                                WasZombie = false,
×
UNCOV
100
                        });
×
101

102
                        //AcDbVisualStyle
UNCOV
103
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
104
                        {
×
UNCOV
105
                                CppClassName = DxfSubclassMarker.VisualStyle,
×
UNCOV
106
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
107
                                DwgVersion = ACadVersion.AC1021,
×
UNCOV
108
                                DxfName = DxfFileToken.ObjectVisualStyle,
×
UNCOV
109
                                ItemClassId = 499,
×
UNCOV
110
                                MaintenanceVersion = 0,
×
UNCOV
111
                                ProxyFlags = (ProxyFlags)4095,
×
UNCOV
112
                                WasZombie = false,
×
UNCOV
113
                        });
×
114

115
                        //AcDbScale
UNCOV
116
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
117
                        {
×
UNCOV
118
                                CppClassName = DxfSubclassMarker.Scale,
×
UNCOV
119
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
120
                                DwgVersion = ACadVersion.AC1021,
×
UNCOV
121
                                DxfName = DxfFileToken.ObjectScale,
×
UNCOV
122
                                ItemClassId = 499,
×
UNCOV
123
                                MaintenanceVersion = 1,
×
UNCOV
124
                                ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
125
                                WasZombie = false,
×
UNCOV
126
                        });
×
127

128
                        //AcDbMLeaderStyle
UNCOV
129
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
130
                        {
×
UNCOV
131
                                CppClassName = DxfSubclassMarker.MLeaderStyle,
×
UNCOV
132
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
133
                                DwgVersion = ACadVersion.AC1021,
×
UNCOV
134
                                DxfName = DxfFileToken.ObjectMLeaderStyle,
×
UNCOV
135
                                ItemClassId = 499,
×
UNCOV
136
                                MaintenanceVersion = 25,
×
UNCOV
137
                                ProxyFlags = (ProxyFlags)4095,
×
UNCOV
138
                                WasZombie = false,
×
UNCOV
139
                        });
×
140

141
                        //AcDbCellStyleMap
UNCOV
142
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
143
                        {
×
UNCOV
144
                                CppClassName = DxfSubclassMarker.CellStyleMap,
×
UNCOV
145
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
146
                                DwgVersion = ACadVersion.AC1021,
×
UNCOV
147
                                DxfName = DxfFileToken.ObjectCellStyleMap,
×
UNCOV
148
                                ItemClassId = 499,
×
UNCOV
149
                                MaintenanceVersion = 25,
×
UNCOV
150
                                ProxyFlags = ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
151
                                WasZombie = false,
×
UNCOV
152
                        });
×
153

154
                        //ExAcXREFPanelObject
UNCOV
155
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
156
                        {
×
UNCOV
157
                                CppClassName = "ExAcXREFPanelObject",
×
UNCOV
158
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
159
                                DwgVersion = 0,
×
UNCOV
160
                                DxfName = "EXACXREFPANELOBJECT",
×
UNCOV
161
                                ItemClassId = 499,
×
UNCOV
162
                                MaintenanceVersion = 0,
×
UNCOV
163
                                ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
164
                                WasZombie = false,
×
UNCOV
165
                        });
×
166

167
                        //AcDbImpNonPersistentObjectsCollection
UNCOV
168
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
169
                        {
×
UNCOV
170
                                CppClassName = "AcDbImpNonPersistentObjectsCollection",
×
UNCOV
171
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
172
                                DwgVersion = 0,
×
UNCOV
173
                                DxfName = "NPOCOLLECTION",
×
UNCOV
174
                                ItemClassId = 499,
×
UNCOV
175
                                MaintenanceVersion = 0,
×
UNCOV
176
                                ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
177
                                WasZombie = false,
×
UNCOV
178
                        });
×
179

180
                        //AcDbLayerIndex
UNCOV
181
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
182
                        {
×
UNCOV
183
                                CppClassName = "AcDbLayerIndex",
×
UNCOV
184
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
185
                                DwgVersion = 0,
×
UNCOV
186
                                DxfName = "LAYER_INDEX",
×
UNCOV
187
                                ItemClassId = 499,
×
UNCOV
188
                                MaintenanceVersion = 0,
×
UNCOV
189
                                ProxyFlags = ProxyFlags.None,
×
UNCOV
190
                                WasZombie = false,
×
UNCOV
191
                        });
×
192

193
                        //AcDbSpatialIndex
UNCOV
194
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
195
                        {
×
UNCOV
196
                                CppClassName = "AcDbSpatialIndex",
×
UNCOV
197
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
198
                                DwgVersion = 0,
×
UNCOV
199
                                DxfName = "SPATIAL_INDEX",
×
UNCOV
200
                                ItemClassId = 499,
×
UNCOV
201
                                MaintenanceVersion = 0,
×
UNCOV
202
                                ProxyFlags = ProxyFlags.None,
×
UNCOV
203
                                WasZombie = false,
×
UNCOV
204
                        });
×
205

206
                        //AcDbIdBuffer
UNCOV
207
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
208
                        {
×
UNCOV
209
                                CppClassName = "AcDbIdBuffer",
×
UNCOV
210
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
211
                                DwgVersion = ACadVersion.AC1014,
×
UNCOV
212
                                DxfName = "IDBUFFER",
×
UNCOV
213
                                ItemClassId = 499,
×
UNCOV
214
                                MaintenanceVersion = 0,
×
UNCOV
215
                                ProxyFlags = ProxyFlags.R13FormatProxy,
×
UNCOV
216
                                WasZombie = false,
×
UNCOV
217
                        });
×
218

219
                        //AcDbSectionViewStyle
UNCOV
220
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
221
                        {
×
UNCOV
222
                                CppClassName = "AcDbSectionViewStyle",
×
UNCOV
223
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
224
                                DwgVersion = 0,
×
UNCOV
225
                                DxfName = "ACDBSECTIONVIEWSTYLE",
×
UNCOV
226
                                ItemClassId = 499,
×
UNCOV
227
                                MaintenanceVersion = 0,
×
UNCOV
228
                                ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
229
                                WasZombie = false,
×
UNCOV
230
                        });
×
231

232
                        //AcDbDetailViewStyle
UNCOV
233
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
234
                        {
×
UNCOV
235
                                CppClassName = "AcDbDetailViewStyle",
×
UNCOV
236
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
237
                                DwgVersion = 0,
×
UNCOV
238
                                DxfName = "ACDBDETAILVIEWSTYLE",
×
UNCOV
239
                                ItemClassId = 499,
×
UNCOV
240
                                MaintenanceVersion = 0,
×
UNCOV
241
                                ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
242
                                WasZombie = false,
×
UNCOV
243
                        });
×
244

245
                        //AcDbSubDMesh
UNCOV
246
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
247
                        {
×
UNCOV
248
                                CppClassName = DxfSubclassMarker.Mesh,
×
UNCOV
249
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
250
                                DwgVersion = 0,
×
UNCOV
251
                                DxfName = DxfFileToken.EntityMesh,
×
UNCOV
252
                                ItemClassId = 498,
×
UNCOV
253
                                MaintenanceVersion = 0,
×
UNCOV
254
                                ProxyFlags = ProxyFlags.None,
×
UNCOV
255
                                WasZombie = false,
×
UNCOV
256
                        });
×
257

258
                        //AcDbSortentsTable
UNCOV
259
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
260
                        {
×
UNCOV
261
                                CppClassName = DxfSubclassMarker.SortentsTable,
×
UNCOV
262
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
263
                                DwgVersion = ACadVersion.AC1014,
×
UNCOV
264
                                DxfName = DxfFileToken.ObjectSortEntsTable,
×
UNCOV
265
                                ItemClassId = 499,
×
UNCOV
266
                                MaintenanceVersion = 0,
×
UNCOV
267
                                ProxyFlags = ProxyFlags.None,
×
UNCOV
268
                                WasZombie = false,
×
UNCOV
269
                        });
×
270

271
                        //AcDbTextObjectContextData
UNCOV
272
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
273
                        {
×
UNCOV
274
                                CppClassName = "AcDbTextObjectContextData",
×
UNCOV
275
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
276
                                DwgVersion = 0,
×
UNCOV
277
                                DxfName = "ACDB_TEXTOBJECTCONTEXTDATA_CLASS",
×
UNCOV
278
                                ItemClassId = 499,
×
UNCOV
279
                                MaintenanceVersion = 0,
×
UNCOV
280
                                ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
281
                                WasZombie = false,
×
UNCOV
282
                        });
×
283

284
                        //AcDbWipeout
UNCOV
285
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
286
                        {
×
UNCOV
287
                                ApplicationName = "WipeOut",
×
UNCOV
288
                                CppClassName = DxfSubclassMarker.Wipeout,
×
UNCOV
289
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
290
                                DwgVersion = ACadVersion.AC1015,
×
UNCOV
291
                                DxfName = DxfFileToken.EntityWipeout,
×
UNCOV
292
                                ItemClassId = 498,
×
UNCOV
293
                                MaintenanceVersion = 0,
×
UNCOV
294
                                ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.TransformAllowed | ProxyFlags.ColorChangeAllowed | ProxyFlags.LayerChangeAllowed | ProxyFlags.LinetypeChangeAllowed | ProxyFlags.LinetypeScaleChangeAllowed | ProxyFlags.VisibilityChangeAllowed | ProxyFlags.R13FormatProxy,
×
UNCOV
295
                                WasZombie = false,
×
UNCOV
296
                        });
×
297

298
                        //AcDbWipeoutVariables
UNCOV
299
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
300
                        {
×
UNCOV
301
                                ApplicationName = "WipeOut",
×
UNCOV
302
                                CppClassName = "AcDbWipeoutVariables",
×
UNCOV
303
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
304
                                DwgVersion = ACadVersion.AC1015,
×
UNCOV
305
                                DxfName = "WIPEOUTVARIABLES",
×
UNCOV
306
                                ItemClassId = 499,
×
UNCOV
307
                                MaintenanceVersion = 0,
×
UNCOV
308
                                ProxyFlags = ProxyFlags.R13FormatProxy,
×
UNCOV
309
                                WasZombie = false,
×
UNCOV
310
                        });
×
311

312
                        //AcDbDimAssoc
UNCOV
313
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
314
                        {
×
UNCOV
315
                                ApplicationName = "AcDbDimAssoc",
×
UNCOV
316
                                CppClassName = "AcDbDimAssoc",
×
UNCOV
317
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
318
                                DwgVersion = 0,
×
UNCOV
319
                                DxfName = "DIMASSOC",
×
UNCOV
320
                                ItemClassId = 499,
×
UNCOV
321
                                MaintenanceVersion = 0,
×
UNCOV
322
                                ProxyFlags = ProxyFlags.None,
×
UNCOV
323
                                WasZombie = false,
×
UNCOV
324
                        });
×
325

326
                        //AcDbTable
UNCOV
327
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
328
                        {
×
UNCOV
329
                                CppClassName = DxfSubclassMarker.TableEntity,
×
UNCOV
330
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
331
                                DwgVersion = ACadVersion.AC1018,
×
UNCOV
332
                                DxfName = DxfFileToken.EntityTable,
×
UNCOV
333
                                ItemClassId = 498,
×
UNCOV
334
                                MaintenanceVersion = 0,
×
UNCOV
335
                                ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
336
                                WasZombie = false,
×
UNCOV
337
                        });
×
338

339
                        //AcDbTableContent
UNCOV
340
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
341
                        {
×
UNCOV
342
                                CppClassName = DxfSubclassMarker.TableContent,
×
UNCOV
343
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
344
                                DwgVersion = ACadVersion.AC1018,
×
UNCOV
345
                                DxfName = DxfFileToken.ObjectTableContent,
×
UNCOV
346
                                ItemClassId = 499,
×
UNCOV
347
                                MaintenanceVersion = 21,
×
UNCOV
348
                                ProxyFlags = ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
349
                                WasZombie = false,
×
UNCOV
350
                        });
×
351

352
                        //AcDbTableGeometry
UNCOV
353
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
354
                        {
×
UNCOV
355
                                CppClassName = "AcDbTableGeometry",
×
UNCOV
356
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
357
                                DwgVersion = 0,
×
UNCOV
358
                                DxfName = "TABLEGEOMETRY",
×
UNCOV
359
                                ItemClassId = 499,
×
UNCOV
360
                                MaintenanceVersion = 0,
×
UNCOV
361
                                ProxyFlags = ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
362
                                WasZombie = false,
×
UNCOV
363
                        });
×
364

365
                        //AcDbRasterImage
UNCOV
366
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
367
                        {
×
UNCOV
368
                                ApplicationName = "ISM",
×
UNCOV
369
                                CppClassName = DxfSubclassMarker.RasterImage,
×
UNCOV
370
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
371
                                DwgVersion = (ACadVersion)20,
×
UNCOV
372
                                DxfName = DxfFileToken.EntityImage,
×
UNCOV
373
                                ItemClassId = 498,
×
UNCOV
374
                                MaintenanceVersion = 0,
×
UNCOV
375
                                ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.TransformAllowed | ProxyFlags.ColorChangeAllowed | ProxyFlags.LayerChangeAllowed | ProxyFlags.LinetypeChangeAllowed | ProxyFlags.LinetypeScaleChangeAllowed | ProxyFlags.VisibilityChangeAllowed | ProxyFlags.R13FormatProxy,
×
UNCOV
376
                                WasZombie = false,
×
UNCOV
377
                        });
×
378

379
                        //AcDbRasterImageDef
UNCOV
380
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
381
                        {
×
UNCOV
382
                                ApplicationName = "ISM",
×
UNCOV
383
                                CppClassName = DxfSubclassMarker.RasterImageDef,
×
UNCOV
384
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
385
                                DwgVersion = (ACadVersion)20,
×
UNCOV
386
                                DxfName = DxfFileToken.ObjectImageDefinition,
×
UNCOV
387
                                ItemClassId = 499,
×
UNCOV
388
                                MaintenanceVersion = 0,
×
UNCOV
389
                                ProxyFlags = ProxyFlags.None,
×
UNCOV
390
                                WasZombie = false,
×
UNCOV
391
                        });
×
392

393
                        //AcDbColor
UNCOV
394
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
395
                        {
×
UNCOV
396
                                CppClassName = DxfSubclassMarker.DbColor,
×
UNCOV
397
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
398
                                DwgVersion = ACadVersion.AC1015,
×
UNCOV
399
                                DxfName = DxfFileToken.ObjectDBColor,
×
UNCOV
400
                                ItemClassId = 499,
×
UNCOV
401
                                MaintenanceVersion = 14,
×
UNCOV
402
                                ProxyFlags = ProxyFlags.None,
×
UNCOV
403
                                WasZombie = false,
×
UNCOV
404
                        });
×
405

406
                        //AcDbGeoData
UNCOV
407
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
408
                        {
×
UNCOV
409
                                CppClassName = DxfSubclassMarker.GeoData,
×
UNCOV
410
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
411
                                DwgVersion = ACadVersion.AC1021,
×
UNCOV
412
                                DxfName = DxfFileToken.ObjectGeoData,
×
UNCOV
413
                                ItemClassId = 499,
×
UNCOV
414
                                MaintenanceVersion = 45,
×
UNCOV
415
                                ProxyFlags = (ProxyFlags)4095,
×
UNCOV
416
                                WasZombie = false,
×
UNCOV
417
                        });
×
418

419
                        //AcDbMLeader
UNCOV
420
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
421
                        {
×
UNCOV
422
                                CppClassName = DxfSubclassMarker.MultiLeader,
×
UNCOV
423
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
424
                                DwgVersion = ACadVersion.MC0_0,
×
UNCOV
425
                                DxfName = DxfFileToken.EntityMultiLeader,
×
UNCOV
426
                                ItemClassId = 499,
×
UNCOV
427
                                MaintenanceVersion = 0,
×
UNCOV
428
                                ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
429
                                WasZombie = false,
×
UNCOV
430
                        });
×
431

432
                        //AcDbPdfReference
UNCOV
433
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
434
                        {
×
UNCOV
435
                                CppClassName = DxfSubclassMarker.PdfReference,
×
UNCOV
436
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
437
                                DwgVersion = (ACadVersion)26,
×
UNCOV
438
                                DxfName = DxfFileToken.EntityPdfUnderlay,
×
UNCOV
439
                                ItemClassId = 498,
×
UNCOV
440
                                MaintenanceVersion = 0,
×
UNCOV
441
                                ProxyFlags = (ProxyFlags)4095,
×
UNCOV
442
                                WasZombie = false,
×
UNCOV
443
                        });
×
444

445
                        //AcDbPdfDefinition
UNCOV
446
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
447
                        {
×
UNCOV
448
                                CppClassName = DxfSubclassMarker.PdfDefinition,
×
UNCOV
449
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
450
                                DwgVersion = (ACadVersion)26,
×
UNCOV
451
                                DxfName = DxfFileToken.ObjectPdfDefinition,
×
UNCOV
452
                                ItemClassId = 499,
×
UNCOV
453
                                MaintenanceVersion = 0,
×
UNCOV
454
                                ProxyFlags = ProxyFlags.EraseAllowed | ProxyFlags.CloningAllowed | ProxyFlags.DisablesProxyWarningDialog,
×
UNCOV
455
                                WasZombie = false,
×
UNCOV
456
                        });
×
457

458
                        //AcDbRasterVariables
UNCOV
459
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
460
                        {
×
UNCOV
461
                                ApplicationName = "ISM",
×
UNCOV
462
                                CppClassName = DxfSubclassMarker.RasterVariables,
×
UNCOV
463
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
464
                                DwgVersion = (ACadVersion)20,
×
UNCOV
465
                                DxfName = DxfFileToken.ObjectRasterVariables,
×
UNCOV
466
                                ItemClassId = 499,
×
UNCOV
467
                                MaintenanceVersion = 0,
×
UNCOV
468
                                ProxyFlags = ProxyFlags.None,
×
UNCOV
469
                                WasZombie = false,
×
UNCOV
470
                        });
×
471

472
                        //AcDbSpatialFilter
UNCOV
473
                        doc.Classes.AddOrUpdate(new DxfClass
×
UNCOV
474
                        {
×
UNCOV
475
                                CppClassName = DxfSubclassMarker.SpatialFilter,
×
UNCOV
476
                                ClassNumber = (short)(500 + doc.Classes.Count),
×
UNCOV
477
                                DwgVersion = (ACadVersion)20,
×
UNCOV
478
                                DxfName = DxfFileToken.ObjectSpatialFilter,
×
UNCOV
479
                                ItemClassId = 499,
×
UNCOV
480
                                MaintenanceVersion = 0,
×
UNCOV
481
                                ProxyFlags = ProxyFlags.None,
×
UNCOV
482
                                WasZombie = false,
×
UNCOV
483
                                IsAnEntity = false,
×
UNCOV
484
                        });
×
UNCOV
485
                }
×
486

487
                /// <summary>
488
                /// Add a dxf class to the collection if the <see cref="DxfClass.DxfName"/> is not present
489
                /// </summary>
490
                /// <param name="item"></param>
491
                public void Add(DxfClass item)
492
                {
×
493
                        this._entries.Add(item.DxfName, item);
×
494
                }
×
495

496
                /// <summary>
497
                /// Add a dxf class to the collection or updates the existing one if the <see cref="DxfClass.DxfName"/> is already in the collection
498
                /// </summary>
499
                /// <param name="item"></param>
500
                public void AddOrUpdate(DxfClass item)
UNCOV
501
                {
×
UNCOV
502
                        if (this._entries.TryGetValue(item.DxfName, out DxfClass result))
×
UNCOV
503
                        {
×
UNCOV
504
                                result.InstanceCount = item.InstanceCount;
×
UNCOV
505
                        }
×
506
                        else
UNCOV
507
                        {
×
UNCOV
508
                                this._entries.Add(item.DxfName, item);
×
UNCOV
509
                        }
×
UNCOV
510
                }
×
511

512
                /// <inheritdoc/>
513
                public void Clear()
UNCOV
514
                {
×
UNCOV
515
                        _entries.Clear();
×
UNCOV
516
                }
×
517

518
                /// <summary>
519
                /// Determines whether the Collection contains a specific <see cref="DxfClass.DxfName"/>.
520
                /// </summary>
521
                /// <param name="dxfname"></param>
522
                /// <returns></returns>
523
                public bool Contains(string dxfname)
524
                {
×
525
                        return this._entries.ContainsKey(dxfname);
×
526
                }
×
527

528
                /// <inheritdoc/>
529
                public bool Contains(DxfClass item)
530
                {
×
531
                        return _entries.Values.Contains(item);
×
532
                }
×
533

534
                /// <inheritdoc/>
535
                public void CopyTo(DxfClass[] array, int arrayIndex)
536
                {
×
537
                        this._entries.Values.CopyTo(array, arrayIndex);
×
538
                }
×
539

540
                /// <summary>
541
                /// Gets the dxf class associated with <see cref="DxfClass.ClassNumber"/>.
542
                /// </summary>
543
                /// <param name="id"></param>
544
                /// <returns></returns>
545
                public DxfClass GetByClassNumber(short id)
546
                {
×
547
                        return this._entries.Values.FirstOrDefault(c => c.ClassNumber == id);
×
548
                }
×
549

550
                /// <summary>
551
                /// Gets the dxf class associated with <see cref="DxfClass.DxfName"/>.
552
                /// </summary>
553
                /// <param name="dxfname"></param>
554
                /// <returns></returns>
555
                public DxfClass GetByName(string dxfname)
556
                {
×
557
                        if (this._entries.TryGetValue(dxfname, out DxfClass result))
×
558
                        {
×
559
                                return result;
×
560
                        }
561
                        else
562
                        {
×
563
                                return null;
×
564
                        }
565
                }
×
566

567
                /// <inheritdoc/>
568
                public IEnumerator<DxfClass> GetEnumerator()
UNCOV
569
                {
×
UNCOV
570
                        return _entries.Values.GetEnumerator();
×
UNCOV
571
                }
×
572

573
                /// <inheritdoc/>
574
                IEnumerator IEnumerable.GetEnumerator()
575
                {
×
576
                        return this._entries.Values.GetEnumerator();
×
577
                }
×
578

579
                /// <inheritdoc/>
580
                public bool Remove(DxfClass item)
581
                {
×
582
                        return this._entries.Remove(item.DxfName);
×
583
                }
×
584

585
                /// <summary>
586
                /// Gets the dxf class associated with <see cref="DxfClass.ClassNumber"/>.
587
                /// </summary>
588
                /// <param name="id"></param>
589
                /// <param name="result"></param>
590
                /// <returns></returns>
591
                public bool TryGetByClassNumber(short id, out DxfClass result)
592
                {
×
593
                        result = this._entries.Values.FirstOrDefault(c => c.ClassNumber == id);
×
594
                        return result != null;
×
595
                }
×
596

597
                /// <summary>
598
                /// Gets the dxf class associated with <see cref="DxfClass.DxfName"/>.
599
                /// </summary>
600
                /// <param name="dxfname"></param>
601
                /// <param name="result"></param>
602
                /// <returns>true if the Collection contains an element with the specified key; otherwise, false.</returns>
603
                public bool TryGetByName(string dxfname, out DxfClass result)
UNCOV
604
                {
×
UNCOV
605
                        return this._entries.TryGetValue(dxfname, out result);
×
UNCOV
606
                }
×
607
        }
608
}
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

© 2025 Coveralls, Inc