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

DomCR / ACadSharp / 23436071134

23 Mar 2026 11:55AM UTC coverage: 76.778% (+0.2%) from 76.575%
23436071134

Pull #1005

github

web-flow
Merge 7c6f7e993 into b11db589e
Pull Request #1005: Issue-999 remove cellvalue

8366 of 11838 branches covered (70.67%)

Branch coverage included in aggregate %.

133 of 161 new or added lines in 12 files covered. (82.61%)

4 existing lines in 2 files now uncovered.

30099 of 38261 relevant lines covered (78.67%)

149528.24 hits per line

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

82.73
/src/ACadSharp/IO/DXF/DxfStreamReader/DxfObjectsSectionReader.cs
1
using ACadSharp.Classes;
2
using ACadSharp.Entities;
3
using ACadSharp.IO.Templates;
4
using ACadSharp.Objects;
5
using ACadSharp.Objects.Evaluations;
6
using CSMath;
7
using System;
8
using System.Collections.Generic;
9
using System.Diagnostics;
10
using System.IO;
11
using System.Linq;
12
using static ACadSharp.IO.Templates.CadEvaluationGraphTemplate;
13
using static ACadSharp.IO.Templates.CadTableEntityTemplate;
14

15
namespace ACadSharp.IO.DXF
16
{
17
        internal class DxfObjectsSectionReader : DxfSectionReaderBase
18
        {
19
                public delegate bool ReadObjectDelegate<T>(CadTemplate template, DxfMap map) where T : CadObject;
20

21
                public DxfObjectsSectionReader(IDxfStreamReader reader, DxfDocumentBuilder builder)
22
                        : base(reader, builder)
209✔
23
                {
209✔
24
                }
209✔
25

26
                public override void Read()
27
                {
209✔
28
                        //Advance to the first value in the section
29
                        this._reader.ReadNext();
209✔
30

31
                        //Loop until the section ends
32
                        while (this._reader.ValueAsString != DxfFileToken.EndSection)
77,599✔
33
                        {
77,390✔
34
                                CadTemplate template = null;
77,390✔
35

36
                                try
37
                                {
77,390✔
38
                                        template = this.readObject();
77,390✔
39
                                }
77,390✔
40
                                catch (Exception ex)
×
41
                                {
×
42
                                        if (!this._builder.Configuration.Failsafe)
×
43
                                                throw;
×
44

45
                                        this._builder.Notify($"Error while reading an object at line {this._reader.Position}", NotificationType.Error, ex);
×
46

47
                                        while (this._reader.DxfCode != DxfCode.Start)
×
48
                                                this._reader.ReadNext();
×
49
                                }
×
50

51
                                if (template == null)
77,390✔
52
                                        continue;
×
53

54
                                //Add the object and the template to the builder
55
                                this._builder.AddTemplate(template);
77,390✔
56
                        }
77,390✔
57
                }
209✔
58

59
                private CadTemplate readObject()
60
                {
77,390✔
61
                        this.currentSubclass = string.Empty;
77,390✔
62
                        switch (this._reader.ValueAsString)
77,390!
63
                        {
64
                                case DxfFileToken.BlkRefObjectContextData:
65
                                        return this.readObjectCodes<BlockReferenceObjectContextData>(new CadAnnotScaleObjectContextDataTemplate(new BlockReferenceObjectContextData()), this.readAnnotScaleObjectContextData);
×
66
                                case DxfFileToken.MTextAttributeObjectContextData:
67
                                        return this.readObjectCodes<MTextAttributeObjectContextData>(new CadAnnotScaleObjectContextDataTemplate(new MTextAttributeObjectContextData()), this.readAnnotScaleObjectContextData);
×
68
                                case DxfFileToken.ObjectPlaceholder:
69
                                        return this.readObjectCodes<AcdbPlaceHolder>(new CadNonGraphicalObjectTemplate(new AcdbPlaceHolder()), this.readObjectSubclassMap);
197✔
70
                                case DxfFileToken.ObjectDBColor:
71
                                        return this.readObjectCodes<BookColor>(new CadNonGraphicalObjectTemplate(new BookColor()), this.readBookColor);
192✔
72
                                case DxfFileToken.ObjectDimensionAssociation:
73
                                        return this.readObjectCodes<DimensionAssociation>(new CadDimensionAssociationTemplate(), this.readDimensionAssociation);
576✔
74
                                case DxfFileToken.ObjectDictionary:
75
                                        return this.readObjectCodes<CadDictionary>(new CadDictionaryTemplate(), this.readDictionary);
21,325✔
76
                                case DxfFileToken.ObjectDictionaryWithDefault:
77
                                        return this.readObjectCodes<CadDictionaryWithDefault>(new CadDictionaryWithDefaultTemplate(), this.readDictionaryWithDefault);
197✔
78
                                case DxfFileToken.ObjectLayout:
79
                                        return this.readObjectCodes<Layout>(new CadLayoutTemplate(), this.readLayout);
807✔
80
                                case DxfFileToken.ObjectPlotSettings:
81
                                        return this.readObjectCodes<PlotSettings>(new CadNonGraphicalObjectTemplate(new PlotSettings()), this.readPlotSettings);
×
82
                                case DxfFileToken.ObjectEvalGraph:
83
                                        return this.readObjectCodes<EvaluationGraph>(new CadEvaluationGraphTemplate(), this.readEvaluationGraph);
451✔
84
                                case DxfFileToken.ObjectImageDefinition:
85
                                        return this.readObjectCodes<ImageDefinition>(new CadNonGraphicalObjectTemplate(new ImageDefinition()), this.readObjectSubclassMap);
192✔
86
                                case DxfFileToken.ObjectDictionaryVar:
87
                                        return this.readObjectCodes<DictionaryVariable>(new CadTemplate<DictionaryVariable>(new DictionaryVariable()), this.readObjectSubclassMap);
2,814✔
88
                                case DxfFileToken.ObjectPdfDefinition:
89
                                        return this.readObjectCodes<PdfUnderlayDefinition>(new CadNonGraphicalObjectTemplate(new PdfUnderlayDefinition()), this.readObjectSubclassMap);
192✔
90
                                case DxfFileToken.ObjectSortEntsTable:
91
                                        return this.readSortentsTable();
576✔
92
                                case DxfFileToken.ObjectImageDefinitionReactor:
93
                                        return this.readObjectCodes<ImageDefinitionReactor>(new CadNonGraphicalObjectTemplate(new ImageDefinitionReactor()), this.readObjectSubclassMap);
192✔
94
                                case DxfFileToken.ObjectProxyObject:
95
                                        return this.readObjectCodes<ProxyObject>(new CadProxyObjectTemplate(), this.readProxyObject);
×
96
                                case DxfFileToken.ObjectRasterVariables:
97
                                        return this.readObjectCodes<RasterVariables>(new CadNonGraphicalObjectTemplate(new RasterVariables()), this.readObjectSubclassMap);
192✔
98
                                case DxfFileToken.ObjectGroup:
99
                                        return this.readObjectCodes<Group>(new CadGroupTemplate(), this.readGroup);
384✔
100
                                case DxfFileToken.ObjectGeoData:
101
                                        return this.readObjectCodes<GeoData>(new CadGeoDataTemplate(), this.readGeoData);
2✔
102
                                case DxfFileToken.ObjectMaterial:
103
                                        return this.readObjectCodes<Material>(new CadMaterialTemplate(), this.readMaterial);
2,127✔
104
                                case DxfFileToken.ObjectScale:
105
                                        return this.readObjectCodes<Scale>(new CadTemplate<Scale>(new Scale()), this.readScale);
6,705✔
106
                                case DxfFileToken.ObjectTableContent:
107
                                        return this.readObjectCodes<TableContent>(new CadTableContentTemplate(), this.readTableContent);
320✔
108
                                case DxfFileToken.ObjectVisualStyle:
109
                                        return this.readObjectCodes<VisualStyle>(new CadTemplate<VisualStyle>(new VisualStyle()), this.readVisualStyle);
4,728✔
110
                                case DxfFileToken.ObjectSpatialFilter:
111
                                        return this.readObjectCodes<SpatialFilter>(new CadSpatialFilterTemplate(), this.readSpatialFilter);
192✔
112
                                case DxfFileToken.ObjectMLineStyle:
113
                                        return this.readObjectCodes<MLineStyle>(new CadMLineStyleTemplate(), this.readMLineStyle);
209✔
114
                                case DxfFileToken.ObjectMLeaderStyle:
115
                                        return this.readObjectCodes<MultiLeaderStyle>(new CadMLeaderStyleTemplate(), this.readMLeaderStyle);
406✔
116
                                case DxfFileToken.ObjectTableStyle:
117
                                        return this.readObjectCodes<TableStyle>(new CadTableStyleTemplate(), this.readTableStyle);
197✔
118
                                case DxfFileToken.ObjectXRecord:
119
                                        return this.readObjectCodes<XRecord>(new CadXRecordTemplate(), this.readXRecord);
28,926✔
120
                                case DxfFileToken.ObjectBlockRepresentationData:
121
                                        return this.readObjectCodes<BlockRepresentationData>(new CadBlockRepresentationDataTemplate(), this.readBlockRepresentationData);
265✔
122
                                case DxfFileToken.ObjectBlockGripLocationComponent:
123
                                        return this.readObjectCodes<BlockGripExpression>(new CadBlockGripExpressionTemplate(), this.readBlockGripExpression);
1,158✔
124
                                case DxfFileToken.ObjectBlockVisibilityGrip:
125
                                        return this.readObjectCodes<BlockVisibilityGrip>(new CadBlockVisibilityGripTemplate(), this.readBlockVisibilityGrip);
193✔
126
                                case DxfFileToken.ObjectBlockVisibilityParameter:
127
                                        return this.readObjectCodes<BlockVisibilityParameter>(new CadBlockVisibilityParameterTemplate(), this.readBlockVisibilityParameter);
193✔
128
                                case DxfFileToken.ObjectBlockRotationParameter:
129
                                        return this.readObjectCodes<BlockRotationParameter>(new CadBlockRotationParameterTemplate(), this.readBlockRotationParameter);
1✔
130
                                case DxfFileToken.ObjectBlockRotationGrip:
131
                                        return this.readObjectCodes<BlockRotationGrip>(new CadBlockRotationGripTemplate(), this.readBlockRotationGrip);
1✔
132
                                case DxfFileToken.ObjectBlockRotateAction:
133
                                        return this.readObjectCodes<BlockRotationAction>(new CadBlockRotationActionTemplate(), this.readBlockRotationAction);
1✔
134
                                case DxfFileToken.ObjectField:
135
                                        return this.readObjectCodes<Field>(new CadFieldTemplate(new Field()), this.readField);
×
136
                                case DxfFileToken.ObjectFieldList:
137
                                        return this.readObjectCodes<FieldList>(new CadFieldListTemplate(new FieldList()), this.readFieldList);
×
138
                                default:
139
                                        DxfMap map = DxfMap.Create<CadObject>();
3,479✔
140
                                        CadUnknownNonGraphicalObjectTemplate unknownEntityTemplate = null;
3,479✔
141
                                        if (this._builder.DocumentToBuild.Classes.TryGetByName(this._reader.ValueAsString, out Classes.DxfClass dxfClass))
3,479!
142
                                        {
3,479✔
143
                                                this._builder.Notify($"NonGraphicalObject not supported read as an UnknownNonGraphicalObject: {this._reader.ValueAsString}", NotificationType.NotImplemented);
3,479✔
144
                                                unknownEntityTemplate = new CadUnknownNonGraphicalObjectTemplate(new UnknownNonGraphicalObject(dxfClass));
3,479✔
145
                                        }
3,479✔
146
                                        else
147
                                        {
×
148
                                                this._builder.Notify($"UnknownNonGraphicalObject not supported: {this._reader.ValueAsString}", NotificationType.NotImplemented);
×
149
                                        }
×
150

151
                                        this._reader.ReadNext();
3,479✔
152

153
                                        do
154
                                        {
239,583✔
155
                                                if (unknownEntityTemplate != null && this._builder.KeepUnknownEntities)
239,583!
156
                                                {
29,040✔
157
                                                        this.readCommonCodes(unknownEntityTemplate, out bool isExtendedData, map);
29,040✔
158
                                                        if (isExtendedData)
29,040✔
159
                                                                continue;
24✔
160
                                                }
29,016✔
161

162
                                                this._reader.ReadNext();
239,559✔
163
                                        }
239,559✔
164
                                        while (this._reader.DxfCode != DxfCode.Start);
239,583✔
165

166
                                        return unknownEntityTemplate;
3,479✔
167
                        }
168
                }
77,390✔
169

170
                protected CadTemplate readObjectCodes<T>(CadTemplate template, ReadObjectDelegate<T> readObject)
171
                        where T : CadObject
172
                {
73,335✔
173
                        this._reader.ReadNext();
73,335✔
174

175
                        DxfMap map = DxfMap.Create<T>();
73,335✔
176

177
                        while (this._reader.DxfCode != DxfCode.Start)
1,049,091✔
178
                        {
975,756✔
179
                                if (!readObject(template, map))
975,756✔
180
                                {
236,237✔
181
                                        this.readCommonCodes(template, out bool isExtendedData, map);
236,237✔
182
                                        if (isExtendedData)
236,237✔
183
                                                continue;
2,985✔
184
                                }
233,252✔
185

186
                                if (this.lockPointer)
972,771✔
187
                                {
2,566✔
188
                                        this.lockPointer = false;
2,566✔
189
                                        continue;
2,566✔
190
                                }
191

192
                                if (this._reader.DxfCode != DxfCode.Start)
970,205✔
193
                                {
941,279✔
194
                                        this._reader.ReadNext();
941,279✔
195
                                }
941,279✔
196
                        }
970,205✔
197

198
                        return template;
73,335✔
199
                }
73,335✔
200

201
                private bool readFieldList(CadTemplate template, DxfMap map)
202
                {
×
203
                        var tmp = template as CadFieldListTemplate;
×
204

205
                        switch (this._reader.Code)
×
206
                        {
207
                                case 100 when this._reader.ValueAsString == DxfSubclassMarker.IdSet:
×
208
                                        this.currentSubclass = this._reader.ValueAsString;
×
209
                                        return true;
×
210
                                case 90 when this.currentSubclass == DxfSubclassMarker.IdSet:
×
211
                                        return true;
×
212
                                case 330 when this.currentSubclass == DxfSubclassMarker.IdSet:
×
213
                                        tmp.OwnedObjectsHandlers.Add(this._reader.ValueAsHandle);
×
214
                                        return true;
×
215
                                default:
216
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.FieldList]);
×
217
                        }
218
                }
×
219

220
                private bool readField(CadTemplate template, DxfMap map)
