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

DomCR / ACadSharp / 12619114630

05 Jan 2025 11:27AM UTC coverage: 75.645% (+0.6%) from 75.001%
12619114630

Pull #490

github

web-flow
Merge 01b5ca4aa into 0d0db0394
Pull Request #490: Issue 474 header defaults

5217 of 7612 branches covered (68.54%)

Branch coverage included in aggregate %.

129 of 157 new or added lines in 5 files covered. (82.17%)

581 existing lines in 13 files now uncovered.

20882 of 26890 relevant lines covered (77.66%)

39172.96 hits per line

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

83.46
/src/ACadSharp/IO/DWG/DwgHeaderHandlesCollection.cs
1
using ACadSharp.Header;
2
using ACadSharp.Objects;
3
using ACadSharp.Tables;
4
using System.Collections.Generic;
5
using System.Runtime.CompilerServices;
6

7
namespace ACadSharp.IO.DWG
8
{
9
        internal class DwgHeaderHandlesCollection
10
        {
11
                public ulong? CMATERIAL { get { return getHandle(); } set { setHandle(value: value); } }
225✔
12
                public ulong? CLAYER { get { return getHandle(); } set { setHandle(value: value); } }
753✔
13
                public ulong? TEXTSTYLE { get { return getHandle(); } set { setHandle(value: value); } }
753✔
14
                public ulong? CELTYPE { get { return getHandle(); } set { setHandle(value: value); } }
753✔
15
                public ulong? DIMSTYLE { get { return getHandle(); } set { setHandle(value: value); } }
753✔
16
                public ulong? CMLSTYLE { get { return getHandle(); } set { setHandle(value: value); } }
753✔
17
                public ulong? UCSNAME_PSPACE { get { return getHandle(); } set { setHandle(value: value); } }
396✔
18
                public ulong? UCSNAME_MSPACE { get { return getHandle(); } set { setHandle(value: value); } }
396✔
19
                public ulong? PUCSORTHOREF { get { return getHandle(); } set { setHandle(value: value); } }
339✔
20
                public ulong? PUCSBASE { get { return getHandle(); } set { setHandle(value: value); } }
339✔
21
                public ulong? UCSORTHOREF { get { return getHandle(); } set { setHandle(value: value); } }
339✔
22
                public ulong? DIMTXSTY { get { return getHandle(); } set { setHandle(value: value); } }
753✔
23
                public ulong? DIMLDRBLK { get { return getHandle(); } set { setHandle(value: value); } }
696✔
24
                public ulong? DIMBLK { get { return getHandle(); } set { setHandle(value: value); } }
696✔
25
                public ulong? DIMBLK1 { get { return getHandle(); } set { setHandle(value: value); } }
696✔
26
                public ulong? DIMBLK2 { get { return getHandle(); } set { setHandle(value: value); } }
696✔
27
                public ulong? DICTIONARY_LAYOUTS { get { return getHandle(); } set { setHandle(value: value); } }
387✔
28
                public ulong? DICTIONARY_PLOTSETTINGS { get { return getHandle(); } set { setHandle(value: value); } }
339✔
29
                public ulong? DICTIONARY_PLOTSTYLES { get { return getHandle(); } set { setHandle(value: value); } }
339✔
30
                public ulong? CPSNID { get { return getHandle(); } set { setHandle(value: value); } }
×
31
                public ulong? PAPER_SPACE { get { return getHandle(); } set { setHandle(value: value); } }
396✔
32
                public ulong? MODEL_SPACE { get { return getHandle(); } set { setHandle(value: value); } }
396✔
33
                public ulong? BYLAYER { get { return getHandle(); } set { setHandle(value: value); } }
396✔
34
                public ulong? BYBLOCK { get { return getHandle(); } set { setHandle(value: value); } }
396✔
35
                public ulong? CONTINUOUS { get { return getHandle(); } set { setHandle(value: value); } }
396✔
36
                public ulong? DIMLTYPE { get { return getHandle(); } set { setHandle(value: value); } }
225✔
37
                public ulong? DIMLTEX1 { get { return getHandle(); } set { setHandle(value: value); } }
225✔
38
                public ulong? DIMLTEX2 { get { return getHandle(); } set { setHandle(value: value); } }
225✔
39
                public ulong? VIEWPORT_ENTITY_HEADER_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
114✔
40
                public ulong? DICTIONARY_ACAD_GROUP { get { return getHandle(); } set { setHandle(value: value); } }
396✔
41
                public ulong? DICTIONARY_ACAD_MLINESTYLE { get { return getHandle(); } set { setHandle(value: value); } }
396✔
42
                public ulong? DICTIONARY_NAMED_OBJECTS { get { return getHandle(); } set { setHandle(value: value); } }
753✔
43
                public ulong? BLOCK_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
396✔
44
                public ulong? LAYER_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
396✔
45
                public ulong? STYLE_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
396✔
46
                public ulong? LINETYPE_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
396✔
47
                public ulong? VIEW_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
396✔
48
                public ulong? UCS_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
396✔
49
                public ulong? VPORT_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
396✔
50
                public ulong? APPID_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
396✔
51
                public ulong? DIMSTYLE_CONTROL_OBJECT { get { return getHandle(); } set { setHandle(value: value); } }
396✔
52
                public ulong? DICTIONARY_MATERIALS { get { return getHandle(); } set { setHandle(value: value); } }
282✔
53
                public ulong? DICTIONARY_COLORS { get { return getHandle(); } set { setHandle(value: value); } }
282✔
54
                public ulong? DICTIONARY_VISUALSTYLE { get { return getHandle(); } set { setHandle(value: value); } }
351✔
55
                public ulong? INTERFEREOBJVS { get { return getHandle(); } set { setHandle(value: value); } }
225✔
56
                public ulong? INTERFEREVPVS { get { return getHandle(); } set { setHandle(value: value); } }
225✔
57
                public ulong? DRAGVS { get { return getHandle(); } set { setHandle(value: value); } }
225✔
58
                public ulong? UCSBASE { get { return getHandle(); } set { setHandle(value: value); } }
339✔
59

60
                private Dictionary<string, ulong?> _handles = new Dictionary<string, ulong?>();
259✔
61

62
                public ulong? GetHandle(string name)
63
                {
1,309✔
64
                        this._handles.TryGetValue(name, out var handle);
1,309✔
65
                        return handle;
1,309✔
66
                }
1,309✔
67

68
                public void SetHandle(string name, ulong? value)
69
                {
5,427✔
70
                        _handles[name] = value;
5,427✔
71
                }
5,427✔
72

73
                public List<ulong?> GetHandles()
74
                {
111✔
75
                        return new List<ulong?>(_handles.Values);
111✔
76
                }
111✔
77

78
                public void UpdateHeader(CadHeader header, DwgDocumentBuilder builder)
79
                {
119✔
80
                        TableEntry entry;
81
                        if (builder.TryGetCadObject(this.CLAYER, out entry))
119✔
82
                        {
111✔
83
                                header.CurrentLayerName = entry.Name;
111✔
84
                        }
111✔
85

86
                        if (builder.TryGetCadObject(this.CELTYPE, out entry))
119✔
87
                        {
111✔
88
                                header.CurrentLineTypeName = entry.Name;
111✔
89
                        }
111✔
90

91
                        if (builder.TryGetCadObject(this.CMLSTYLE, out entry))
119!
NEW
92
                        {
×
NEW
93
                                header.CurrentMultiLineStyleName = entry.Name;
×
NEW
94
                        }
×
95

96
                        if (builder.TryGetCadObject(this.TEXTSTYLE, out entry))
119✔
97
                        {
111✔
98
                                header.TextStyleName = entry.Name;
111✔
99
                        }
111✔
100

101
                        if (builder.TryGetCadObject(this.DIMTXSTY, out entry))
119✔
102
                        {
101✔
103
                                header.DimensionTextStyleName = entry.Name;
101✔
104
                        }
101✔
105

106
                        if (builder.TryGetCadObject(this.DIMSTYLE, out entry))
119✔
107
                        {
111✔
108
                                header.DimensionStyleOverridesName = entry.Name;
111✔
109
                        }
111✔
110

111
                        BlockRecord record;
112
                        if (builder.TryGetCadObject(this.DIMBLK, out record))
119!
NEW
113
                        {
×
NEW
114
                                header.DimensionBlockName = record.Name;
×
NEW
115
                        }
×
116

117
                        if (builder.TryGetCadObject(this.DIMLDRBLK, out record))
119!
NEW
118
                        {
×
NEW
119
                                header.DimensionBlockName = record.Name;
×
NEW
120
                        }
×
121

122
                        if (builder.TryGetCadObject(this.DIMBLK1, out record))
119!
NEW
123
                        {
×
NEW
124
                                header.DimensionBlockNameFirst = record.Name;
×
NEW
125
                        }
×
126

127
                        if (builder.TryGetCadObject(this.DIMBLK2, out record))
119!
NEW
128
                        {
×
NEW
129
                                header.DimensionBlockNameSecond = record.Name;
×
NEW
130
                        }
×
131
                }
119✔
132

133
                private ulong? getHandle([CallerMemberName] string name = null)
134
                {
1,309✔
135
                        return GetHandle(name);
1,309✔
136
                }
1,309✔
137

138
                private void setHandle([CallerMemberName] string name = null, ulong? value = 0)
139
                {
5,427✔
140
                        SetHandle(name, value);
5,427✔
141
                }
5,427✔
142
        }
143
}
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