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

DomCR / ACadSharp / 17737836230

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

push

github

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

addflag refactor

141 of 9225 branches covered (1.53%)

Branch coverage included in aggregate %.

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

24910 existing lines in 372 files now uncovered.

724 of 32119 relevant lines covered (2.25%)

5.76 hits per line

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

0.0
/src/ACadSharp/Objects/MultiLeaderAnnotContextClasses.cs
1
using System;
2
using System.Collections.Generic;
3

4
using ACadSharp.Attributes;
5
using ACadSharp.Tables;
6

7
using CSMath;
8

9

10
namespace ACadSharp.Objects
11
{
12

13
        /// <summary>
14
        /// Nested classes in MultiLeaderAnnotContext
15
        /// </summary>
16
        public partial class MultiLeaderAnnotContext : NonGraphicalObject
17
        {
18
                /// <summary>
19
                /// Represents a leader root
20
                /// </summary>
21
                /// <remarks>
22
                /// Appears in DXF as 302 DXF: “LEADER“
23
                /// </remarks>
24
                public class LeaderRoot : ICloneable
25
                {
UNCOV
26
                        public LeaderRoot() { }
×
27

28
                        /// <summary>
29
                        /// Is content valid (ODA writes true)
30
                        /// </summary>
31
                        [DxfCodeValue(290)]
UNCOV
32
                        public bool ContentValid { get; set; }
×
33

34
                        /// <summary>
35
                        /// Unknown (ODA writes true)
36
                        /// </summary>
37
                        [DxfCodeValue(291)]
UNCOV
38
                        public bool Unknown { get; set; }
×
39

40
                        /// <summary>
41
                        /// Connection point
42
                        /// </summary>
43
                        [DxfCodeValue(10, 20, 30)]
UNCOV
44
                        public XYZ ConnectionPoint { get; set; }
×
45

46
                        /// <summary>
47
                        /// Direction
48
                        /// </summary>
49
                        [DxfCodeValue(11, 21, 31)]
UNCOV
50
                        public XYZ Direction { get; set; }
×
51

52
                        /// <summary>
53
                        /// Gets a list of <see cref="StartEndPointPair" />.
54
                        /// </summary>
UNCOV
55
                        public IList<StartEndPointPair> BreakStartEndPointsPairs { get; private set; } = new List<StartEndPointPair>();
×
56

57
                        /// <summary>
58
                        /// Leader index
59
                        /// </summary>
60
                        [DxfCodeValue(90)]
UNCOV
61
                        public int LeaderIndex { get; set; }
×
62

63
                        /// <summary>
64
                        /// Landing distance
65
                        /// </summary>
66
                        [DxfCodeValue(40)]
UNCOV
67
                        public double LandingDistance { get; set; }
×
68

69
                        /// <summary>
70
                        /// Gets a list of <see cref="LeaderLine"/> objects representing
71
                        /// leader lines starting from the landing point
72
                        /// of the multi leader.
73
                        /// </summary>
UNCOV
74
                        public IList<LeaderLine> Lines { get; private set; } = new List<LeaderLine>();
×
75

76
                        //R2010
77
                        /// <summary>
78
                        /// Attachment direction
79
                        /// </summary>
80
                        [DxfCodeValue(271)]
UNCOV
81
                        public TextAttachmentDirectionType TextAttachmentDirection { get; set; }
×
82

83
                        public object Clone()
84
                        {
×
85
                                LeaderRoot clone = (LeaderRoot)base.MemberwiseClone();
×
86

87
                                clone.BreakStartEndPointsPairs = new List<StartEndPointPair>();
×
88
                                foreach (var breakStartEndPoint in this.BreakStartEndPointsPairs)
×
89
                                {
×
90
                                        clone.BreakStartEndPointsPairs.Add((StartEndPointPair)breakStartEndPoint.Clone());
×
91
                                }
×
92

93
                                clone.Lines = new List<LeaderLine>();
×
94
                                foreach (var line in this.Lines)
×
95
                                {
×
96
                                        clone.Lines.Add((LeaderLine)line.Clone());
×
97
                                }
×
98

99
                                return clone;
×
100
                        }
×
101
                }
102

103
                /// <summary>
104
                /// Start/end point pairs
105
                /// 3BD        11        Start Point
106
                /// 3BD        12        End point
107
                /// </summary>
108
                public struct StartEndPointPair : ICloneable
109
                {
110
                        public StartEndPointPair(XYZ startPoint, XYZ endPoint) {
×
111
                                StartPoint = startPoint;
×
112
                                EndPoint = endPoint;
×
113
                        }
×
114

115
                        /// <summary>
116
                        /// Break start point
117
                        /// </summary>
118
                        [DxfCodeValue(12, 22, 32)]
119
                        public XYZ StartPoint { get; private set; }
×
120

121
                        /// <summary>
122
                        /// Break end point
123
                        /// </summary>
124
                        [DxfCodeValue(13, 23, 33)]
125
                        public XYZ EndPoint { get; private set; }
×
126

127
                        public object Clone()
128
                        {
×
129
                                return this.MemberwiseClone();
×
130
                        }
×
131
                }
132

133

134
                /// <summary>
135
                ///        Represents a leader line
136
                /// </summary>
137
                /// <remarks>
138
                /// Appears as 304        DXF: “LEADER_LINE“
139
                /// </remarks>
140
                public class LeaderLine : ICloneable
141
                {
UNCOV
142
                        internal CadDocument Document { get; set; }
×
143
                        private LineType _lineType;
144

UNCOV
145
                        public LeaderLine() { }
×
146

147
                        /// <summary>
148
                        /// Get the list of points of this <see cref="LeaderLine"/>.
149
                        /// </summary>
UNCOV
150
                        public IList<XYZ> Points { get; private set; } = new List<XYZ>();
×
151

152
                        /// <summary>
153
                        /// Break info count
154
                        /// </summary>
UNCOV
155
                        public int BreakInfoCount { get; set; }
×
156

157
                        /// <summary>
158
                        /// Segment index
159
                        /// </summary>
160
                        [DxfCodeValue(90)]
161
                        public int SegmentIndex { get; set; }
×
162

163
                        /// <summary>
164
                        /// Start/end point pairs
165
                        /// </summary>
UNCOV
166
                        public IList<StartEndPointPair> StartEndPoints { get; private set; } = new List<StartEndPointPair>();
×
167

168
                        /// <summary>
169
                        /// Leader line index.
170
                        /// </summary>
171
                        [DxfCodeValue(91)]
UNCOV
172
                        public int Index { get; set; }
×
173

174
                        //R2010
175
                        /// <summary>
176
                        /// Leader type
177
                        /// </summary>
178
                        [DxfCodeValue(170)]
UNCOV
179
                        public MultiLeaderPathType PathType { get; set; }
×
180

181
                        /// <summary>
182
                        /// Line color
183
                        /// </summary>
184
                        [DxfCodeValue(92)]
UNCOV
185
                        public Color LineColor { get; set; }
×
186

187
                        /// <summary>
188
                        /// Line type
189
                        /// </summary>
190
                        [DxfCodeValue(DxfReferenceType.Handle, 340)]
191
                        public LineType LineType
192
                        {
193
                                get { return this._lineType; }
×
194
                                set
195
                                {
×
196
                                        if (value == null)
×
197
                                        {
×
198
                                                _lineType = null;
×
199
                                                return;
×
200
                                        }
201

202
                                        if (this.Document != null)
×
203
                                        {
×
204
                                                if (this.Document.LineTypes.TryGetValue(((LineType)value).Name, out LineType lt))
×
205
                                                {
×
206
                                                        this._lineType = lt;
×
207
                                                }
×
208
                                                else
209
                                                {
×
210
                                                        this._lineType = value;
×
211
                                                        this.Document.LineTypes.Add(this._lineType);
×
212
                                                }
×
213
                                        }
×
214
                                }
×
215
                        }
216

217
                        /// <summary>
218
                        /// Line weight
219
                        /// </summary>
220
                        [DxfCodeValue(171)]
UNCOV
221
                        public LineWeightType LineWeight { get; set; }
×
222

223
                        /// <summary>
224
                        /// Arrowhead size
225
                        /// </summary>
226
                        [DxfCodeValue(40)]
UNCOV
227
                        public double ArrowheadSize { get; set; }
×
228

229
                        /// <summary>
230
                        /// Gets or sets a <see cref="BlockRecord"/> containig elements
231
                        /// to be dawn as arrow symbol.
232
                        /// </summary>
233
                        [DxfCodeValue(DxfReferenceType.Handle, 341)]
234
                        public BlockRecord Arrowhead { get; set; }
×
235

236
                        /// <summary>
237
                        /// Override flags
238
                        /// </summary>
239
                        [DxfCodeValue(93)]
UNCOV
240
                        public LeaderLinePropertOverrideFlags OverrideFlags { get; set; }
×
241

242
                        public object Clone()
243
                        {
×
244
                                LeaderLine clone = (LeaderLine)this.MemberwiseClone();
×
245

246
                                clone.LineType = (LineType)this.LineType?.Clone();
×
247
                                clone.Arrowhead = (BlockRecord)this.Arrowhead?.Clone();
×
248

249
                                clone.Points = new List<XYZ>();
×
250
                                foreach (var point in this.Points)
×
251
                                {
×
252
                                        clone.Points.Add(point);
×
253
                                }
×
254

255
                                clone.StartEndPoints = new List<StartEndPointPair>();
×
256
                                foreach (var startEndPoint in this.StartEndPoints)
×
257
                                {
×
258
                                        clone.StartEndPoints.Add((StartEndPointPair)startEndPoint.Clone());
×
259
                                }
×
260

261
                                return clone;
×
262
                        }
×
263

264
                        public void AssignDocument(CadDocument doc)
UNCOV
265
                        {
×
UNCOV
266
                                this.Document = doc;
×
267

UNCOV
268
                                if (_lineType != null)
×
269
                                {
×
270
                                        if (doc.LineTypes.TryGetValue(_lineType.Name, out LineType existing))
×
271
                                        {
×
272
                                                this._lineType = existing;
×
273
                                        }
×
274
                                        else
275
                                        {
×
276
                                                doc.LineTypes.Add(_lineType);
×
277
                                        }
×
278
                                }
×
279

UNCOV
280
                                doc.LineTypes.OnRemove += this.tableOnRemove;
×
UNCOV
281
                        }
×
282

283
                        public void UassignDocument()
UNCOV
284
                        {
×
UNCOV
285
                                this.Document.LineTypes.OnRemove -= this.tableOnRemove;
×
286

UNCOV
287
                                this.Document = null;
×
288

UNCOV
289
                                this._lineType = (LineType)this._lineType?.Clone();
×
UNCOV
290
                        }
×
291

292
                        private void tableOnRemove(object sender, CollectionChangedEventArgs e)
293
                        {
×
294
                                if (e.Item.Equals(this._lineType))
×
295
                                {
×
296
                                        this._lineType = null;
×
297
                                }
×
298
                        }
×
299
                }
300
        }
301
}
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