221
                {
×
222
                        var tmp = template as CadFieldTemplate;
×
223

224
                        switch (this._reader.Code)
×
225
                        {
226
                                case 3:
227
                                        tmp.CadObject.FieldCode += this._reader.ValueAsString;
×
228
                                        return true;
×
229
                                //98 Length of format string
230
                                case 98:
231
                                        return true;
×
232
                                case 6:
233
                                        string key = this._reader.ValueAsString;
×
NEW
234
                                        var t = this.readCadValue(new CadValue());
×
235
                                        tmp.CadObject.Values.Add(key, t.CadValue);
×
236
                                        tmp.CadValueTemplates.Add(t);
×
237
                                        return true;
×
238
                                case 7:
NEW
239
                                        t = this.readCadValue(new CadValue());
×
240
                                        tmp.CadObject.Value = t.CadValue;
×
241
                                        tmp.CadValueTemplates.Add(t);
×
242
                                        return true;
×
243
                                case 331:
244
                                        tmp.CadObjectsHandles.Add(this._reader.ValueAsHandle);
×
245
                                        return true;
×
246
                                case 360:
247
                                        tmp.ChildrenHandles.Add(this._reader.ValueAsHandle);
×
248
                                        return true;
×
249
                                default:
250
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.Field]);
×
251
                        }
252
                }
×
253

254
                private bool readProxyObject(CadTemplate template, DxfMap map)
255
                {
×
256
                        CadProxyObjectTemplate tmp = template as CadProxyObjectTemplate;
×
257
                        ProxyObject proxy = template.CadObject as ProxyObject;
×
258

259
                        switch (this._reader.Code)
×
260
                        {
261
                                case 90:
262
                                case 94:
263
                                //Undocumented
264
                                case 97:
265
                                case 71:
266
                                        return true;
×
267
                                case 95:
268
                                        int format = this._reader.ValueAsInt;
×
269
                                        proxy.Version = (ACadVersion)(format & 0xFFFF);
×
270
                                        proxy.MaintenanceVersion = (short)(format >> 16);
×
271
                                        return true;
×
272
                                case 91:
273
                                        var classId = this._reader.ValueAsShort;
×
274
                                        if (this._builder.DocumentToBuild.Classes.TryGetByClassNumber(classId, out DxfClass dxfClass))
×
275
                                        {
×
276
                                                proxy.DxfClass = dxfClass;
×
277
                                        }
×
278
                                        return true;
×
279
                                case 161:
280
                                        return true;
×
281
                                case 162:
282
                                        return true;
×
283
                                case 310:
284
                                        if (proxy.BinaryData == null)
×
285
                                        {
×
286
                                                proxy.BinaryData = new MemoryStream();
×
287
                                        }
×
288
                                        proxy.BinaryData.Write(this._reader.ValueAsBinaryChunk, 0, this._reader.ValueAsBinaryChunk.Length);
×
289
                                        return true;
×
290
                                case 311:
291
                                        if (proxy.Data == null)
×
292
                                        {
×
293
                                                proxy.Data = new MemoryStream();
×
294
                                        }
×
295
                                        proxy.Data.Write(this._reader.ValueAsBinaryChunk, 0, this._reader.ValueAsBinaryChunk.Length);
×
296
                                        return true;
×
297
                                case 330:
298
                                case 340:
299
                                case 350:
300
                                case 360:
301
                                        tmp.Entries.Add(this._reader.ValueAsHandle);
×
302
                                        return true;
×
303
                                default:
304
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.ProxyObject]);
×
305
                        }
306
                }
×
307

308
                private bool readObjectSubclassMap(CadTemplate template, DxfMap map)
309
                {
23,355✔
310
                        switch (this._reader.Code)
23,355✔
311
                        {
312
                                default:
313
                                        if (string.IsNullOrEmpty(this.currentSubclass))
23,355✔
314
                                        {
14,655✔
315
                                                return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[template.CadObject.SubclassMarker]);
14,655✔
316
                                        }
317
                                        else
318
                                        {
8,700✔
319
                                                return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[this.currentSubclass]);
8,700✔
320
                                        }
321
                        }
322
                }
23,355✔
323

324
                private bool readAnnotScaleObjectContextData(CadTemplate template, DxfMap map)
325
                {
×
326
                        var tmp = template as CadAnnotScaleObjectContextDataTemplate;
×
327
                        switch (this._reader.Code)
×
328
                        {
329
                                case 340:
330
                                        tmp.ScaleHandle = this._reader.ValueAsHandle;
×
331
                                        return true;
×
332
                                default:
333
                                        if (string.IsNullOrEmpty(this.currentSubclass))
×
334
                                        {
×
335
                                                return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[template.CadObject.SubclassMarker]);
×
336
                                        }
337
                                        else
338
                                        {
×
339
                                                return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[this.currentSubclass]);
×
340
                                        }
341
                        }
342
                }
×
343

344
                private bool readPlotSettings(CadTemplate template, DxfMap map)
345
                {
26,341✔
346
                        switch (this._reader.Code)
26,341✔
347
                        {
348
                                default:
349
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.PlotSettings]);
26,341✔
350
                        }
351
                }
26,341✔
352

353
                private bool readEvaluationGraph(CadTemplate template, DxfMap map)
354
                {
3,096✔
355
                        CadEvaluationGraphTemplate tmp = template as CadEvaluationGraphTemplate;
3,096✔
356
                        EvaluationGraph evGraph = tmp.CadObject;
3,096✔
357

358
                        switch (this._reader.Code)
3,096✔
359
                        {
360
                                case 91:
361
                                        while (this._reader.Code == 91)
3,025✔
362
                                        {
2,574✔
363
                                                GraphNodeTemplate nodeTemplate = new GraphNodeTemplate();
2,574✔
364
                                                EvaluationGraph.Node node = nodeTemplate.Node;
2,574✔
365

366
                                                node.Index = this._reader.ValueAsInt;
2,574✔
367

368
                                                this._reader.ExpectedCode(93);
2,574✔
369
                                                node.Flags = this._reader.ValueAsInt;
2,574✔
370

371
                                                this._reader.ExpectedCode(95);
2,574✔
372
                                                node.NextNodeIndex = this._reader.ValueAsInt;
2,574✔
373

374
                                                this._reader.ExpectedCode(360);
2,574✔
375
                                                nodeTemplate.ExpressionHandle = this._reader.ValueAsHandle;
2,574✔
376

377
                                                this._reader.ExpectedCode(92);
2,574✔
378
                                                node.Data1 = this._reader.ValueAsInt;
2,574✔
379
                                                this._reader.ExpectedCode(92);
2,574✔
380
                                                node.Data2 = this._reader.ValueAsInt;
2,574✔
381
                                                this._reader.ExpectedCode(92);
2,574✔
382
                                                node.Data3 = this._reader.ValueAsInt;
2,574✔
383
                                                this._reader.ExpectedCode(92);
2,574✔
384
                                                node.Data4 = this._reader.ValueAsInt;
2,574✔
385

386
                                                this._reader.ReadNext();
2,574✔
387

388
                                                tmp.NodeTemplates.Add(nodeTemplate);
2,574✔
389
                                        }
2,574✔
390

391
                                        this.lockPointer = true;
451✔
392
                                        return true;
451✔
393
                                case 92:
394
                                        //Edges
395
                                        while (this._reader.Code == 92)
2,126✔
396
                                        {
1,931✔
397
                                                this._reader.ExpectedCode(93);
1,931✔
398
                                                this._reader.ExpectedCode(94);
1,931✔
399
                                                this._reader.ExpectedCode(91);
1,931✔
400
                                                this._reader.ExpectedCode(91);
1,931✔
401
                                                this._reader.ExpectedCode(92);
1,931✔
402
                                                this._reader.ExpectedCode(92);
1,931✔
403
                                                this._reader.ExpectedCode(92);
1,931✔
404
                                                this._reader.ExpectedCode(92);
1,931✔
405
                                                this._reader.ExpectedCode(92);
1,931✔
406

407
                                                this._reader.ReadNext();
1,931✔
408
                                        }
1,931✔
409

410
                                        this.lockPointer = true;
195✔
411
                                        return true;
195✔
412
                                default:
413
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.EvalGraph]);
2,450✔
414
                        }
415
                }
3,096✔
416

417
                private bool readLayout(CadTemplate template, DxfMap map)
418
                {
51,979✔
419
                        CadLayoutTemplate tmp = template as CadLayoutTemplate;
51,979✔
420

421
                        switch (this._reader.Code)
51,979✔
422
                        {
423
                                case 330 when template.OwnerHandle.HasValue:
1,614✔
424
                                        tmp.PaperSpaceBlockHandle = this._reader.ValueAsHandle;
807✔
425
                                        return true;
807✔
426
                                case 331:
427
                                        tmp.LasActiveViewportHandle = (this._reader.ValueAsHandle);
773✔
428
                                        return true;
773✔
429
                                default:
430
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.Layout]))
50,399✔
431
                                        {
26,341✔
432
                                                return this.readPlotSettings(template, map);
26,341✔
433
                                        }
434
                                        return true;
24,058✔
435
                        }
436
                }
51,979✔
437

438
                private bool readGroup(CadTemplate template, DxfMap map)
439
                {
4,992✔
440
                        CadGroupTemplate tmp = template as CadGroupTemplate;
4,992✔
441

442
                        switch (this._reader.Code)
4,992✔
443
                        {
444
                                case 70:
445
                                        return true;
384✔
446
                                case 340:
447
                                        tmp.Handles.Add(this._reader.ValueAsHandle);
2,304✔
448
                                        return true;
2,304✔
449
                                default:
450
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[template.CadObject.SubclassMarker]);
2,304✔
451
                        }
452
                }
4,992✔
453

454
                private bool readGeoData(CadTemplate template, DxfMap map)
455
                {
102✔
456
                        CadGeoDataTemplate tmp = template as CadGeoDataTemplate;
102✔
457

458
                        switch (this._reader.Code)
102✔
459
                        {
460
                                case 40 when tmp.CadObject.Version == GeoDataVersion.R2009:
2✔
461
                                        tmp.CadObject.ReferencePoint = new CSMath.XYZ(
1✔
462
                                                tmp.CadObject.ReferencePoint.X,
1✔
463
                                                this._reader.ValueAsDouble,
1✔
464
                                                tmp.CadObject.ReferencePoint.Z
1✔
465
                                                );
1✔
466
                                        return true;
1✔
467
                                case 41 when tmp.CadObject.Version == GeoDataVersion.R2009:
2✔
468
                                        tmp.CadObject.ReferencePoint = new CSMath.XYZ(
1✔
469
                                                this._reader.ValueAsDouble,
1✔
470
                                                tmp.CadObject.ReferencePoint.Y,
1✔
471
                                                tmp.CadObject.ReferencePoint.Z
1✔
472
                                                );
1✔
473
                                        return true;
1✔
474
                                case 42 when tmp.CadObject.Version == GeoDataVersion.R2009:
1✔
475
                                        tmp.CadObject.ReferencePoint = new CSMath.XYZ(
1✔
476
                                                tmp.CadObject.ReferencePoint.X,
1✔
477
                                                tmp.CadObject.ReferencePoint.Y,
1✔
478
                                                this._reader.ValueAsDouble
1✔
479
                                                );
1✔
480
                                        return true;
1✔
481
                                case 46 when tmp.CadObject.Version == GeoDataVersion.R2009:
1✔
482
                                        tmp.CadObject.HorizontalUnitScale = this._reader.ValueAsDouble;
1✔
483
                                        return true;
1✔
484
                                case 52 when tmp.CadObject.Version == GeoDataVersion.R2009:
1✔
485
                                        double angle = System.Math.PI / 2.0 - this._reader.ValueAsAngle;
1✔
486
                                        tmp.CadObject.NorthDirection = new CSMath.XY(Math.Cos(angle), Math.Sin(angle));
1✔
487
                                        return true;
1✔
488
                                // Number of Geo-Mesh points
489
                                case 93:
490
                                        var npts = this._reader.ValueAsInt;
3✔
491
                                        for (int i = 0; i < npts; i++)
54✔
492
                                        {
24✔
493
                                                this._reader.ReadNext();
24✔
494
                                                double sourceX = this._reader.ValueAsDouble;
24✔
495
                                                this._reader.ReadNext();
24✔
496
                                                double sourceY = this._reader.ValueAsDouble;
24✔
497

498
                                                this._reader.ReadNext();
24✔
499
                                                double destX = this._reader.ValueAsDouble;
24✔
500
                                                this._reader.ReadNext();
24✔
501
                                                double destY = this._reader.ValueAsDouble;
24✔
502

503
                                                tmp.CadObject.Points.Add(new GeoData.GeoMeshPoint
24✔
504
                                                {
24✔
505
                                                        Source = new CSMath.XY(sourceX, sourceY),
24✔
506
                                                        Destination = new CSMath.XY(destX, destY)
24✔
507
                                                });
24✔
508
                                        }
24✔
509
                                        return true;
3✔
510
                                // Number of Geo-Mesh points
511
                                case 96:
512
                                        var nfaces = this._reader.ValueAsInt;
2✔
513
                                        for (int i = 0; i < nfaces; i++)
4!
514
                                        {
×
515
                                                this._reader.ReadNext();
×
516
                                                Debug.Assert(this._reader.Code == 97);
×
517
                                                int index1 = this._reader.ValueAsInt;
×
518
                                                this._reader.ReadNext();
×
519
                                                Debug.Assert(this._reader.Code == 98);
×
520
                                                int index2 = this._reader.ValueAsInt;
×
521
                                                this._reader.ReadNext();
×
522
                                                Debug.Assert(this._reader.Code == 99);
×
523
                                                int index3 = this._reader.ValueAsInt;
×
524

525
                                                tmp.CadObject.Faces.Add(new GeoData.GeoMeshFace
×
526
                                                {
×
527
                                                        Index1 = index1,
×
528
                                                        Index2 = index2,
×
529
                                                        Index3 = index3
×
530
                                                });
×
531
                                        }
×
532
                                        return true;
2✔
533
                                case 303:
534
                                        tmp.CadObject.CoordinateSystemDefinition += this._reader.ValueAsString;
13✔
535
                                        return true;
13✔
536
                                //Obsolete codes for version GeoDataVersion.R2009
537
                                case 3:
538
                                case 4:
539
                                case 14:
540
                                case 24:
541
                                case 15:
542
                                case 25:
543
                                case 43:
544
                                case 44:
545
                                case 45:
546
                                case 94:
547
                                case 293:
548
                                case 16:
549
                                case 26:
550
                                case 17:
551
                                case 27:
552
                                case 54:
553
                                case 140:
554
                                case 304:
555
                                case 292:
556
                                        return true;
19✔
557
                                default:
558
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[tmp.CadObject.SubclassMarker]);
60✔
559
                        }
560
                }
102✔
561

562
                private bool readMaterial(CadTemplate template, DxfMap map)
563
                {
42,114✔
564
                        CadMaterialTemplate tmp = template as CadMaterialTemplate;
42,114✔
565
                        List<double> arr = null;
42,114✔
566

567
                        switch (this._reader.Code)
42,114!
568
                        {
569
                                case 43:
570
                                        arr = new();
1,349✔
571
                                        for (int i = 0; i < 16; i++)
45,866✔
572
                                        {
21,584✔
573
                                                Debug.Assert(this._reader.Code == 43);
21,584✔
574

575
                                                arr.Add(this._reader.ValueAsDouble);
21,584✔
576

577
                                                this._reader.ReadNext();
21,584✔
578
                                        }
21,584✔
579

580
                                        tmp.CadObject.DiffuseMatrix = new CSMath.Matrix4(arr.ToArray());
1,349✔
581
                                        return this.checkObjectEnd(template, map, this.readMaterial);
1,349✔
582
                                case 47:
583
                                        arr = new();
×
584
                                        for (int i = 0; i < 16; i++)
×
585
                                        {
×
586
                                                Debug.Assert(this._reader.Code == 47);
×
587

588
                                                arr.Add(this._reader.ValueAsDouble);
×
589

590
                                                this._reader.ReadNext();
×
591
                                        }
×
592

593
                                        tmp.CadObject.SpecularMatrix = new CSMath.Matrix4(arr.ToArray());
×
594
                                        return this.checkObjectEnd(template, map, this.readMaterial);
×
595
                                case 49:
596
                                        arr = new();
197✔
597
                                        for (int i = 0; i < 16; i++)
6,698✔
598
                                        {
3,152✔
599
                                                Debug.Assert(this._reader.Code == 49);
3,152✔
600

601
                                                arr.Add(this._reader.ValueAsDouble);
3,152✔
602

603
                                                this._reader.ReadNext();
3,152✔
604
                                        }
3,152✔
605

606
                                        tmp.CadObject.ReflectionMatrix = new CSMath.Matrix4(arr.ToArray());
197✔
607
                                        return this.checkObjectEnd(template, map, this.readMaterial);
197✔
608
                                case 142:
609
                                        arr = new();
197✔
610
                                        for (int i = 0; i < 16; i++)
6,698✔
611
                                        {
3,152✔
612
                                                Debug.Assert(this._reader.Code == 142);
3,152✔
613

614
                                                arr.Add(this._reader.ValueAsDouble);
3,152✔
615

616
                                                this._reader.ReadNext();
3,152✔
617
                                        }
3,152✔
618

619
                                        tmp.CadObject.OpacityMatrix = new CSMath.Matrix4(arr.ToArray());
197✔
620
                                        return this.checkObjectEnd(template, map, this.readMaterial);
197✔
621
                                case 144:
622
                                        arr = new();
1,157✔
623
                                        for (int i = 0; i < 16; i++)
39,338✔
624
                                        {
18,512✔
625
                                                Debug.Assert(this._reader.Code == 144);
18,512✔
626

627
                                                arr.Add(this._reader.ValueAsDouble);
18,512✔
628

629
                                                this._reader.ReadNext();
18,512✔
630
                                        }
18,512✔
631

632
                                        tmp.CadObject.BumpMatrix = new CSMath.Matrix4(arr.ToArray());
1,157✔
633
                                        return this.checkObjectEnd(template, map, this.readMaterial);
1,157✔
634
                                case 147:
635
                                        arr = new();
×
636
                                        for (int i = 0; i < 16; i++)
×
637
                                        {
×
638
                                                Debug.Assert(this._reader.Code == 147);
×
639

640
                                                arr.Add(this._reader.ValueAsDouble);
×
641

642
                                                this._reader.ReadNext();
×
643
                                        }
×
644

645
                                        tmp.CadObject.RefractionMatrix = new CSMath.Matrix4(arr.ToArray());
×
646
                                        return this.checkObjectEnd(template, map, this.readMaterial);
×
647
                                default:
648
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[tmp.CadObject.SubclassMarker]);
39,214✔
649
                        }
650
                }
42,114✔
651

652
                private bool readScale(CadTemplate template, DxfMap map)
653
                {
60,141✔
654
                        switch (this._reader.Code)
60,141✔
655
                        {
656
                                // Undocumented codes
657
                                case 70:
658
                                        //Always 0
659
                                        return true;
6,705✔
660
                                default:
661
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.Scale]);
53,436✔
662
                        }
663
                }
60,141✔
664

665
                private void readLinkedData(CadTemplate template, DxfMap map)
666
                {
320✔
667
                        CadTableContentTemplate tmp = template as CadTableContentTemplate;
320✔
668
                        LinkedData linkedData = tmp.CadObject;
320✔
669

670
                        this._reader.ReadNext();
320✔
671

672
                        while (this._reader.DxfCode != DxfCode.Start && this._reader.DxfCode != DxfCode.Subclass)
960!
673
                        {
640✔
674
                                switch (this._reader.Code)
640✔
675
                                {
676
                                        default:
677
                                                if (!this.tryAssignCurrentValue(linkedData, map.SubClasses[DxfSubclassMarker.LinkedData]))
640!
678
                                                {
×
679
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readLinkedData)} {this._reader.Position}.", NotificationType.None);
×
680
                                                }
×
681
                                                break;
640✔
682
                                }
683

684
                                this._reader.ReadNext();
640✔
685
                        }
640✔
686
                }
320✔
687

688
                private bool readTableContent(CadTemplate template, DxfMap map)
689
                {
2,368✔
690
                        switch (this._reader.Code)
2,368✔
691
                        {
692
                                case 100 when this._reader.ValueAsString.Equals(DxfSubclassMarker.TableContent, StringComparison.InvariantCultureIgnoreCase):
1,216✔
693
                                        this.readTableContentSubclass(template, map);
256✔
694
                                        this.lockPointer = true;
256✔
695
                                        return true;
256✔
696
                                case 100 when this._reader.ValueAsString.Equals(DxfSubclassMarker.FormattedTableData, StringComparison.InvariantCultureIgnoreCase):
960✔
697
                                        this.readFormattedTableDataSubclass(template, map);
256✔
698
                                        this.lockPointer = true;
256✔
699
                                        return true;
256✔
700
                                case 100 when this._reader.ValueAsString.Equals(DxfSubclassMarker.LinkedTableData, StringComparison.InvariantCultureIgnoreCase):
704✔
701
                                        this.readLinkedTableDataSubclass(template, map);
320✔
702
                                        this.lockPointer = true;
320✔
703
                                        return true;
320✔
704
                                case 100 when this._reader.ValueAsString.Equals(DxfSubclassMarker.LinkedData, StringComparison.InvariantCultureIgnoreCase):
384✔
705
                                        this.readLinkedData(template, map);
320✔
706
                                        this.lockPointer = true;
320✔
707
                                        return true;
320✔
708
                                default:
709
                                        return false;
1,216✔
710
                        }
711
                }
2,368✔
712

713
                private void readTableContentSubclass(CadTemplate template, DxfMap map)
714
                {
256✔
715
                        CadTableContentTemplate tmp = template as CadTableContentTemplate;
256✔
716
                        TableContent tableContent = tmp.CadObject;
256✔
717

718
                        this._reader.ReadNext();
256✔
719

720
                        while (this._reader.DxfCode != DxfCode.Start && this._reader.DxfCode != DxfCode.Subclass)
512✔
721
                        {
256✔
722
                                switch (this._reader.Code)
256!
723
                                {
724
                                        case 340:
725
                                                tmp.SytleHandle = this._reader.ValueAsHandle;
256✔
726
                                                break;
256✔
727
                                        default:
728
                                                if (!this.tryAssignCurrentValue(tableContent, map.SubClasses[DxfSubclassMarker.TableContent]))
×
729
                                                {
×
730
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readTableContentSubclass)} {this._reader.Position}.", NotificationType.None);
×
731
                                                }
×
732
                                                break;
×
733
                                }
734

735
                                this._reader.ReadNext();
256✔
736
                        }
256✔
737
                }
256✔
738

739
                private void readFormattedTableDataSubclass(CadTemplate template, DxfMap map)
740
                {
256✔
741
                        CadTableContentTemplate tmp = template as CadTableContentTemplate;
256✔
742
                        FormattedTableData formattedTable = tmp.CadObject;
256✔
743

744
                        this._reader.ReadNext();
256✔
745

746
                        TableEntity.CellRange cellRange = null;
256✔
747
                        while (this._reader.DxfCode != DxfCode.Start && this._reader.DxfCode != DxfCode.Subclass)
2,304!
748
                        {
2,048✔
749
                                switch (this._reader.Code)
2,048!
750
                                {
751
                                        case 90:
752
                                                break;
256✔
753
                                        case 91:
754
                                                if (cellRange == null)
384✔
755
                                                {
384✔
756
                                                        cellRange = new();
384✔
757
                                                        formattedTable.MergedCellRanges.Add(cellRange);
384✔
758
                                                }
384✔
759
                                                cellRange.TopRowIndex = this._reader.ValueAsInt;
384✔
760
                                                break;
384✔
761
                                        case 92:
762
                                                if (cellRange == null)
384!
763
                                                {
×
764
                                                        cellRange = new();
×
765
                                                        formattedTable.MergedCellRanges.Add(cellRange);
×
766
                                                }
×
767
                                                cellRange.LeftColumnIndex = this._reader.ValueAsInt;
384✔
768
                                                break;
384✔
769
                                        case 93:
770
                                                if (cellRange == null)
384!
771
                                                {
×
772
                                                        cellRange = new();
×
773
                                                        formattedTable.MergedCellRanges.Add(cellRange);
×
774
                                                }
×
775
                                                cellRange.BottomRowIndex = this._reader.ValueAsInt;
384✔
776
                                                break;
384✔
777
                                        case 94:
778
                                                if (cellRange == null)
384!
779
                                                {
×
780
                                                        cellRange = new();
×
781
                                                        formattedTable.MergedCellRanges.Add(cellRange);
×
782
                                                }
×
783
                                                cellRange.RightColumnIndex = this._reader.ValueAsInt;
384✔
784
                                                cellRange = null;
384✔
785
                                                break;
384✔
786
                                        case 300 when this._reader.ValueAsString.Equals("TABLEFORMAT", StringComparison.InvariantCultureIgnoreCase):
256!
787
                                                this.readStyleOverride(new CadCellStyleTemplate(formattedTable.CellStyleOverride));
256✔
788
                                                break;
256✔
789
                                        default:
790
                                                if (!this.tryAssignCurrentValue(formattedTable, map.SubClasses[DxfSubclassMarker.FormattedTableData]))
×
791
                                                {
×
792
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readFormattedTableDataSubclass)} {this._reader.Position}.", NotificationType.None);
×
793
                                                }
×
794
                                                break;
×
795
                                }
796

797
                                this._reader.ReadNext();
2,048✔
798
                        }
2,048✔
799
                }
256✔
800

801
                private void readLinkedTableDataSubclass(CadTemplate template, DxfMap map)
802
                {
320✔
803
                        CadTableContentTemplate tmp = template as CadTableContentTemplate;
320✔
804
                        TableContent tableContent = tmp.CadObject;
320✔
805

806
                        this._reader.ReadNext();
320✔
807

808
                        while (this._reader.DxfCode != DxfCode.Start && this._reader.DxfCode != DxfCode.Subclass)
4,224!
809
                        {
3,904✔
810
                                switch (this._reader.Code)
3,904✔
811
                                {
812
                                        case 90:
813
                                                //Column count
814
                                                break;
320✔
815
                                        case 91:
816
                                                //Row count
817
                                                break;
320✔
818
                                        //Unknown
819
                                        case 92:
820
                                                break;
256✔
821
                                        case 300 when this._reader.ValueAsString.Equals(DxfFileToken.ObjectTableColumn, StringComparison.InvariantCultureIgnoreCase):
1,216✔
822
                                                //Read Column
823
                                                this.readTableColumn();
1,216✔
824
                                                break;
1,216✔
825
                                        case 301 when this._reader.ValueAsString.Equals(DxfFileToken.ObjectTableRow, StringComparison.InvariantCultureIgnoreCase):
1,472✔
826
                                                //Read Row
827
                                                this.readTableRow();
1,472✔
828
                                                break;
1,472✔
829
                                        default:
830
                                                if (!this.tryAssignCurrentValue(tableContent, map.SubClasses[DxfSubclassMarker.LinkedTableData]))
320✔
831
                                                {
320✔
832
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readLinkedTableDataSubclass)} {this._reader.Position}.", NotificationType.None);
320✔
833
                                                }
320✔
834
                                                break;
320✔
835
                                }
836

837
                                this._reader.ReadNext();
3,904✔
838
                        }
3,904✔
839
                }
320✔
840

841

842
                private TableEntity.Column readTableColumn()
843
                {
1,216✔
844
                        this._reader.ReadNext();
1,216✔
845

846
                        TableEntity.Column column = new TableEntity.Column();
1,216✔
847

848
                        bool end = false;
1,216✔
849
                        while (this._reader.DxfCode != DxfCode.Start)
3,648!
850
                        {
3,648✔
851
                                switch (this._reader.Code)
3,648!
852
                                {
853
                                        case 1 when this._reader.ValueAsString.Equals(DxfFileToken.LinkedTableDataColumn_BEGIN, StringComparison.InvariantCultureIgnoreCase):
3,648✔
854
                                                this.readLinkedTableColumn(column);
1,216✔
855
                                                break;
1,216✔
856
                                        case 1 when this._reader.ValueAsString.Equals(DxfFileToken.FormattedTableDataColumn_BEGIN, StringComparison.InvariantCultureIgnoreCase):
2,432✔
857
                                                this.readFormattedTableColumn(column);
1,216✔
858
                                                break;
1,216✔
859
                                        case 1 when this._reader.ValueAsString.Equals(DxfFileToken.ObjectTableColumnBegin, StringComparison.InvariantCultureIgnoreCase):
1,216!
860
                                                this.readTableColumn(column);
1,216✔
861
                                                end = true;
1,216✔
862
                                                break;
1,216✔
863
                                        default:
864
                                                this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readTableColumn)} method.", NotificationType.None);
×
865
                                                break;
×
866
                                }
867

868
                                if (end)
3,648✔
869
                                {
1,216✔
870
                                        return column;
1,216✔
871
                                }
872

873
                                this._reader.ReadNext();
2,432✔
874
                        }
2,432✔
875

876
                        return column;
×
877
                }
1,216✔
878

879
                private TableEntity.Row readTableRow()
880
                {
1,472✔
881
                        this._reader.ReadNext();
1,472✔
882

883
                        TableEntity.Row row = new TableEntity.Row();
1,472✔
884

885
                        bool end = false;
1,472✔
886
                        while (this._reader.DxfCode != DxfCode.Start)
11,904✔
887
                        {
11,840✔
888
                                switch (this._reader.Code)
11,840✔
889
                                {
890
                                        case 1 when this._reader.ValueAsString.Equals(DxfFileToken.LinkedTableDataRow_BEGIN, StringComparison.InvariantCultureIgnoreCase):
6,016✔
891
                                                this.readLinkedTableRow(row);
1,536✔
892
                                                break;
1,536✔
893
                                        case 1 when this._reader.ValueAsString.Equals(DxfFileToken.FormattedTableDataRow_BEGIN, StringComparison.InvariantCultureIgnoreCase):
4,480✔
894
                                                this.readFormattedTableRow(row);
1,408✔
895
                                                break;
1,408✔
896
                                        case 1 when this._reader.ValueAsString.Equals(DxfFileToken.ObjectTableRowBegin, StringComparison.InvariantCultureIgnoreCase):
3,072✔
897
                                                this.readTableRow(row);
1,408✔
898
                                                end = true;
1,408✔
899
                                                break;
1,408✔
900
                                        default:
901
                                                this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readTableRow)} method.", NotificationType.None);
7,488✔
902
                                                break;
7,488✔
903
                                }
904

905
                                if (end)
11,840✔
906
                                {
1,408✔
907
                                        return row;
1,408✔
908
                                }
909

910
                                this._reader.ReadNext();
10,432✔
911
                        }
10,432✔
912

913
                        return row;
64✔
914
                }
1,472✔
915

916
                private void readTableRow(TableEntity.Row row)
917
                {
1,408✔
918
                        this._reader.ReadNext();
1,408✔
919

920
                        bool end = false;
1,408✔
921
                        while (this._reader.DxfCode != DxfCode.Start)
4,224✔
922
                        {
4,224✔
923
                                switch (this._reader.Code)
4,224!
924
                                {
925
                                        case 40:
926
                                                row.Height = this._reader.ValueAsDouble;
1,408✔
927
                                                break;
1,408✔
928
                                        case 90:
929
                                                //styleID
930
                                                break;
1,408✔
931
                                        case 309:
932
                                                end = this._reader.ValueAsString.Equals("TABLEROW_END", StringComparison.InvariantCultureIgnoreCase);
1,408✔
933
                                                break;
1,408✔
934
                                        default:
935
                                                this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readTableRow)} method.", NotificationType.None);
×
936
                                                break;
×
937
                                }
938

939
                                if (end)
4,224✔
940
                                {
1,408✔
941
                                        break;
1,408✔
942
                                }
943

944
                                this._reader.ReadNext();
2,816✔
945
                        }
2,816✔
946
                }
1,408✔
947

948
                private void readFormattedTableRow(TableEntity.Row row)
949
                {
1,408✔
950
                        this._reader.ReadNext();
1,408✔
951

952
                        bool end = false;
1,408✔
953
                        while (this._reader.DxfCode != DxfCode.Start)
4,224✔
954
                        {
4,224✔
955
                                switch (this._reader.Code)
4,224!
956
                                {
957
                                        case 300 when this._reader.ValueAsString.Equals("ROWTABLEFORMAT", StringComparison.InvariantCultureIgnoreCase):
1,408!
958
                                                break;
1,408✔
959
                                        case 1 when this._reader.ValueAsString.Equals("TABLEFORMAT_BEGIN", StringComparison.InvariantCultureIgnoreCase):
1,408!
960
                                                this.readStyleOverride(new CadCellStyleTemplate(row.CellStyleOverride));
1,408✔
961
                                                break;
1,408✔
962
                                        case 309:
963
                                                end = this._reader.ValueAsString.Equals("FORMATTEDTABLEDATAROW_END", StringComparison.InvariantCultureIgnoreCase);
1,408✔
964
                                                break;
1,408✔
965
                                        default:
966
                                                this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readFormattedTableRow)} method.", NotificationType.None);
×
967
                                                break;
×
968
                                }
969

970
                                if (end)
4,224✔
971
                                {
1,408✔
972
                                        break;
1,408✔
973
                                }
974

975
                                this._reader.ReadNext();
2,816✔
976
                        }
2,816✔
977
                }
1,408✔
978

979
                private void readTableColumn(TableEntity.Column column)
980
                {
1,216✔
981
                        this._reader.ReadNext();
1,216✔
982

983
                        bool end = false;
1,216✔
984
                        while (this._reader.DxfCode != DxfCode.Start)
3,648✔
985
                        {
3,648✔
986
                                switch (this._reader.Code)
3,648!
987
                                {
988
                                        case 1 when this._reader.ValueAsString.Equals("TABLECOLUMN_BEGIN", StringComparison.InvariantCultureIgnoreCase):
×
989
                                                break;
×
990
                                        case 1:
991
                                                end = true;
×
992
                                                break;
×
993
                                        case 40:
994
                                                column.Width = this._reader.ValueAsDouble;
1,216✔
995
                                                break;
1,216✔
996
                                        case 90:
997
                                                //StyleId
998
                                                break;
1,216✔
999
                                        case 309:
1000
                                                end = this._reader.ValueAsString.Equals("TABLECOLUMN_END", StringComparison.InvariantCultureIgnoreCase);
1,216✔
1001
                                                break;
1,216✔
1002
                                        default:
1003
                                                this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readTableColumn)} method.", NotificationType.None);
×
1004
                                                break;
×
1005
                                }
1006

1007
                                if (end)
3,648✔
1008
                                {
1,216✔
1009
                                        break;
1,216✔
1010
                                }
1011

1012
                                this._reader.ReadNext();
2,432✔
1013
                        }
2,432✔
1014
                }
1,216✔
1015

1016
                private void readLinkedTableColumn(TableEntity.Column column)
1017
                {
1,216✔
1018
                        this._reader.ReadNext();
1,216✔
1019

1020
                        bool end = false;
1,216✔
1021
                        while (this._reader.DxfCode != DxfCode.Start)
4,864✔
1022
                        {
4,864✔
1023
                                switch (this._reader.Code)
4,864!
1024
                                {
1025
                                        case 1 when this._reader.ValueAsString.Equals(DxfFileToken.LinkedTableDataColumn_BEGIN, StringComparison.InvariantCultureIgnoreCase):
×
1026
                                                break;
×
1027
                                        case 1:
1028
                                                end = true;
×
1029
                                                break;
×
1030
                                        case 91:
1031
                                                column.CustomData = this._reader.ValueAsInt;
1,216✔
1032
                                                break;
1,216✔
1033
                                        case 300:
1034
                                                column.Name = this._reader.ValueAsString;
1,216✔
1035
                                                break;
1,216✔
1036
                                        case 301 when this._reader.ValueAsString.Equals(DxfFileToken.CustomData, StringComparison.InvariantCultureIgnoreCase):
1,216!
1037
                                                this.readCustomData();
1,216✔
1038
                                                break;
1,216✔
1039
                                        case 309:
1040
                                                end = this._reader.ValueAsString.Equals(DxfFileToken.LinkedTableDataColumn_END, StringComparison.InvariantCultureIgnoreCase);
1,216✔
1041
                                                break;
1,216✔
1042
                                        default:
1043
                                                this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readLinkedTableColumn)} method.", NotificationType.None);
×
1044
                                                break;
×
1045
                                }
1046

1047
                                if (end)
4,864✔
1048
                                {
1,216✔
1049
                                        break;
1,216✔
1050
                                }
1051

1052
                                this._reader.ReadNext();
3,648✔
1053
                        }
3,648✔
1054
                }
1,216✔
1055

1056
                private void readLinkedTableRow(TableEntity.Row row)
1057
                {
1,536✔
1058
                        this._reader.ReadNext();
1,536✔
1059

1060
                        bool end = false;
1,536✔
1061
                        while (this._reader.DxfCode != DxfCode.Start)
12,608✔
1062
                        {
12,480✔
1063
                                switch (this._reader.Code)
12,480!
1064
                                {
1065
                                        case 1 when this._reader.ValueAsString.Equals(DxfFileToken.LinkedTableDataRow_BEGIN, StringComparison.InvariantCultureIgnoreCase):
✔
1066
                                                break;
×
1067
                                        case 90:
1068
                                                break;
1,536✔
1069
                                        case 91:
1070
                                                row.CustomData = this._reader.ValueAsInt;
1,408✔
1071
                                                break;
1,408✔
1072
                                        case 300 when this._reader.ValueAsString.Equals(DxfFileToken.ObjectCell, StringComparison.InvariantCultureIgnoreCase):
5,376✔
1073
                                                this.readCell();
5,376✔
1074
                                                break;
5,376✔
1075
                                        case 301 when this._reader.ValueAsString.Equals(DxfFileToken.CustomData, StringComparison.InvariantCultureIgnoreCase):
1,408✔
1076
                                                this.readCustomData();
1,408✔
1077
                                                break;
1,408✔
1078
                                        case 309:
1079
                                                end = this._reader.ValueAsString.Equals(DxfFileToken.LinkedTableDataRow_END, StringComparison.InvariantCultureIgnoreCase);
1,408✔
1080
                                                break;
1,408✔
1081
                                        default:
1082
                                                this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readLinkedTableRow)} method.", NotificationType.None);
1,344✔
1083
                                                break;
1,344✔
1084
                                }
1085

1086
                                if (end)
12,480✔
1087
                                {
1,408✔
1088
                                        break;
1,408✔
1089
                                }
1090

1091
                                this._reader.ReadNext();
11,072✔
1092
                        }
11,072✔
1093
                }
1,536✔
1094

1095
                private TableEntity.Cell readCell()
1096
                {
5,376✔
1097
                        this._reader.ReadNext();
5,376✔
1098

1099
                        TableEntity.Cell cell = new TableEntity.Cell();
5,376✔
1100
                        CadTableCellTemplate template = new CadTableCellTemplate(cell);
5,376✔
1101

1102
                        bool end = false;
5,376✔
1103
                        while (this._reader.DxfCode != DxfCode.Start)
16,960✔
1104
                        {
16,832✔
1105
                                switch (this._reader.Code)
16,832✔
1106
                                {
1107
                                        case 1 when this._reader.ValueAsString.Equals("LINKEDTABLEDATACELL_BEGIN", StringComparison.InvariantCultureIgnoreCase):
15,872✔
1108
                                                this.readLinkedTableCell(cell);
5,376✔
1109
                                                break;
5,376✔
1110
                                        case 1 when this._reader.ValueAsString.Equals("FORMATTEDTABLEDATACELL_BEGIN", StringComparison.InvariantCultureIgnoreCase):
10,496✔
1111
                                                this.readFormattedTableCell(cell);
5,248✔
1112
                                                break;
5,248✔
1113
                                        case 1 when this._reader.ValueAsString.Equals("TABLECELL_BEGIN", StringComparison.InvariantCultureIgnoreCase):
5,248✔
1114
                                                this.readTableCell(cell);
5,248✔
1115
                                                end = true;
5,248✔
1116
                                                break;
5,248✔
1117
                                        default:
1118
                                                this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readCell)} method.", NotificationType.None);
960✔
1119
                                                break;
960✔
1120
                                }
1121

1122
                                if (end)
16,832✔
1123
                                {
5,248✔
1124
                                        return cell;
5,248✔
1125
                                }
1126

1127
                                this._reader.ReadNext();
11,584✔
1128
                        }
11,584✔
1129

1130
                        return cell;
128✔
1131
                }
5,376✔
1132

1133
                private void readTableCell(TableEntity.Cell cell)
1134
                {
5,248✔
1135
                        var map = DxfClassMap.Create(cell.GetType(), "TABLECELL_BEGIN");
5,248✔
1136

1137
                        this._reader.ReadNext();
5,248✔
1138

1139
                        bool end = false;
5,248✔
1140
                        while (this._reader.DxfCode != DxfCode.Start)
16,384✔
1141
                        {
16,384✔
1142
                                switch (this._reader.Code)
16,384✔
1143
                                {
1144
                                        //Unknown
1145
                                        case 40:
1146
                                        case 41:
1147
                                                break;
256✔
1148
                                        case 309:
1149
                                                end = this._reader.ValueAsString.Equals("TABLECELL_END", StringComparison.InvariantCultureIgnoreCase);
5,248✔
1150
                                                break;
5,248✔
1151
                                        case 330:
1152
                                                //Unknown handle
1153
                                                break;
128✔
1154
                                        default:
1155
                                                if (!this.tryAssignCurrentValue(cell, map))
10,752!
1156
                                                {
×
1157
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readTableCell)} {this._reader.Position}.", NotificationType.None);
×
1158
                                                }
×
1159
                                                break;
10,752✔
1160
                                }
1161

1162
                                if (end)
16,384✔
1163
                                {
5,248✔
1164
                                        break;
5,248✔
1165
                                }
1166

1167
                                this._reader.ReadNext();
11,136✔
1168
                        }
11,136✔
1169
                }
5,248✔
1170

1171
                private void readFormattedTableCell(TableEntity.Cell cell)
1172
                {
5,248✔
1173
                        var map = DxfClassMap.Create(cell.GetType(), "FORMATTEDTABLEDATACELL_BEGIN");
5,248✔
1174

1175
                        this._reader.ReadNext();
5,248✔
1176

1177
                        bool end = false;
5,248✔
1178
                        while (this._reader.DxfCode != DxfCode.Start)
10,496✔
1179
                        {
10,496✔
1180
                                switch (this._reader.Code)
10,496!
1181
                                {
1182
                                        case 300 when this._reader.ValueAsString.Equals("CELLTABLEFORMAT", StringComparison.InvariantCultureIgnoreCase):
5,248!
1183
                                                this.readCellTableFormat(cell);
5,248✔
1184
                                                continue;
5,248✔
1185
                                        case 309:
1186
                                                end = this._reader.ValueAsString.Equals("FORMATTEDTABLEDATACELL_END", StringComparison.InvariantCultureIgnoreCase);
5,248✔
1187
                                                break;
5,248✔
1188
                                        default:
1189
                                                if (!this.tryAssignCurrentValue(cell, map))
×
1190
                                                {
×
1191
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readFormattedTableCell)} {this._reader.Position}.", NotificationType.None);
×
1192
                                                }
×
1193
                                                break;
×
1194
                                }
1195

1196
                                if (end)
5,248!
1197
                                {
5,248✔
1198
                                        break;
5,248✔
1199
                                }
1200

1201
                                this._reader.ReadNext();
×
1202
                        }
×
1203
                }
5,248✔
1204

1205
                private void readCellTableFormat(TableEntity.Cell cell)
1206
                {
5,248✔
1207
                        var map = DxfClassMap.Create(cell.GetType(), "CELLTABLEFORMAT");
5,248✔
1208

1209
                        this._reader.ReadNext();
5,248✔
1210

1211
                        bool end = false;
5,248✔
1212
                        while (this._reader.Code == 1)
10,496✔
1213
                        {
5,248✔
1214
                                switch (this._reader.Code)
5,248!
1215
                                {
1216
                                        case 1 when this._reader.ValueAsString.Equals("TABLEFORMAT_BEGIN", StringComparison.InvariantCultureIgnoreCase):
5,248!
1217
                                                this.readStyleOverride(new CadCellStyleTemplate(cell.StyleOverride));
5,248✔
1218
                                                break;
5,248✔
1219
                                        case 1 when this._reader.ValueAsString.Equals("CELLSTYLE_BEGIN", StringComparison.InvariantCultureIgnoreCase):
×
1220
                                                this.readCellStyle(new CadCellStyleTemplate());
×
1221
                                                break;
×
1222
                                        default:
1223
                                                if (!this.tryAssignCurrentValue(cell, map))
×
1224
                                                {
×
1225
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readCellTableFormat)} {this._reader.Position}.", NotificationType.None);
×
1226
                                                }
×
1227
                                                break;
×
1228
                                }
1229

1230
                                if (end)
5,248!
1231
                                {
×
1232
                                        break;
×
1233
                                }
1234

1235
                                this._reader.ReadNext();
5,248✔
1236
                        }
5,248✔
1237
                }
5,248✔
1238

1239
                private void readCellStyle(CadCellStyleTemplate template)
1240
                {
×
1241
                        //var map = DxfClassMap.Create(cell.GetType(), "CELLTABLEFORMAT");
1242

1243
                        this._reader.ReadNext();
×
1244

1245
                        bool end = false;
×
1246
                        while (this._reader.Code != 1)
×
1247
                        {
×
1248
                                switch (this._reader.Code)
×
1249
                                {
1250
                                        case 309:
1251
                                                end = this._reader.ValueAsString.Equals("CELLSTYLE_END", StringComparison.InvariantCultureIgnoreCase);
×
1252
                                                break;
×
1253
                                        default:
1254
                                                //if (!this.tryAssignCurrentValue(cell, map))
1255
                                                {
×
1256
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readCellStyle)} {this._reader.Position}.", NotificationType.None);
×
1257
                                                }
×
1258
                                                break;
×
1259
                                }
1260

1261
                                if (end)
×
1262
                                {
×
1263
                                        break;
×
1264
                                }
1265

1266
                                this._reader.ReadNext();
×
1267
                        }
×
1268
                }
×
1269

1270
                private void readLinkedTableCell(TableEntity.Cell cell)
1271
                {
5,376✔
1272
                        var map = DxfClassMap.Create(cell.GetType(), "LINKEDTABLEDATACELL_BEGIN");
5,376✔
1273

1274
                        this._reader.ReadNext();
5,376✔
1275

1276
                        bool end = false;
5,376✔
1277
                        while (this._reader.DxfCode != DxfCode.Start)
53,888✔
1278
                        {
53,760✔
1279
                                switch (this._reader.Code)
53,760✔
1280
                                {
1281
                                        case 95:
1282
                                                //BL 95 Number of cell contents
1283
                                                break;
5,248✔
1284
                                        case 301 when this._reader.ValueAsString.Equals(DxfFileToken.CustomData, StringComparison.InvariantCultureIgnoreCase):
5,376✔
1285
                                                this.readCustomData();
5,376✔
1286
                                                break;
5,376✔
1287
                                        case 302 when this._reader.ValueAsString.Equals("CONTENT", StringComparison.InvariantCultureIgnoreCase):
4,096✔
1288
                                                var c = this.readLinkedTableCellContent();
4,096✔
1289
                                                break;
4,096✔
1290
                                        case 309:
1291
                                                end = this._reader.ValueAsString.Equals("LINKEDTABLEDATACELL_END", StringComparison.InvariantCultureIgnoreCase);
5,248✔
1292
                                                break;
5,248✔
1293
                                        default:
1294
                                                if (!this.tryAssignCurrentValue(cell, map))
33,792✔
1295
                                                {
11,648✔
1296
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readLinkedTableCell)} {this._reader.Position}.", NotificationType.None);
11,648✔
1297
                                                }
11,648✔
1298
                                                break;
33,792✔
1299
                                }
1300

1301
                                if (end)
53,760✔
1302
                                {
5,248✔
1303
                                        break;
5,248✔
1304
                                }
1305

1306
                                this._reader.ReadNext();
48,512✔
1307
                        }
48,512✔
1308
                }
5,376✔
1309

1310
                private CadTableCellContentTemplate readLinkedTableCellContent()
1311
                {
4,096✔
1312
                        TableEntity.CellContent content = new TableEntity.CellContent();
4,096✔
1313
                        CadTableCellContentTemplate template = new CadTableCellContentTemplate(content);
4,096✔
1314
                        var map = DxfClassMap.Create(content.GetType(), "CONTENT");
4,096✔
1315

1316
                        this._reader.ReadNext();
4,096✔
1317

1318
                        bool end = false;
4,096✔
1319
                        while (this._reader.DxfCode != DxfCode.Start)
8,192✔
1320
                        {
8,192✔
1321
                                switch (this._reader.Code)
8,192!
1322
                                {
1323
                                        case 1 when this._reader.ValueAsString.Equals("FORMATTEDCELLCONTENT_BEGIN", StringComparison.InvariantCultureIgnoreCase):
8,192✔
1324
                                                readFormattedCellContent();
4,096✔
1325
                                                end = true;
4,096✔
1326
                                                break;
4,096✔
1327
                                        case 1 when this._reader.ValueAsString.Equals("CELLCONTENT_BEGIN", StringComparison.InvariantCultureIgnoreCase):
4,096!
1328
                                                readCellContent(template);
4,096✔
1329
                                                break;
4,096✔
1330
                                        default:
1331
                                                if (!this.tryAssignCurrentValue(content, map))
×
1332
                                                {
×
1333
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readLinkedTableCellContent)} {this._reader.Position}.", NotificationType.None);
×
1334
                                                }
×
1335
                                                break;
×
1336
                                }
1337

1338
                                if (end)
8,192✔
1339
                                {
4,096✔
1340
                                        break;
4,096✔
1341
                                }
1342

1343
                                this._reader.ReadNext();
4,096✔
1344
                        }
4,096✔
1345

1346
                        return template;
4,096✔
1347
                }
4,096✔
1348

1349
                private void readCellContent(CadTableCellContentTemplate template)
1350
                {
4,096✔
1351
                        TableEntity.CellContent content = template.Content;
4,096✔
1352
                        var map = DxfClassMap.Create(content.GetType(), "CELLCONTENT_BEGIN");
4,096✔
1353

1354
                        this._reader.ReadNext();
4,096✔
1355

1356
                        bool end = false;
4,096✔
1357
                        while (this._reader.DxfCode != DxfCode.Start)
16,384✔
1358
                        {
16,384✔
1359
                                switch (this._reader.Code)
16,384✔
1360
                                {
1361
                                        case 91:
1362
                                                break;
4,096✔
1363
                                        case 300 when this._reader.ValueAsString.Equals("VALUE", StringComparison.InvariantCultureIgnoreCase):
3,712✔
1364
                                                var valueTemplate = this.readCadValue(content.CadValue);
3,712✔
1365
                                                template.CadValueTemplate = valueTemplate;
3,712✔
1366
                                                break;
3,712✔
1367
                                        case 309:
1368
                                                end = this._reader.ValueAsString.Equals("CELLCONTENT_END", StringComparison.InvariantCultureIgnoreCase);
4,096✔
1369
                                                break;
4,096✔
1370
                                        case 340:
1371
                                                template.BlockRecordHandle = this._reader.ValueAsHandle;
384✔
1372
                                                break;
384✔
1373
                                        default:
1374
                                                if (!this.tryAssignCurrentValue(content, map))
4,096!
1375
                                                {
×
1376
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readCellContent)} {this._reader.Position}.", NotificationType.None);
×
1377
                                                }
×
1378
                                                break;
4,096✔
1379
                                }
1380

1381
                                if (end)
16,384✔
1382
                                {
4,096✔
1383
                                        break;
4,096✔
1384
                                }
1385

1386
                                this._reader.ReadNext();
12,288✔
1387
                        }
12,288✔
1388
                }
4,096✔
1389

1390
                private void readFormattedCellContent()
1391
                {
4,096✔
1392
                        TableEntity.ContentFormat format = new();
4,096✔
1393
                        CadTableCellContentFormatTemplate template = new CadTableCellContentFormatTemplate(format);
4,096✔
1394
                        var map = DxfClassMap.Create(format.GetType(), "FORMATTEDCELLCONTENT");
4,096✔
1395

1396
                        this._reader.ReadNext();
4,096✔
1397

1398
                        bool end = false;
4,096✔
1399
                        while (this._reader.DxfCode != DxfCode.Start)
12,288✔
1400
                        {
12,288✔
1401
                                switch (this._reader.Code)
12,288✔
1402
                                {
1403
                                        case 300 when this._reader.ValueAsString.Equals("CONTENTFORMAT", StringComparison.InvariantCultureIgnoreCase):
4,096✔
1404
                                                readContentFormat(template);
4,096✔
1405
                                                break;
4,096✔
1406
                                        case 309:
1407
                                                end = this._reader.ValueAsString.Equals("FORMATTEDCELLCONTENT_END", StringComparison.InvariantCultureIgnoreCase);
4,096✔
1408
                                                break;
4,096✔
1409
                                        default:
1410
                                                if (!this.tryAssignCurrentValue(format, map))
4,096!
1411
                                                {
×
1412
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readFormattedCellContent)} method.", NotificationType.None);
×
1413
                                                }
×
1414
                                                break;
4,096✔
1415
                                }
1416

1417
                                if (end)
12,288✔
1418
                                {
4,096✔
1419
                                        break;
4,096✔
1420
                                }
1421

1422
                                this._reader.ReadNext();
8,192✔
1423
                        }
8,192✔
1424
                }
4,096✔
1425

1426
                private void readContentFormat(CadTableCellContentFormatTemplate template)
1427
                {
9,600✔
1428
                        var format = template.Format;
9,600✔
1429
                        var map = DxfClassMap.Create(format.GetType(), "CONTENTFORMAT_BEGIN");
9,600✔
1430

1431
                        this._reader.ReadNext();
9,600✔
1432

1433
                        bool end = false;
9,600✔
1434
                        while (this._reader.DxfCode != DxfCode.Start)
124,800✔
1435
                        {
124,800✔
1436
                                switch (this._reader.Code)
124,800✔
1437
                                {
1438
                                        case 1 when this._reader.ValueAsString.Equals("CONTENTFORMAT_BEGIN", StringComparison.InvariantCultureIgnoreCase):
9,600✔
1439
                                                break;
9,600✔
1440
                                        case 309:
1441
                                                end = this._reader.ValueAsString.Equals("CONTENTFORMAT_END", StringComparison.InvariantCultureIgnoreCase);
9,600✔
1442
                                                break;
9,600✔
1443
                                        case 340:
1444
                                                template.TextStyleHandle = this._reader.ValueAsHandle;
9,600✔
1445
                                                break;
9,600✔
1446
                                        default:
1447
                                                if (!this.tryAssignCurrentValue(format, map))
96,000!
1448
                                                {
×
1449
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readContentFormat)} method.", NotificationType.None);
×
1450
                                                }
×
1451
                                                break;
96,000✔
1452
                                }
1453

1454
                                if (end)
124,800✔
1455
                                {
9,600✔
1456
                                        break;
9,600✔
1457
                                }
1458

1459
                                this._reader.ReadNext();
115,200✔
1460
                        }
115,200✔
1461
                }
9,600✔
1462

1463
                private void readFormattedTableColumn(TableEntity.Column column)
1464
                {
1,216✔
1465
                        this._reader.ReadNext();
1,216✔
1466

1467
                        bool end = false;
1,216✔
1468
                        while (this._reader.DxfCode != DxfCode.Start)
3,648✔
1469
                        {
3,648✔
1470
                                switch (this._reader.Code)
3,648!
1471
                                {
1472
                                        case 300 when this._reader.ValueAsString.Equals("COLUMNTABLEFORMAT", StringComparison.InvariantCultureIgnoreCase):
1,216!
1473
                                                break;
1,216✔
1474
                                        case 1 when this._reader.ValueAsString.Equals("TABLEFORMAT_BEGIN", StringComparison.InvariantCultureIgnoreCase):
1,216!
1475
                                                this.readStyleOverride(new CadCellStyleTemplate(column.CellStyleOverride));
1,216✔
1476
                                                break;
1,216✔
1477
                                        case 309:
1478
                                                end = this._reader.ValueAsString.Equals(DxfFileToken.FormattedTableDataColumn_END, StringComparison.InvariantCultureIgnoreCase);
1,216✔
1479
                                                break;
1,216✔
1480
                                        default:
1481
                                                this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readFormattedTableColumn)} method.", NotificationType.None);
×
1482
                                                break;
×
1483
                                }
1484

1485
                                if (end)
3,648✔
1486
                                {
1,216✔
1487
                                        break;
1,216✔
1488
                                }
1489

1490
                                this._reader.ReadNext();
2,432✔
1491
                        }
2,432✔
1492
                }
1,216✔
1493

1494
                private void readStyleOverride(CadCellStyleTemplate template)
1495
                {
8,128✔
1496
                        var style = template.Format as TableEntity.CellStyle;
8,128✔
1497
                        var mapstyle = DxfClassMap.Create(style.GetType(), "TABLEFORMAT_STYLE");
8,128✔
1498
                        var mapformat = DxfClassMap.Create(typeof(TableEntity.ContentFormat), "TABLEFORMAT_BEGIN");
8,128✔
1499

1500
                        this._reader.ReadNext();
8,128✔
1501

1502
                        bool end = false;
8,128✔
1503
                        TableEntity.CellEdgeFlags currBorder = TableEntity.CellEdgeFlags.Unknown;
8,128✔
1504
                        while (this._reader.DxfCode != DxfCode.Start)
89,536✔
1505
                        {
89,536✔
1506
                                switch (this._reader.Code)
89,536✔
1507
                                {
1508
                                        case 95:
1509
                                                currBorder = (TableEntity.CellEdgeFlags)this._reader.ValueAsInt;
11,776✔
1510
                                                break;
11,776✔
1511
                                        case 1 when this._reader.ValueAsString.Equals("TABLEFORMAT_BEGIN", StringComparison.InvariantCultureIgnoreCase):
256✔
1512
                                                break;
256✔
1513
                                        case 300 when this._reader.ValueAsString.Equals("CONTENTFORMAT", StringComparison.InvariantCultureIgnoreCase):
5,504✔
1514
                                                readContentFormat(new CadTableCellContentFormatTemplate(new TableEntity.ContentFormat()));
5,504✔
1515
                                                break;
5,504✔
1516
                                        case 301 when this._reader.ValueAsString.Equals("MARGIN", StringComparison.InvariantCultureIgnoreCase):
2,816✔
1517
                                                this.readCellMargin(template);
2,816✔
1518
                                                break;
2,816✔
1519
                                        case 302 when this._reader.ValueAsString.Equals("GRIDFORMAT", StringComparison.InvariantCultureIgnoreCase):
11,776✔
1520
                                                TableEntity.CellBorder border = new TableEntity.CellBorder(currBorder);
11,776✔
1521
                                                this.readGridFormat(template, border);
11,776✔
1522
                                                break;
11,776✔
1523
                                        case 309:
1524
                                                end = this._reader.ValueAsString.Equals("TABLEFORMAT_END", StringComparison.InvariantCultureIgnoreCase);
8,128✔
1525
                                                break;
8,128✔
1526
                                        default:
1527
                                                if (!this.tryAssignCurrentValue(style, mapstyle) && !this.tryAssignCurrentValue(style, mapformat))
49,280!
1528
                                                {
×
1529
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readStyleOverride)} method.", NotificationType.None);
×
1530
                                                }
×
1531
                                                break;
49,280✔
1532
                                }
1533

1534
                                if (end)
89,536✔
1535
                                {
8,128✔
1536
                                        break;
8,128✔
1537
                                }
1538

1539
                                this._reader.ReadNext();
81,408✔
1540
                        }
81,408✔
1541
                }
8,128✔
1542

1543
                private void readGridFormat(CadCellStyleTemplate template, TableEntity.CellBorder border)
1544
                {
11,776✔
1545
                        var map = DxfClassMap.Create(border.GetType(), nameof(TableEntity.CellBorder));
11,776✔
1546

1547
                        this._reader.ReadNext();
11,776✔
1548

1549
                        bool end = false;
11,776✔
1550
                        while (this._reader.DxfCode != DxfCode.Start)
105,984✔
1551
                        {
105,984✔
1552
                                switch (this._reader.Code)
105,984✔
1553
                                {
1554
                                        case 1 when this._reader.ValueAsString.Equals("GRIDFORMAT_BEGIN", StringComparison.InvariantCultureIgnoreCase):
11,776✔
1555
                                                break;
11,776✔
1556
                                        case 62:
1557
                                                border.Color = new Color(this._reader.ValueAsShort);
11,776✔
1558
                                                break;
11,776✔
1559
                                        case 92:
1560
                                                border.LineWeight = (LineWeightType)this._reader.ValueAsInt;
11,776✔
1561
                                                break;
11,776✔
1562
                                        case 93:
1563
                                                border.IsInvisible = this._reader.ValueAsBool;
11,776✔
1564
                                                break;
11,776✔
1565
                                        case 340:
1566
                                                template.BorderLinetypePairs.Add(new Tuple<TableEntity.CellBorder, ulong>(border, this._reader.ValueAsHandle));
11,776✔
1567
                                                break;
11,776✔
1568
                                        case 309:
1569
                                                end = this._reader.ValueAsString.Equals("GRIDFORMAT_END", StringComparison.InvariantCultureIgnoreCase);
11,776✔
1570
                                                break;
11,776✔
1571
                                        default:
1572
                                                if (!this.tryAssignCurrentValue(border, map))
35,328!
1573
                                                {
×
1574
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readGridFormat)} method.", NotificationType.None);
×
1575
                                                }
×
1576
                                                break;
35,328✔
1577
                                }
1578

1579
                                if (end)
105,984✔
1580
                                {
11,776✔
1581
                                        break;
11,776✔
1582
                                }
1583

1584
                                this._reader.ReadNext();
94,208✔
1585
                        }
94,208✔
1586
                }
11,776✔
1587

1588
                private void readCellMargin(CadCellStyleTemplate template)
1589
                {
2,816✔
1590
                        var style = template.Format as TableEntity.CellStyle;
2,816✔
1591

1592
                        this._reader.ReadNext();
2,816✔
1593

1594
                        bool end = false;
2,816✔
1595
                        int i = 0;
2,816✔
1596
                        while (this._reader.DxfCode != DxfCode.Start)
22,528✔
1597
                        {
22,528✔
1598
                                switch (this._reader.Code)
22,528!
1599
                                {
1600
                                        case 1 when this._reader.ValueAsString.Equals("CELLMARGIN_BEGIN", StringComparison.InvariantCultureIgnoreCase):
2,816!
1601
                                                break;
2,816✔
1602
                                        case 40:
1603
                                                switch (i)
16,896✔
1604
                                                {
1605
                                                        case 0:
1606
                                                                style.VerticalMargin = this._reader.ValueAsDouble;
2,816✔
1607
                                                                break;
2,816✔
1608
                                                        case 1:
1609
                                                                style.HorizontalMargin = this._reader.ValueAsDouble;
2,816✔
1610
                                                                break;
2,816✔
1611
                                                        case 2:
1612
                                                                style.BottomMargin = this._reader.ValueAsDouble;
2,816✔
1613
                                                                break;
2,816✔
1614
                                                        case 3:
1615
                                                                style.RightMargin = this._reader.ValueAsDouble;
2,816✔
1616
                                                                break;
2,816✔
1617
                                                        case 4:
1618
                                                                style.MarginHorizontalSpacing = this._reader.ValueAsDouble;
2,816✔
1619
                                                                break;
2,816✔
1620
                                                        case 5:
1621
                                                                style.MarginVerticalSpacing = this._reader.ValueAsDouble;
2,816✔
1622
                                                                break;
2,816✔
1623
                                                }
1624

1625
                                                i++;
16,896✔
1626
                                                break;
16,896✔
1627
                                        case 309:
1628
                                                end = this._reader.ValueAsString.Equals("CELLMARGIN_END", StringComparison.InvariantCultureIgnoreCase);
2,816✔
1629
                                                break;
2,816✔
1630
                                        default:
1631
                                                this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readCellMargin)} method.", NotificationType.None);
×
1632
                                                break;
×
1633
                                }
1634

1635
                                if (end)
22,528✔
1636
                                {
2,816✔
1637
                                        break;
2,816✔
1638
                                }
1639

1640
                                this._reader.ReadNext();
19,712✔
1641
                        }
19,712✔
1642
                }
2,816✔
1643

1644
                private void readCustomData()
1645
                {
8,000✔
1646
                        this._reader.ReadNext();
8,000✔
1647

1648
                        int ndata = 0;
8,000✔
1649
                        bool end = false;
8,000✔
1650
                        while (this._reader.DxfCode != DxfCode.Start)
74,432✔
1651
                        {
74,304✔
1652
                                switch (this._reader.Code)
74,304✔
1653
                                {
1654
                                        case 1 when this._reader.ValueAsString.Equals("DATAMAP_BEGIN", StringComparison.InvariantCultureIgnoreCase):
8,000✔
1655
                                                break;
8,000✔
1656
                                        case 90:
1657
                                                ndata = this._reader.ValueAsInt;
8,128✔
1658
                                                break;
8,128✔
1659
                                        case 300:
1660
                                                //Name
1661
                                                break;
5,248✔
1662
                                        case 301 when this._reader.ValueAsString.Equals("DATAMAP_VALUE", StringComparison.InvariantCultureIgnoreCase):
5,248✔
1663
                                                this.readDataMapValue();
5,248✔
1664
                                                break;
5,248✔
1665
                                        case 309:
1666
                                                end = this._reader.ValueAsString.Equals("DATAMAP_END", StringComparison.InvariantCultureIgnoreCase);
7,872✔
1667
                                                break;
7,872✔
1668
                                        default:
1669
                                                this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readCustomData)} method.", NotificationType.None);
39,808✔
1670
                                                break;
39,808✔
1671
                                }
1672

1673
                                if (end)
74,304✔
1674
                                {
7,872✔
1675
                                        break;
7,872✔
1676
                                }
1677

1678
                                this._reader.ReadNext();
66,432✔
1679
                        }
66,432✔
1680
                }
8,000✔
1681

1682
                private void readDataMapValue()
1683
                {
5,248✔
1684
                        CadValue value = new();
5,248✔
1685
                        var map = DxfClassMap.Create(value.GetType(), "DATAMAP_VALUE");
5,248✔
1686

1687
                        this._reader.ReadNext();
5,248✔
1688

1689
                        bool end = false;
5,248✔
1690
                        while (this._reader.DxfCode != DxfCode.Start)
305,024✔
1691
                        {
304,896✔
1692
                                switch (this._reader.Code)
304,896✔
1693
                                {
1694
                                        case 11:
1695
                                        case 21:
1696
                                        case 31:
1697
                                                //Value as point
1698
                                                break;
384✔
1699
                                        case 91:
1700
                                        case 92:
1701
                                                //Value as int
1702
                                                break;
38,656✔
1703
                                        case 140:
1704
                                                //Value as double
1705
                                                break;
12,736✔
1706
                                        case 310:
1707
                                                //Value as byte array
1708
                                                break;
128✔
1709
                                        case 304:
1710
                                                end = this._reader.ValueAsString.Equals("ACVALUE_END", StringComparison.InvariantCultureIgnoreCase);
5,120✔
1711
                                                break;
5,120✔
1712
                                        default:
1713
                                                if (!this.tryAssignCurrentValue(value, map))
247,872✔
1714
                                                {
140,288✔
1715
                                                        this._builder.Notify($"Unhandled dxf code {this._reader.Code} value {this._reader.ValueAsString} at {nameof(readDataMapValue)} method.", NotificationType.None);
140,288✔
1716
                                                }
140,288✔
1717
                                                break;
247,872✔
1718
                                }
1719

1720
                                if (end)
304,896✔
1721
                                {
5,120✔
1722
                                        break;
5,120✔
1723
                                }
1724

1725
                                this._reader.ReadNext();
299,776✔
1726
                        }
299,776✔
1727
                }
5,248✔
1728

1729
                private bool readVisualStyle(CadTemplate template, DxfMap map)
1730
                {
379,506✔
1731
                        switch (this._reader.Code)
379,506✔
1732
                        {
1733
                                // Undocumented codes
1734
                                case 176:
1735
                                case 177:
1736
                                case 420:
1737
                                        return true;
123,592✔
1738
                                default:
1739
                                        //Avoid noise while is not implemented
1740
                                        return true;
255,914✔
1741
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.VisualStyle]);
1742
                        }
1743
                }
379,506✔
1744

1745
                private bool readSpatialFilter(CadTemplate template, DxfMap map)
1746
                {
4,032✔
1747
                        CadSpatialFilterTemplate tmp = template as CadSpatialFilterTemplate;
4,032✔
1748
                        SpatialFilter filter = tmp.CadObject as SpatialFilter;
4,032✔
1749

1750
                        switch (this._reader.Code)
4,032✔
1751
                        {
1752
                                case 10:
1753
                                        filter.BoundaryPoints.Add(new CSMath.XY(this._reader.ValueAsDouble, 0));
384✔
1754
                                        return true;
384✔
1755
                                case 20:
1756
                                        var pt = filter.BoundaryPoints.LastOrDefault();
384✔
1757
                                        filter.BoundaryPoints.Add(new CSMath.XY(pt.X, this._reader.ValueAsDouble));
384✔
1758
                                        return true;
384✔
1759
                                case 40:
1760
                                        if (filter.ClipFrontPlane && !tmp.HasFrontPlane)
384!
1761
                                        {
×
1762
                                                filter.FrontDistance = this._reader.ValueAsDouble;
×
1763
                                                tmp.HasFrontPlane = true;
×
1764
                                        }
×
1765

1766
                                        double[] array = new double[16]
384✔
1767
                                        {
384✔
1768
                                                0.0, 0.0, 0.0, 0.0,
384✔
1769
                                                0.0, 0.0, 0.0, 0.0,
384✔
1770
                                                0.0, 0.0, 0.0, 0.0,
384✔
1771
                                                0.0, 0.0, 0.0, 1.0
384✔
1772
                                        };
384✔
1773

1774
                                        for (int i = 0; i < 12; i++)
9,984✔
1775
                                        {
4,608✔
1776
                                                array[i] = this._reader.ValueAsDouble;
4,608✔
1777

1778
                                                if (i < 11)
4,608✔
1779
                                                {
4,224✔
1780
                                                        this._reader.ReadNext();
4,224✔
1781
                                                }
4,224✔
1782
                                        }
4,608✔
1783

1784
                                        if (tmp.InsertTransformRead)
384!
1785
                                        {
×
1786
                                                filter.InsertTransform = new Matrix4(array);
×
1787
                                                tmp.InsertTransformRead = true;
×
1788
                                        }
×
1789
                                        else
1790
                                        {
384✔
1791
                                                filter.InverseInsertTransform = new Matrix4(array);
384✔
1792
                                        }
384✔
1793

1794
                                        return true;
384✔
1795
                                case 73:
1796
                                default:
1797
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.SpatialFilter]);
2,880✔
1798
                        }
1799
                }
4,032✔
1800

1801
                private bool readMLineStyle(CadTemplate template, DxfMap map)
1802
                {
3,529✔
1803
                        var tmp = template as CadMLineStyleTemplate;
3,529✔
1804
                        var mLineStyle = template.CadObject as MLineStyle;
3,529✔
1805

1806
                        switch (this._reader.Code)
3,529✔
1807
                        {
1808
                                case 6:
1809
                                        var t = tmp.ElementTemplates.LastOrDefault();
418✔
1810
                                        if (t == null)
418!
1811
                                        {
×
1812
                                                return true;
×
1813
                                        }
1814
                                        t.LineTypeName = this._reader.ValueAsString;
418✔
1815
                                        return true;
418✔
1816
                                case 49:
1817
                                        MLineStyle.Element element = new MLineStyle.Element();
418✔
1818
                                        CadMLineStyleTemplate.ElementTemplate elementTemplate = new CadMLineStyleTemplate.ElementTemplate(element);
418✔
1819
                                        element.Offset = this._reader.ValueAsDouble;
418✔
1820

1821
                                        tmp.ElementTemplates.Add(elementTemplate);
418✔
1822
                                        mLineStyle.AddElement(element);
418✔
1823
                                        return true;
418✔
1824
                                default:
1825
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[tmp.CadObject.SubclassMarker]);
2,693✔
1826
                        }
1827
                }
3,529✔
1828

1829
                private bool readTableStyle(CadTemplate template, DxfMap map)
1830
                {
17,845✔
1831
                        var tmp = template as CadTableStyleTemplate;
17,845✔
1832
                        var style = tmp.CadObject;
17,845✔
1833
                        var cellStyle = tmp.CurrentCellStyleTemplate?.CellStyle;
17,845✔
1834

1835
                        switch (this._reader.Code)
17,845!
1836
                        {
1837
                                case 7:
1838
                                        tmp.CreateCurrentCellStyleTemplate();
591✔
1839
                                        tmp.CurrentCellStyleTemplate.TextStyleName = this._reader.ValueAsString;
591✔
1840
                                        return true;
591✔
1841
                                case 94:
1842
                                        cellStyle.Alignment = this._reader.ValueAsInt;
×
1843
                                        return true;
×
1844
                                case 62:
1845
                                        cellStyle.Color = new Color(this._reader.ValueAsShort);
591✔
1846
                                        return true;
591✔
1847
                                case 63:
1848
                                        cellStyle.BackgroundColor = new Color(this._reader.ValueAsShort);
591✔
1849
                                        return true;
591✔
1850
                                case 140:
1851
                                        cellStyle.TextHeight = this._reader.ValueAsDouble;
591✔
1852
                                        return true;
591✔
1853
                                case 170:
1854
                                        cellStyle.CellAlignment = (TableEntity.CellAlignmentType)this._reader.ValueAsShort;
591✔
1855
                                        return true;
591✔
1856
                                case 283:
1857
                                        cellStyle.IsFillColorOn = this._reader.ValueAsBool;
591✔
1858
                                        return true;
591✔
1859
                                case 90:
1860
                                        cellStyle.Type = (TableEntity.CellStyleType)this._reader.ValueAsShort;
399✔
1861
                                        return true;
399✔
1862
                                case 91:
1863
                                        cellStyle.StyleClass = (TableEntity.CellStyleClass)this._reader.ValueAsShort;
399✔
1864
                                        return true;
399✔
1865
                                case 1:
1866
                                        //Undocumented
1867
                                        return true;
399✔
1868
                                case 274:
1869
                                        cellStyle.TopBorder.LineWeight = (LineWeightType)this._reader.ValueAsInt;
591✔
1870
                                        return true;
591✔
1871
                                case 275:
1872
                                        cellStyle.HorizontalInsideBorder.LineWeight = (LineWeightType)this._reader.ValueAsInt;
591✔
1873
                                        return true;
591✔
1874
                                case 276:
1875
                                        cellStyle.BottomBorder.LineWeight = (LineWeightType)this._reader.ValueAsInt;
591✔
1876
                                        return true;
591✔
1877
                                case 277:
1878
                                        cellStyle.LeftBorder.LineWeight = (LineWeightType)this._reader.ValueAsInt;
591✔
1879
                                        return true;
591✔
1880
                                case 278:
1881
                                        cellStyle.VerticalInsideBorder.LineWeight = (LineWeightType)this._reader.ValueAsInt;
591✔
1882
                                        return true;
591✔
1883
                                case 279:
1884
                                        cellStyle.RightBorder.LineWeight = (LineWeightType)this._reader.ValueAsInt;
591✔
1885
                                        return true;
591✔
1886
                                case 284:
1887
                                        cellStyle.TopBorder.IsInvisible = this._reader.ValueAsBool;
591✔
1888
                                        return true;
591✔
1889
                                case 285:
1890
                                        cellStyle.HorizontalInsideBorder.IsInvisible = this._reader.ValueAsBool;
591✔
1891
                                        return true;
591✔
1892
                                case 286:
1893
                                        cellStyle.BottomBorder.IsInvisible = this._reader.ValueAsBool;
591✔
1894
                                        return true;
591✔
1895
                                case 287:
1896
                                        cellStyle.LeftBorder.IsInvisible = this._reader.ValueAsBool;
591✔
1897
                                        return true;
591✔
1898
                                case 288:
1899
                                        cellStyle.VerticalInsideBorder.IsInvisible = this._reader.ValueAsBool;
591✔
1900
                                        return true;
591✔
1901
                                case 289:
1902
                                        cellStyle.RightBorder.IsInvisible = this._reader.ValueAsBool;
591✔
1903
                                        return true;
591✔
1904
                                case 64:
1905
                                        cellStyle.TopBorder.Color = new Color(this._reader.ValueAsShort);
591✔
1906
                                        return true;
591✔
1907
                                case 65:
1908
                                        cellStyle.HorizontalInsideBorder.Color = new Color(this._reader.ValueAsShort);
591✔
1909
                                        return true;
591✔
1910
                                case 66:
1911
                                        cellStyle.BottomBorder.Color = new Color(this._reader.ValueAsShort);
591✔
1912
                                        return true;
591✔
1913
                                case 67:
1914
                                        cellStyle.LeftBorder.Color = new Color(this._reader.ValueAsShort);
591✔
1915
                                        return true;
591✔
1916
                                case 68:
1917
                                        cellStyle.VerticalInsideBorder.Color = new Color(this._reader.ValueAsShort);
591✔
1918
                                        return true;
591✔
1919
                                case 69:
1920
                                        cellStyle.RightBorder.Color = new Color(this._reader.ValueAsShort);
591✔
1921
                                        return true;
591✔
1922
                                default:
1923
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[tmp.CadObject.SubclassMarker]);
2,464✔
1924
                        }
1925
                }
17,845✔
1926

1927
                private bool readMLeaderStyle(CadTemplate template, DxfMap map)
1928
                {
18,636✔
1929
                        var tmp = template as CadMLeaderStyleTemplate;
18,636✔
1930

1931
                        switch (this._reader.Code)
18,636✔
1932
                        {
1933
                                case 179:
1934
                                        return true;
212✔
1935
                                case 340:
1936
                                        tmp.LeaderLineTypeHandle = this._reader.ValueAsHandle;
406✔
1937
                                        return true;
406✔
1938
                                case 342:
1939
                                        tmp.MTextStyleHandle = this._reader.ValueAsHandle;
406✔
1940
                                        return true;
406✔
1941
                                default:
1942
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[tmp.CadObject.SubclassMarker]);
17,612✔
1943
                        }
1944
                }
18,636✔
1945

1946
                private bool readEvaluationExpression(CadTemplate template, DxfMap map)
1947
                {
13,737✔
1948
                        CadEvaluationExpressionTemplate tmp = template as CadEvaluationExpressionTemplate;
13,737✔
1949

1950
                        switch (this._reader.Code)
13,737✔
1951
                        {
1952
                                case 1:
1953
                                        this._reader.ExpectedCode(70);
1,158✔
1954
                                        this._reader.ExpectedCode(140);
1,158✔
1955
                                        return true;
1,158✔
1956
                                default:
1957
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.EvalGraphExpr]);
12,579✔
1958
                        }
1959
                }
13,737✔
1960

1961
                private bool readBlockElement(CadTemplate template, DxfMap map)
1962
                {
5,249✔
1963
                        CadBlockElementTemplate tmp = template as CadBlockElementTemplate;
5,249✔
1964

1965
                        switch (this._reader.Code)
5,249✔
1966
                        {
1967
                                default:
1968
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.BlockElement]))
5,249✔
1969
                                        {
4,473✔
1970
                                                return this.readEvaluationExpression(template, map);
4,473✔
1971
                                        }
1972
                                        return true;
776✔
1973
                        }
1974
                }
5,249✔
1975

1976
                private bool readBlockAction(CadTemplate template, DxfMap map)
1977
                {
20✔
1978
                        CadBlockActionTemplate tmp = template as CadBlockActionTemplate;
20✔
1979

1980
                        switch (this._reader.Code)
20✔
1981
                        {
1982
                                default:
1983
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.BlockAction]))
20✔
1984
                                        {
15✔
1985
                                                return this.readBlockElement(template, map);
15✔
1986
                                        }
1987
                                        return true;
5✔
1988
                        }
1989
                }
20✔
1990

1991
                private bool readBlockActionBasePt(CadTemplate template, DxfMap map)
1992
                {
31✔
1993
                        CadBlockActionBasePtTemplate tmp = template as CadBlockActionBasePtTemplate;
31✔
1994

1995
                        switch (this._reader.Code)
31✔
1996
                        {
1997
                                default:
1998
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.BlockActionBasePt]))
31✔
1999
                                        {
20✔
2000
                                                return this.readBlockAction(template, map);
20✔
2001
                                        }
2002
                                        return true;
11✔
2003
                        }
2004
                }
31✔
2005

2006
                private bool readBlockRotationAction(CadTemplate template, DxfMap map)
2007
                {
33✔
2008
                        CadBlockRotationActionTemplate tmp = template as CadBlockRotationActionTemplate;
33✔
2009

2010
                        switch (this._reader.Code)
33✔
2011
                        {
2012
                                default:
2013
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.BlockRotationAction]))
33✔
2014
                                        {
31✔
2015
                                                return this.readBlockActionBasePt(template, map);
31✔
2016
                                        }
2017
                                        return true;
2✔
2018
                        }
2019
                }
33✔
2020

2021
                private bool readBlockParameter(CadTemplate template, DxfMap map)
2022
                {
3,291✔
2023
                        CadBlockParameterTemplate tmp = template as CadBlockParameterTemplate;
3,291✔
2024

2025
                        switch (this._reader.Code)
3,291✔
2026
                        {
2027
                                default:
2028
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.BlockParameter]))
3,291✔
2029
                                        {
2,712✔
2030
                                                return this.readBlockElement(template, map);
2,712✔
2031
                                        }
2032
                                        return true;
579✔
2033
                        }
2034
                }
3,291✔
2035

2036
                private bool readBlock1PtParameter(CadTemplate template, DxfMap map)
2037
                {
4,246✔
2038
                        CadBlock1PtParameterTemplate tmp = template as CadBlock1PtParameterTemplate;
4,246✔
2039

2040
                        switch (this._reader.Code)
4,246✔
2041
                        {
2042
                                default:
2043
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.Block1PtParameter]))
4,246✔
2044
                                        {
3,281✔
2045
                                                return this.readBlockParameter(template, map);
3,281✔
2046
                                        }
2047
                                        return true;
965✔
2048
                        }
2049
                }
4,246✔
2050

2051
                private bool readBlock2PtParameter(CadTemplate template, DxfMap map)
2052
                {
14✔
2053
                        var tmp = template as CadBlock2PtParameterTemplate;
14✔
2054

2055
                        switch (this._reader.Code)
14✔
2056
                        {
2057
                                //Stores always 4 entries using this code
2058
                                case 91:
2059
                                        return true;
4✔
2060
                                default:
2061
                                        if (!this.tryAssignCurrentValue(template.CadObject, map))
10!
2062
                                        {
10✔
2063
                                                return this.readBlockParameter(template, map);
10✔
2064
                                        }
2065
                                        return true;
×
2066
                        }
2067
                }
14✔
2068

2069
                private bool readBlockVisibilityParameter(CadTemplate template, DxfMap map)
2070
                {
5,404✔
2071
                        CadBlockVisibilityParameterTemplate tmp = template as CadBlockVisibilityParameterTemplate;
5,404✔
2072

2073
                        switch (this._reader.Code)
5,404✔
2074
                        {
2075
                                case 92:
2076
                                        var stateCount = this._reader.ValueAsInt;
193✔
2077
                                        for (int i = 0; i < stateCount; i++)
1,930✔
2078
                                        {
772✔
2079
                                                this._reader.ReadNext();
772✔
2080
                                                tmp.StateTemplates.Add(this.readState());
772✔
2081
                                        }
772✔
2082
                                        return true;
193✔
2083
                                case 93 when this.currentSubclass == DxfSubclassMarker.BlockVisibilityParameter:
386✔
2084
                                        var entityCount = this._reader.ValueAsInt;
193✔
2085
                                        for (int i = 0; i < entityCount; i++)
780✔
2086
                                        {
197✔
2087
                                                this._reader.ReadNext();
197✔
2088
                                                tmp.EntityHandles.Add(this._reader.ValueAsHandle);
197✔
2089
                                        }
197✔
2090
                                        return true;
193✔
2091
                                default:
2092
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.BlockVisibilityParameter]))
5,018✔
2093
                                        {
4,246✔
2094
                                                return this.readBlock1PtParameter(template, map);
4,246✔
2095
                                        }
2096
                                        return true;
772✔
2097
                        }
2098
                }
5,404✔
2099

2100
                private bool readBlockRotationParameter(CadTemplate template, DxfMap map)
2101
                {
49✔
2102
                        var tmp = template as CadBlockRotationParameterTemplate;
49✔
2103

2104
                        switch (this._reader.Code)
49✔
2105
                        {
2106
                                default:
2107
                                        if (!this.tryAssignCurrentValue(template.CadObject, map))
49✔
2108
                                        {
14✔
2109
                                                return this.readBlock2PtParameter(template, map);
14✔
2110
                                        }
2111
                                        return true;
35✔
2112
                        }
2113
                }
49✔
2114

2115
                private CadBlockVisibilityParameterTemplate.StateTemplate readState()
2116
                {
772✔
2117
                        var state = new BlockVisibilityParameter.State();
772✔
2118
                        var template = new CadBlockVisibilityParameterTemplate.StateTemplate(state);
772✔
2119

2120
                        List<int> expectedCodes = new List<int>();
772✔
2121
                        expectedCodes.Add(303);
772✔
2122
                        expectedCodes.Add(94);
772✔
2123
                        expectedCodes.Add(95);
772✔
2124

2125
                        while (this._reader.DxfCode != DxfCode.Start)
2,316✔
2126
                        {
2,316✔
2127
                                expectedCodes.Remove(this._reader.Code);
2,316✔
2128

2129
                                switch (this._reader.Code)
2,316!
2130
                                {
2131
                                        case 303:
2132
                                                state.Name = this._reader.ValueAsString;
772✔
2133
                                                break;
772✔
2134
                                        case 94:
2135
                                                var count = this._reader.ValueAsInt;
772✔
2136
                                                for (int i = 0; i < count; i++)
2,720✔
2137
                                                {
588✔
2138
                                                        this._reader.ReadNext();
588✔
2139
                                                        template.EntityHandles.Add(this._reader.ValueAsHandle);
588✔
2140
                                                }
588✔
2141
                                                break;
772✔
2142
                                        case 95:
2143
                                                count = this._reader.ValueAsInt;
772✔
2144
                                                for (int i = 0; i < count; i++)
6,152✔
2145
                                                {
2,304✔
2146
                                                        this._reader.ReadNext();
2,304✔
2147
                                                        template.ExpressionHandles.Add(this._reader.ValueAsHandle);
2,304✔
2148
                                                }
2,304✔
2149
                                                break;
772✔
2150
                                        default:
2151
                                                return template;
×
2152
                                }
2153

2154
                                if (!expectedCodes.Any())
2,316✔
2155
                                {
772✔
2156
                                        break;
772✔
2157
                                }
2158

2159
                                this._reader.ReadNext();
1,544✔
2160
                        }
1,544✔
2161

2162
                        return template;
772✔
2163
                }
772✔
2164

2165
                private bool readBlockGrip(CadTemplate template, DxfMap map)
2166
                {
3,880✔
2167
                        CadBlockGripTemplate tmp = template as CadBlockGripTemplate;
3,880✔
2168

2169
                        switch (this._reader.Code)
3,880✔
2170
                        {
2171
                                default:
2172
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.BlockGrip]))
3,880✔
2173
                                        {
2,522✔
2174
                                                return this.readBlockElement(template, map);
2,522✔
2175
                                        }
2176
                                        return true;
1,358✔
2177
                        }
2178
                }
3,880✔
2179

2180
                private bool readBlockRotationGrip(CadTemplate template, DxfMap map)
2181
                {
20✔
2182
                        CadBlockRotationGripTemplate tmp = template as CadBlockRotationGripTemplate;
20✔
2183

2184
                        switch (this._reader.Code)
20✔
2185
                        {
2186
                                default:
2187
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.BlockRotationGrip]))
20!
2188
                                        {
20✔
2189
                                                return this.readBlockGrip(template, map);
20✔
2190
                                        }
2191
                                        return true;
×
2192
                        }
2193
                }
20✔
2194

2195
                private bool readBlockVisibilityGrip(CadTemplate template, DxfMap map)
2196
                {
3,860✔
2197
                        CadBlockVisibilityGripTemplate tmp = template as CadBlockVisibilityGripTemplate;
3,860✔
2198

2199
                        switch (this._reader.Code)
3,860✔
2200
                        {
2201
                                default:
2202
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.BlockVisibilityGrip]))
3,860!
2203
                                        {
3,860✔
2204
                                                return this.readBlockGrip(template, map);
3,860✔
2205
                                        }
2206
                                        return true;
×
2207
                        }
2208
                }
3,860✔
2209

2210
                private bool readBlockRepresentationData(CadTemplate template, DxfMap map)
2211
                {
1,590✔
2212
                        CadBlockRepresentationDataTemplate tmp = template as CadBlockRepresentationDataTemplate;
1,590✔
2213

2214
                        switch (this._reader.Code)
1,590✔
2215
                        {
2216
                                case 340:
2217
                                        tmp.BlockHandle = this._reader.ValueAsHandle;
265✔
2218
                                        return true;
265✔
2219
                                default:
2220
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[tmp.CadObject.SubclassMarker]);
1,325✔
2221
                        }
2222
                }
1,590✔
2223

2224
                private bool readBlockGripExpression(CadTemplate template, DxfMap map)
2225
                {
11,580✔
2226
                        CadBlockGripExpressionTemplate tmp = template as CadBlockGripExpressionTemplate;
11,580✔
2227

2228
                        switch (this._reader.Code)
11,580✔
2229
                        {
2230
                                default:
2231
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.BlockGripExpression]))
11,580✔
2232
                                        {
9,264✔
2233
                                                return this.readEvaluationExpression(template, map);
9,264✔
2234
                                        }
2235
                                        return true;
2,316✔
2236
                        }
2237
                }
11,580✔
2238

2239
                private bool readXRecord(CadTemplate template, DxfMap map)
2240
                {
113,272✔
2241
                        CadXRecordTemplate tmp = template as CadXRecordTemplate;
113,272✔
2242

2243
                        switch (this._reader.Code)
113,272✔
2244
                        {
2245
                                case 100 when this._reader.ValueAsString == DxfSubclassMarker.XRecord:
28,926✔
2246
                                        this.readXRecordEntries(tmp);
28,926✔
2247
                                        return true;
28,926✔
2248
                                default:
2249
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.XRecord]);
84,346✔
2250
                        }
2251
                }
113,272✔
2252

2253
                private void readXRecordEntries(CadXRecordTemplate template)
2254
                {
28,926✔
2255
                        this._reader.ReadNext();
28,926✔
2256

2257
                        while (this._reader.DxfCode != DxfCode.Start)
2,409,286✔
2258
                        {
2,380,360✔
2259
                                switch (this._reader.GroupCodeValue)
2,380,360✔
2260
                                {
2261
                                        case GroupCodeValueType.Point3D:
2262
                                                var code = this._reader.Code;
2,901✔
2263
                                                var x = this._reader.ValueAsDouble;
2,901✔
2264
                                                this._reader.ReadNext();
2,901✔
2265
                                                var y = this._reader.ValueAsDouble;
2,901✔
2266
                                                this._reader.ReadNext();
2,901✔
2267
                                                var z = this._reader.ValueAsDouble;
2,901✔
2268
                                                XYZ pt = new XYZ(x, y, z);
2,901✔
2269
                                                template.CadObject.CreateEntry(code, pt);
2,901✔
2270
                                                break;
2,901✔
2271
                                        case GroupCodeValueType.Handle:
2272
                                        case GroupCodeValueType.ObjectId:
2273
                                        case GroupCodeValueType.ExtendedDataHandle:
2274
                                                template.AddHandleReference(this._reader.Code, this._reader.ValueAsHandle);
12,041✔
2275
                                                break;
12,041✔
2276
                                        default:
2277
                                                template.CadObject.CreateEntry(this._reader.Code, this._reader.Value);
2,365,418✔
2278
                                                break;
2,365,418✔
2279
                                }
2280

2281
                                this._reader.ReadNext();
2,380,360✔
2282
                        }
2,380,360✔
2283
                }
28,926✔
2284

2285
                private bool readBookColor(CadTemplate template, DxfMap map)
2286
                {
1,376✔
2287
                        CadNonGraphicalObjectTemplate tmp = template as CadNonGraphicalObjectTemplate;
1,376✔
2288
                        BookColor color = tmp.CadObject as BookColor;
1,376✔
2289

2290
                        switch (this._reader.Code)
1,376✔
2291
                        {
2292
                                case 430:
2293
                                        color.Name = this._reader.ValueAsString;
160✔
2294
                                        return true;
160✔
2295
                                default:
2296
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.DbColor]);
1,216✔
2297
                        }
2298
                }
1,376✔
2299

2300
                private bool readDimensionAssociation(CadTemplate template, DxfMap map)
2301
                {
5,376✔
2302
                        CadDimensionAssociationTemplate tmp = template as CadDimensionAssociationTemplate;
5,376✔
2303
                        DimensionAssociation dimassoc = tmp.CadObject;
5,376✔
2304

2305
                        switch (this._reader.Code)
5,376✔
2306
                        {
2307
                                case 1 when this._reader.ValueAsString.Equals(DimensionAssociation.OsnapPointRefClassName):
768✔
2308
                                        if (dimassoc.AssociativityFlags.HasFlag(AssociativityFlags.FirstPointReference)
768✔
2309
                                                && dimassoc.FirstPointRef == null)
768✔
2310
                                        {
192✔
2311
                                                dimassoc.FirstPointRef = new DimensionAssociation.OsnapPointRef();
192✔
2312
                                                this.readOsnapPointRef(dimassoc.FirstPointRef);
192✔
2313
                                                this.lockPointer = true;
192✔
2314
                                                return true;
192✔
2315
                                        }
2316

2317
                                        if (dimassoc.AssociativityFlags.HasFlag(AssociativityFlags.SecondPointReference)
576!
2318
                                                && dimassoc.SecondPointRef == null)
576✔
2319
                                        {
576✔
2320
                                                dimassoc.SecondPointRef = new DimensionAssociation.OsnapPointRef();
576✔
2321
                                                this.readOsnapPointRef(dimassoc.SecondPointRef);
576✔
2322
                                                this.lockPointer = true;
576✔
2323
                                                return true;
576✔
2324
                                        }
2325

2326
                                        if (dimassoc.AssociativityFlags.HasFlag(AssociativityFlags.ThirdPointReference)
×
2327
                                                && dimassoc.ThirdPointRef == null)
×
2328
                                        {
×
2329
                                                dimassoc.ThirdPointRef = new DimensionAssociation.OsnapPointRef();
×
2330
                                                this.readOsnapPointRef(dimassoc.ThirdPointRef);
×
2331
                                                this.lockPointer = true;
×
2332
                                                return true;
×
2333
                                        }
2334

2335
                                        if (dimassoc.AssociativityFlags.HasFlag(AssociativityFlags.FourthPointReference)
×
2336
                                                && dimassoc.FourthPointRef == null)
×
2337
                                        {
×
2338
                                                dimassoc.FourthPointRef = new DimensionAssociation.OsnapPointRef();
×
2339
                                                this.readOsnapPointRef(dimassoc.FourthPointRef);
×
2340
                                                this.lockPointer = true;
×
2341
                                                return true;
×
2342
                                        }
2343

2344
                                        return true;
×
2345
                                case 330 when template.OwnerHandle.HasValue:
1,152✔
2346
                                        tmp.DimensionHandle = this._reader.ValueAsHandle;
576✔
2347
                                        return true;
576✔
2348
                                default:
2349
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[tmp.CadObject.SubclassMarker]);
4,032✔
2350
                        }
2351
                }
5,376✔
2352

2353
                private CadDimensionAssociationTemplate.OsnapPointRefTemplate readOsnapPointRef(DimensionAssociation.OsnapPointRef osnapPoint)
2354
                {
768✔
2355
                        var template = new CadDimensionAssociationTemplate.OsnapPointRefTemplate(osnapPoint);
768✔
2356

2357
                        this._reader.ReadNext();
768✔
2358

2359
                        bool end = false;
768✔
2360
                        while (!end)
8,448✔
2361
                        {
7,680✔
2362
                                switch (this._reader.Code)
7,680!
2363
                                {
2364
                                        case 10:
2365
                                                osnapPoint.OsnapPoint = new XYZ(
768✔
2366
                                                        this._reader.ValueAsDouble,
768✔
2367
                                                        osnapPoint.OsnapPoint.Y,
768✔
2368
                                                        osnapPoint.OsnapPoint.Z
768✔
2369
                                                        );
768✔
2370
                                                break;
768✔
2371
                                        case 20:
2372
                                                osnapPoint.OsnapPoint = new XYZ(
768✔
2373
                                                        osnapPoint.OsnapPoint.X,
768✔
2374
                                                        this._reader.ValueAsDouble,
768✔
2375
                                                        osnapPoint.OsnapPoint.Z
768✔
2376
                                                        );
768✔
2377
                                                break;
768✔
2378
                                        case 30:
2379
                                                osnapPoint.OsnapPoint = new XYZ(
768✔
2380
                                                osnapPoint.OsnapPoint.X,
768✔
2381
                                                osnapPoint.OsnapPoint.Y,
768✔
2382
                                                this._reader.ValueAsDouble
768✔
2383
                                                );
768✔
2384
                                                break;
768✔
2385
                                        case 40:
2386
                                                osnapPoint.GeometryParameter = this._reader.ValueAsDouble;
768✔
2387
                                                break;
768✔
2388
                                        case 72:
2389
                                                osnapPoint.ObjectOsnapType = (ObjectOsnapType)this._reader.ValueAsShort;
768✔
2390
                                                break;
768✔
2391
                                        case 73:
2392
                                                osnapPoint.SubentType = (SubentType)this._reader.ValueAsShort;
768✔
2393
                                                break;
768✔
2394
                                        case 74:
2395
                                                osnapPoint.IntersectionSubType = (SubentType)this._reader.ValueAsShort;
×
2396
                                                break;
×
2397
                                        case 75:
2398
                                                osnapPoint.HasLastPointRef = this._reader.ValueAsBool;
768✔
2399
                                                break;
768✔
2400
                                        case 91:
2401
                                                osnapPoint.GsMarker = this._reader.ValueAsInt;
768✔
2402
                                                break;
768✔
2403
                                        case 92:
2404
                                                osnapPoint.IntersectionGsMarker = this._reader.ValueAsInt;
×
2405
                                                break;
×
2406
                                        case 331:
2407
                                                template.ObjectHandle = this._reader.ValueAsHandle;
768✔
2408
                                                break;
768✔
2409
                                        case 302:
2410
                                        case 332:
2411
                                                //What are these?
2412
                                                break;
×
2413
                                        default:
2414
                                                end = true;
768✔
2415
                                                continue;
768✔
2416
                                }
2417

2418
                                this._reader.ReadNext();
6,912✔
2419
                        }
6,912✔
2420

2421
                        return template;
768✔
2422
                }
768✔
2423

2424
                private bool readDictionary(CadTemplate template, DxfMap map)
2425
                {
224,204✔
2426
                        CadDictionaryTemplate tmp = template as CadDictionaryTemplate;
224,204✔
2427
                        CadDictionary cadDictionary = tmp.CadObject;
224,204✔
2428

2429
                        switch (this._reader.Code)
224,204✔
2430
                        {
2431
                                case 280:
2432
                                        cadDictionary.HardOwnerFlag = this._reader.ValueAsBool;
15,069✔
2433
                                        return true;
15,069✔
2434
                                case 281:
2435
                                        cadDictionary.ClonningFlags = (DictionaryCloningFlags)this._reader.Value;
21,522✔
2436
                                        return true;
21,522✔
2437
                                case 3:
2438
                                        tmp.Entries.Add(this._reader.ValueAsString, null);
57,371✔
2439
                                        return true;
57,371✔
2440
                                case 350: // Soft-owner ID/handle to entry object 
2441
                                case 360: // Hard-owner ID/handle to entry object
2442
                                        tmp.Entries[tmp.Entries.LastOrDefault().Key] = this._reader.ValueAsHandle;
57,371✔
2443
                                        return true;
57,371✔
2444
                                default:
2445
                                        return this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.Dictionary]);
72,871✔
2446
                        }
2447
                }
224,204✔
2448

2449
                private bool readDictionaryWithDefault(CadTemplate template, DxfMap map)
2450
                {
1,773✔
2451
                        CadDictionaryWithDefaultTemplate tmp = template as CadDictionaryWithDefaultTemplate;
1,773✔
2452

2453
                        switch (this._reader.Code)
1,773✔
2454
                        {
2455
                                case 340:
2456
                                        tmp.DefaultEntryHandle = this._reader.ValueAsHandle;
197✔
2457
                                        return true;
197✔
2458
                                default:
2459
                                        if (!this.tryAssignCurrentValue(template.CadObject, map.SubClasses[DxfSubclassMarker.DictionaryWithDefault]))
1,576!
2460
                                        {
1,576✔
2461
                                                return this.readDictionary(template, map);
1,576✔
2462
                                        }
2463
                                        return true;
×
2464
                        }
2465
                }
1,773✔
2466

2467
                private CadTemplate readSortentsTable()
2468
                {
576✔
2469
                        SortEntitiesTable sortTable = new SortEntitiesTable();
576✔
2470
                        CadSortensTableTemplate template = new CadSortensTableTemplate(sortTable);
576✔
2471

2472
                        //Jump the 0 marker
2473
                        this._reader.ReadNext();
576✔
2474

2475
                        this.readCommonObjectData(template);
576✔
2476

2477
                        System.Diagnostics.Debug.Assert(DxfSubclassMarker.SortentsTable == this._reader.ValueAsString);
576✔
2478

2479
                        //Jump the 100 marker
2480
                        this._reader.ReadNext();
576✔
2481

2482
                        (ulong?, ulong?) pair = (null, null);
576✔
2483

2484
                        while (this._reader.DxfCode != DxfCode.Start)
4,224✔
2485
                        {
3,648✔
2486
                                switch (this._reader.Code)
3,648!
2487
                                {
2488
                                        case 5:
2489
                                                pair.Item1 = this._reader.ValueAsHandle;
1,536✔
2490
                                                break;
1,536✔
2491
                                        case 330:
2492
                                                template.BlockOwnerHandle = this._reader.ValueAsHandle;
576✔
2493
                                                break;
576✔
2494
                                        case 331:
2495
                                                pair.Item2 = this._reader.ValueAsHandle;
1,536✔
2496
                                                break;
1,536✔
2497
                                        default:
2498
                                                this._builder.Notify($"Group Code not handled {this._reader.GroupCodeValue} for {typeof(SortEntitiesTable)}, code : {this._reader.Code} | value : {this._reader.ValueAsString}");
×
2499
                                                break;
×
2500
                                }
2501

2502
                                if (pair.Item1.HasValue && pair.Item2.HasValue)
3,648✔
2503
                                {
1,536✔
2504
                                        template.Values.Add((pair.Item1.Value, pair.Item2.Value));
1,536✔
2505
                                        pair = (null, null);
1,536✔
2506
                                }
1,536✔
2507

2508
                                this._reader.ReadNext();
3,648✔
2509
                        }
3,648✔
2510

2511
                        return template;
576✔
2512
                }
576✔
2513
        }
2514
}
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