• 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/Entities/MultiLeader.cs
1
using System;
2
using System.Collections.Generic;
3
using ACadSharp.Attributes;
4
using ACadSharp.Objects;
5
using ACadSharp.Tables;
6

7
using CSMath;
8

9
namespace ACadSharp.Entities
10
{
11
        /// <summary>
12
        /// Represents a <see cref="MultiLeader"/> entity.
13
        /// </summary>
14
        /// <remarks>
15
        /// Object name <see cref="DxfFileToken.EntityMultiLeader"/> <br/>
16
        /// Dxf class name <see cref="DxfSubclassMarker.MultiLeader"/>
17
        /// </remarks>
18
        [DxfName(DxfFileToken.EntityMultiLeader)]
19
        [DxfSubClass(DxfSubclassMarker.MultiLeader)]
20
        public partial class MultiLeader : Entity
21
        {
UNCOV
22
                private MultiLeaderStyle _style = MultiLeaderStyle.Default;
×
UNCOV
23
                private TextStyle _textStyle = TextStyle.Default;
×
UNCOV
24
                private LineType _leaderLineType = LineType.ByLayer;
×
25
                private BlockRecord _arrowhead;
26
                private BlockRecord _blockContent;
27

28
                /// <summary>
29
                /// Gets or sets a <see cref="BlockRecord"/> representing the arrowhead
30
                /// (see <see cref="MultiLeaderStyle.Arrowhead"/>) to be displayed with every leader line.
31
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
32
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.Arrowhead"/> flag is set in the
33
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
34
                /// </summary>
35
                /// <remarks>
36
                /// The value for all leader lines can be overridden for each individual leader line by the
37
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.Arrowhead"/> property when the
38
                /// <see cref="LeaderLinePropertOverrideFlags.Arrowhead"/> flag is set in the
39
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
40
                /// </remarks>
41
                [DxfCodeValue(DxfReferenceType.Handle, 342)]
42
                public BlockRecord Arrowhead
43
                {
44
                        get { return this._arrowhead; }
×
45
                        set
46
                        {
×
47
                                this._arrowhead = updateCollection(value, this.Document?.BlockRecords);
×
48
                        }
×
49
                }
50

51
                /// <summary>
52
                /// Gets or sets the arrowhead size (see <see cref="MultiLeaderStyle.Arrowhead"/>)
53
                /// for every leader line
54
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.ArrowheadSize"/> flag is set in the
55
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
56
                /// </summary>
57
                /// <remarks>
58
                /// <para>
59
                /// The value for all leader lines can be overridden for each individual leader line by the
60
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.ArrowheadSize"/> property when the
61
                /// <see cref="LeaderLinePropertOverrideFlags.ArrowheadSize"/> flag is set in the
62
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
63
                /// </para><para>
64
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
65
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.ArrowheadSize"/> is
66
                /// assumed to be used.
67
                /// </para>
68
                /// </remarks>
69
                [DxfCodeValue(42)]
UNCOV
70
                public double ArrowheadSize { get; set; }
×
71

72
                ///<subject>
73
                /// Gets a list of <see cref="BlockAttribute"/> objects representing
74
                /// a reference to a "block attribute"? and some properties to adjust
75
                /// the attribute.
76
                /// </subject>
UNCOV
77
                public IList<BlockAttribute> BlockAttributes { get; private set; } = new List<BlockAttribute>();
×
78

79
                /// <summary>
80
                /// Gets or sets a value indicating whether the content of this <see cref="MultiLeader"/>
81
                /// is a text label, a content block, or a tolerance.
82
                /// </summary>
83
                [DxfCodeValue(172)]
UNCOV
84
                public LeaderContentType ContentType { get; set; }
×
85

86
                /// <summary>
87
                /// Contains the multileader content (block/text) and the leaders.
88
                /// </summary>
UNCOV
89
                public MultiLeaderAnnotContext ContextData { get; private set; } = new MultiLeaderAnnotContext();
×
90

91
                /// <summary>
92
                /// Enable Annotation Scale
93
                /// </summary>
94
                [DxfCodeValue(293)]
UNCOV
95
                public bool EnableAnnotationScale { get; set; }
×
96

97
                /// <summary>
98
                /// Gets or sets a value indicating that leader lines of this <see cref="MultiLeader"/>
99
                /// are to be drawn with a dogleg (see <see cref="MultiLeaderStyle.EnableDogleg"/>).
100
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
101
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.EnableDogleg"/> flag is set in the
102
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
103
                /// </summary>
104
                [DxfCodeValue(291)]
UNCOV
105
                public bool EnableDogleg { get; set; }
×
106

107
                /// <summary>
108
                /// Gets or sets a value indicating whether landing is enabled.
109
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
110
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.EnableLanding"/> flag is set in the
111
                /// <see cref="PropertyOverrideFlags"/> property.
112
                /// </summary>
113
                [DxfCodeValue(290)]
UNCOV
114
                public bool EnableLanding { get; set; }
×
115

116
                /// <summary>
117
                /// Leader extended to text
118
                /// </summary>
UNCOV
119
                public bool ExtendedToText { get; set; }
×
120

121
                /// <summary>
122
                /// Gets or sets the landing distance, i.e. the length of the dogleg, for this <see cref="MultiLeader"/>.
123
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
124
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LandingDistance"/> flag is set in the
125
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
126
                /// </summary>
127
                /// <remarks><para>
128
                /// There is only one field for the landing distance in the multileader property grid.
129
                /// The value entered arrives in this property and the <see cref="Objects.MultiLeaderAnnotContext.LeaderRoot.LandingDistance"/>
130
                /// property. If two leader roots exist both receive the same value. I seems
131
                /// <see cref="MultiLeaderPropertyOverrideFlags.LandingDistance"/> flag is never set.
132
                /// </para>
133
                /// </remarks>
134
                [DxfCodeValue(41)]
UNCOV
135
                public double LandingDistance { get; set; }
×
136

137
                //  TODO Additional Line Type? see Entity.LineType.
138
                /// <summary>
139
                /// Gets or sets <see cref="LineType"/> of the leader lines of this <see cref="MultiLeader"/>
140
                /// (see <see cref="MultiLeaderStyle.LeaderLineType"/>).
141
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
142
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LeaderLineType"/> flag is set in the
143
                /// <see cref="PropertyOverrideFlags"/> property.
144
                /// </summary>
145
                /// <remarks>
146
                /// The setting for all leader lines can be overridden for each individual leader line by the
147
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.LineType"/> property when the
148
                /// <see cref="LeaderLinePropertOverrideFlags.LineType"/> flag is set in the
149
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
150
                /// </remarks>
151
                [DxfCodeValue(DxfReferenceType.Handle, 341)]
152
                public LineType LeaderLineType
153
                {
154
                        get { return this._leaderLineType; }
×
155
                        set
UNCOV
156
                        {
×
UNCOV
157
                                if (value == null)
×
158
                                {
×
159
                                        throw new ArgumentNullException(nameof(value));
×
160
                                }
161

UNCOV
162
                                if (this.Document != null)
×
UNCOV
163
                                {
×
UNCOV
164
                                        this._leaderLineType = updateCollection(value, this.Document.LineTypes);
×
UNCOV
165
                                }
×
166
                                else
167
                                {
×
168
                                        this._leaderLineType = value;
×
169
                                }
×
UNCOV
170
                        }
×
171
                }
172

173
                //  TODO Additional Line Weight? see Entity.LineWeight.
174
                /// <summary>
175
                /// Gets or sets a value specifying the line weight to be applied to all leader lines of this
176
                /// <see cref="MultiLeader"/> (see <see cref="MultiLeaderStyle.LeaderLineWeight"/>).
177
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
178
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LeaderLineWeight"/> flag is set in the
179
                /// <see cref="PropertyOverrideFlags"/> property.
180
                /// </summary>
181
                /// <remarks>
182
                /// The value for all leader lines can be overridden for each individual leader line by the
183
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.LineWeight"/> property when the
184
                /// <see cref="LeaderLinePropertOverrideFlags.LineWeight"/> flag is set in the
185
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
186
                /// </remarks>
187
                [DxfCodeValue(171)]
UNCOV
188
                public LineWeightType LeaderLineWeight { get; set; }
×
189

190
                /// <summary>
191
                /// Gets or sets color of the leader lines of this <see cref="MultiLeader"/>
192
                /// (see <see cref="MultiLeaderStyle.LineColor"/>).
193
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
194
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LineColor"/> flag is set in the
195
                /// <see cref="PropertyOverrideFlags"/> property.
196
                /// </summary>
197
                /// <remarks>
198
                /// The value for all leader lines can be overridden for each individual leader line by the
199
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.LineColor"/> property when the
200
                /// <see cref="LeaderLinePropertOverrideFlags.LineColor"/> flag is set in the
201
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
202
                /// </remarks>
203
                [DxfCodeValue(91)]
UNCOV
204
                public Color LineColor { get; set; }
×
205

206
                /// <inheritdoc/>
UNCOV
207
                public override string ObjectName => DxfFileToken.EntityMultiLeader;
×
208

209
                /// <inheritdoc/>
UNCOV
210
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
211

212
                /// <summary>
213
                /// Gets or sets a value indicating the path type of this <see cref="MultiLeader"/>
214
                /// (see <see cref="MultiLeaderStyle.PathType"/>).
215
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
216
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.PathType"/> flag is set in the
217
                /// <see cref="PropertyOverrideFlags"/> property.
218
                /// </summary>
219
                [DxfCodeValue(170)]
UNCOV
220
                public MultiLeaderPathType PathType { get; set; }
×
221

222
                /// <summary>
223
                /// Gets or sets a value containing a list of flags indicating which multileader
224
                /// properties specified by the associated <see cref="MultiLeaderStyle"/>
225
                /// are to be overridden by properties specified by this <see cref="MultiLeader"/>
226
                /// or the attached <see cref="MultiLeaderAnnotContext"/>.
227
                /// </summary>
228
                [DxfCodeValue(90)]
UNCOV
229
                public MultiLeaderPropertyOverrideFlags PropertyOverrideFlags { get; set; }
×
230

231
                /// <summary>
232
                /// Gets or sets a scale factor (see <see cref="MultiLeaderStyle.ScaleFactor"/>).
233
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
234
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.ScaleFactor"/> flag is set (see
235
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
236
                /// The scale factor is applied by AutoCAD.
237
                /// </summary>
238
                /// <remarks>
239
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
240
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.ScaleFactor"/> is
241
                /// assumed to be relevant.
242
                /// </remarks>
243
                [DxfCodeValue(45)]
UNCOV
244
                public double ScaleFactor { get; set; }
×
245

246
                /// <summary>
247
                /// Gets a <see cref="MultiLeaderStyle"/> providing reusable style information
248
                /// for this <see cref="MultiLeader"/>.
249
                /// </summary>
250
                [DxfCodeValue(DxfReferenceType.Handle, 340)]
251
                public MultiLeaderStyle Style
252
                {
UNCOV
253
                        get { return this._style; }
×
254
                        set
UNCOV
255
                        {
×
UNCOV
256
                                if (value == null)
×
257
                                {
×
258
                                        throw new ArgumentNullException(nameof(value));
×
259
                                }
260

UNCOV
261
                                if (this.Document != null)
×
UNCOV
262
                                {
×
UNCOV
263
                                        this._style = updateCollection(value, this.Document.MLeaderStyles);
×
UNCOV
264
                                }
×
265
                                else
266
                                {
×
267
                                        this._style = value;
×
268
                                }
×
UNCOV
269
                        }
×
270
                }
271

272
                /// <inheritdoc/>
UNCOV
273
                public override string SubclassMarker => DxfSubclassMarker.MultiLeader;
×
274

275
                #region Text Menu Properties
276

277
                /// <summary>
278
                /// Gets or sets the text alignement type.
279
                /// </summary>
280
                /// <remarks><para>
281
                /// The Open Design Specification for DWG documents this property as <i>Unknown</i>,
282
                /// DXF reference as <i>Text Aligment Type</i>.
283
                /// Available DWG and DXF sample documents saved by AutoCAD return always 0=Left.
284
                /// </para><para>
285
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
286
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.TextAlignment"/> is
287
                /// assumed to be used.
288
                /// </para>
289
                /// </remarks>
290
                [DxfCodeValue(175)]
UNCOV
291
                public TextAlignmentType TextAlignment { get; set; }
×
292

293
                //        TODO How to set this value?
294
                /// <summary>
295
                /// Gets or sets a value indicating the text angle.
296
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
297
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextAngle"/> flag is set (see
298
                /// <see cref="PropertyOverrideFlags"/> property).
299
                /// </summary>
300
                [DxfCodeValue(174)]
UNCOV
301
                public TextAngleType TextAngle { get; set; }
×
302

303
                /// <summary>
304
                /// Gets or sets the color for the display of the text label.
305
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
306
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextColor"/> flag is set (see
307
                /// <see cref="PropertyOverrideFlags"/> property).
308
                /// </summary>
309
                /// <remarks>
310
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
311
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.TextColor"/> is
312
                /// assumed to be used.
313
                /// </remarks>
314
                [DxfCodeValue(92)]
UNCOV
315
                public Color TextColor { get; set; }
×
316

317
                /// <summary>
318
                /// Gets or sets a value indicating that the text label is to be drawn with a frame.
319
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
320
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextFrame"/> flag is set (see
321
                /// <see cref="PropertyOverrideFlags"/> property).
322
                /// </summary>
323
                [DxfCodeValue(292)]
UNCOV
324
                public bool TextFrame { get; set; }
×
325

326
                /// <summary>
327
                /// Gets or sets the text left attachment type (see <see cref="MultiLeaderStyle.TextLeftAttachment"/>).
328
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
329
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextLeftAttachment"/> flag is set (see
330
                /// <see cref="PropertyOverrideFlags"/> property).
331
                /// </summary>
332
                /// <remarks>
333
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
334
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.TextLeftAttachment"/> is
335
                /// assumed to be used.
336
                /// </remarks>
337
                /// <value>
338
                /// A <see cref="TextAttachmentType"/> having the values 0-8 can be used
339
                /// ("horizontal" attachment types).
340
                /// </value>
341
                [DxfCodeValue(173)]
UNCOV
342
                public TextAttachmentType TextLeftAttachment { get; set; }
×
343

344
                /// <summary>
345
                /// Gets or sets the text right attachment type (see <see cref="MultiLeaderStyle.TextRightAttachment"/>).
346
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
347
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextRightAttachment"/> flag is set (see
348
                /// <see cref="PropertyOverrideFlags"/> property).
349
                /// </summary>
350
                /// <remarks>
351
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
352
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.TextRightAttachment"/> is
353
                /// assumed to be used.
354
                /// </remarks>
355
                /// <value>
356
                /// A <see cref="TextAttachmentType"/> having the values 0-8 can be used
357
                /// ("horizontal" attachment types).
358
                /// </value>
359
                [DxfCodeValue(95)]
UNCOV
360
                public TextAttachmentType TextRightAttachment { get; set; }
×
361

362
                /// <summary>
363
                /// Gets or sets the <see cref="TextStyle"/> to be used to display the text label of this
364
                /// <see cref="MultiLeader"/>.
365
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
366
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextStyle"/> flag is set in the
367
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
368
                /// </summary>
369
                /// <remarks>
370
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class
371
                /// (<see cref="MultiLeaderAnnotContext.TextStyle"/>).
372
                /// Values should be equal, the <see cref="MultiLeaderAnnotContext.TextStyle"/>
373
                /// is assumed to be used.
374
                /// </remarks>
375
                [DxfCodeValue(DxfReferenceType.Handle, 343)]
376
                public TextStyle TextStyle
377
                {
UNCOV
378
                        get { return this._textStyle; }
×
379
                        set
UNCOV
380
                                {
×
UNCOV
381
                                if (value == null)
×
382
                                {
×
383
                                        throw new ArgumentNullException(nameof(value));
×
384
                                }
385

UNCOV
386
                                if (this.Document != null)
×
UNCOV
387
                                {
×
UNCOV
388
                                        this._textStyle = updateCollection(value, this.Document.TextStyles);
×
UNCOV
389
                                }
×
390
                                else
391
                                {
×
392
                                        this._textStyle = value;
×
393
                                }
×
UNCOV
394
                        }
×
395
                }
396

397
                #endregion Text Menu Properties
398

399
                #region Block Content Properties
400

401
                /// <summary>
402
                /// Gets a <see cref="BlockRecord"/> containing elements
403
                /// to be drawn as content for the multileader.
404
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
405
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContent"/> flag is set (see
406
                /// <see cref="PropertyOverrideFlags"/> property).
407
                /// </summary>
408
                /// <remarks>
409
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
410
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.BlockContent"/> is
411
                /// assumed to be used.
412
                /// </remarks>
413
                [DxfCodeValue(DxfReferenceType.Handle, 344)]
414
                public BlockRecord BlockContent
415
                {
416
                        get { return this._blockContent; }
×
417
                        set
418
                        {
×
419
                                this._blockContent = updateCollection(value, this.Document?.BlockRecords);
×
420
                        }
×
421
                }
422

423

424
                /// <summary>
425
                /// Gets or sets the block-content color.
426
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
427
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentColor"/> flag is set (see
428
                /// <see cref="PropertyOverrideFlags"/> property).
429
                /// </summary>
430
                /// <remarks>
431
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
432
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.BlockContentColor"/> is
433
                /// assumed to be used.
434
                /// </remarks>
435
                [DxfCodeValue(93)]
UNCOV
436
                public Color BlockContentColor { get; set; }
×
437

438
                /// <summary>
439
                /// Gets or sets a value indicating whether the multileader connects to the content-block extents
440
                /// or to the content-block base point
441
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentConnection"/> flag is set in the
442
                /// <see cref="PropertyOverrideFlags"/> property.
443
                /// </summary>
444
                /// <remarks>
445
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
446
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.BlockContentConnection"/> is
447
                /// assumed to be used.
448
                /// </remarks>
449
                [DxfCodeValue(176)]
UNCOV
450
                public BlockContentConnectionType BlockContentConnection { get; set; }
×
451

452
                /// <summary>
453
                /// Gets or sets the rotation of the block content of the multileader.
454
                /// </summary>
455
                /// <remarks>
456
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
457
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.BlockContentRotation"/> is
458
                /// assumed to be used.
459
                /// </remarks>
460
                [DxfCodeValue(DxfReferenceType.IsAngle, 43)]
UNCOV
461
                public double BlockContentRotation { get; set; }
×
462

463
                /// <summary>
464
                /// Gets or sets the scale factor for block content.
465
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
466
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentScale"/> flag is set (see
467
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
468
                /// </summary>
469
                /// <remarks>
470
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
471
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.BlockContentScale"/> is
472
                /// assumed to be used.
473
                /// </remarks>
474
                [DxfCodeValue(10, 20, 30)]
UNCOV
475
                public XYZ BlockContentScale { get; set; }
×
476

477
                #endregion Block Content Properties
478

479
                //        TODO According to the OpenDesign_Specification_for_.dwg_files
480
                //        a list of arror head AND a list of block attributes can occur.
481
                //        If both list are empty it ist expected that two BL-fields should
482
                //        occur yielding count=0 for both lists. But when we read two
483
                //        BL-fields we get out of sync. If we read one BL-field everything
484
                //        works fine.
485
                //        We do not understand what a list of arroheads can be used for,
486
                //        and we do not know how to create such a list.
487
                //        The documentation for arrowheads list in OpenDesign_Specification_for_.dwg_files
488
                //        and the DXF Reference are contradicting.
489
                //        Decision:
490
                //                Ommit the Arrowheads property,
491
                //                try to keep the block attributes.
492

493
                /// <summary>
494
                /// Text Align in IPE (meaning unknown)
495
                /// </summary>
496
                [DxfCodeValue(178)]
UNCOV
497
                public short TextAligninIPE { get; set; }
×
498

499
                /// <summary>
500
                /// Gets or sets the Text attachment direction for text or block contents.
501
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
502
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextAttachmentDirection"/> flag is set in the
503
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
504
                /// </summary>
505
                /// <remarks>
506
                /// <para>
507
                /// This property defines whether the leaders attach to the left/right of the content block/text,
508
                /// or attach to the top/bottom.
509
                /// </para><para>
510
                /// The value for all leader lines can be overridden for each individual leader line by the
511
                /// <see cref="Objects.MultiLeaderAnnotContext.LeaderRoot.TextAttachmentDirection"/> property when the
512
                /// <see cref="MultiLeaderPropertyOverrideFlags.TextAttachmentDirection"/> flag is set in the
513
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
514
                /// </para>
515
                /// </remarks>
516
                /// <value>
517
                /// A <see cref="TextAttachmentDirectionType"/>.
518
                /// </value>
519
                [DxfCodeValue(271)]
UNCOV
520
                public TextAttachmentDirectionType TextAttachmentDirection { get; set; }
×
521

522
                /// <summary>
523
                /// Gets or sets a value indicating the text attachment point.
524
                /// </summary>
525
                /// <remarks><para>
526
                ///        The Open Design Specification for DWG files documents this property as <i>Justification</i>,
527
                /// the DXF reference as <i>Text Attachments point</i>.
528
                /// </para><para>
529
                /// This property is also exposed by the <see cref="MultiLeader"/> class
530
                /// (<see cref="MultiLeader.TextAttachmentPoint"/>).
531
                /// The <see cref="MultiLeaderAnnotContext.TextAttachmentPoint"/> property always has the same value
532
                /// and seems to have the respective value as <see cref="MultiLeaderAnnotContext.TextAlignment"/>.
533
                /// The <see cref="MultiLeaderAnnotContext.TextAttachmentPoint"/> property is to be used.
534
                /// </para>
535
                /// </remarks>
536
                [DxfCodeValue(179)]
UNCOV
537
                public TextAttachmentPointType TextAttachmentPoint { get; set; }
×
538

539
                /// <summary>
540
                /// Gets or sets the text bottom attachment type (see <see cref="MultiLeaderStyle.TextBottomAttachment"/>).
541
                /// This property override the value from <see cref="MultiLeaderStyle"/>
542
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextBottomAttachment"/> flag is set (see
543
                /// <see cref="PropertyOverrideFlags"/> property).
544
                /// </summary>
545
                /// <remarks>
546
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
547
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.TextBottomAttachment"/> is
548
                /// assumed to be used.
549
                /// </remarks>
550
                /// <value>
551
                /// A <see cref="TextAttachmentType"/> having the values
552
                ///         9 = Center,
553
                ///         10 = Underline and Center
554
                /// can be used ("vertical" attachment types).
555
                /// </value>
556
                [DxfCodeValue(272)]
UNCOV
557
                public TextAttachmentType TextBottomAttachment { get; set; }
×
558

559
                //  public IList<ArrowheadAssociation> Arrowheads { get; } = new List<ArrowheadAssociation>();
560
                /// <summary>
561
                /// Text Direction Negative
562
                /// </summary>
563
                [DxfCodeValue(294)]
UNCOV
564
                public bool TextDirectionNegative { get; set; }
×
565

566
                /// <summary>
567
                /// Gets or sets the text top attachment type (see <see cref="MultiLeaderStyle.TextTopAttachment"/>).
568
                /// This property override the value from <see cref="MultiLeaderStyle"/>
569
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextTopAttachment"/> flag is set (see
570
                /// <see cref="PropertyOverrideFlags"/> property).
571
                /// </summary>
572
                /// <remarks>
573
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
574
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.TextTopAttachment"/> is
575
                /// assumed to be used.
576
                /// </remarks>
577
                /// <value>
578
                /// A <see cref="TextAttachmentType"/> having the values
579
                ///         9 = Center,
580
                ///         10 = Underline and Center
581
                /// can be used ("vertical" attachment types).
582
                /// </value>
583
                [DxfCodeValue(273)]
UNCOV
584
                public TextAttachmentType TextTopAttachment { get; set; }
×
585

586
                /// <inheritdoc/>
587
                public override void ApplyTransform(Transform transform)
588
                {
×
589
                }
×
590

591
                /// <inheritdoc/>
592
                public override CadObject Clone()
UNCOV
593
                {
×
UNCOV
594
                        MultiLeader clone = (MultiLeader)base.Clone();
×
595

UNCOV
596
                        clone.ContextData = (MultiLeaderAnnotContext)this.ContextData.Clone();
×
597

UNCOV
598
                        clone.BlockAttributes = new List<BlockAttribute>();
×
UNCOV
599
                        foreach (var att in this.BlockAttributes)
×
600
                        {
×
601
                                clone.BlockAttributes.Add((BlockAttribute)att.Clone());
×
602
                        }
×
603

UNCOV
604
                        clone._style = (MultiLeaderStyle)this._style.Clone();
×
UNCOV
605
                        clone._textStyle = (TextStyle)this._textStyle.Clone();
×
UNCOV
606
                        clone._leaderLineType = (LineType)this._leaderLineType.Clone();
×
UNCOV
607
                        clone._arrowhead = (BlockRecord)this._arrowhead?.Clone();
×
UNCOV
608
                        clone._blockContent = (BlockRecord)this._blockContent?.Clone();
×
609

UNCOV
610
                        return clone;
×
UNCOV
611
                }
×
612

613
                internal override void AssignDocument(CadDocument doc)
UNCOV
614
                {
×
UNCOV
615
                        base.AssignDocument(doc);
×
616

UNCOV
617
                        this._style = updateCollection<MultiLeaderStyle>(this._style, doc.MLeaderStyles);
×
UNCOV
618
                        this._textStyle = updateCollection(this._textStyle, doc.TextStyles);
×
UNCOV
619
                        this._leaderLineType = updateCollection(this._leaderLineType, doc.LineTypes);
×
UNCOV
620
                        this._arrowhead = updateCollection(this._arrowhead, doc.BlockRecords);
×
UNCOV
621
                        this._blockContent = updateCollection(this._blockContent, doc.BlockRecords);
×
622

UNCOV
623
                        this.ContextData.AssignDocument(doc);
×
624

UNCOV
625
                        doc.LineTypes.OnRemove += this.tableOnRemove;
×
UNCOV
626
                        doc.TextStyles.OnRemove += this.tableOnRemove;
×
UNCOV
627
                        doc.MLeaderStyles.OnRemove += this.tableOnRemove;
×
UNCOV
628
                        doc.BlockRecords.OnRemove += this.tableOnRemove;
×
UNCOV
629
                }
×
630

631
                internal override void UnassignDocument()
UNCOV
632
                {
×
UNCOV
633
                        this.Document.LineTypes.OnRemove -= this.tableOnRemove;
×
UNCOV
634
                        this.Document.TextStyles.OnRemove -= this.tableOnRemove;
×
UNCOV
635
                        this.Document.MLeaderStyles.OnRemove -= this.tableOnRemove;
×
UNCOV
636
                        this.Document.BlockRecords.OnRemove -= this.tableOnRemove;
×
637

UNCOV
638
                        this.ContextData.UnassignDocument();
×
639

UNCOV
640
                        base.UnassignDocument();
×
641

UNCOV
642
                        this._leaderLineType = (LineType)this._leaderLineType.Clone();
×
UNCOV
643
                        this._textStyle = (TextStyle)this._textStyle.Clone();
×
UNCOV
644
                        this._style = (MultiLeaderStyle)this._style.Clone();
×
UNCOV
645
                        this._arrowhead = (BlockRecord)this._arrowhead?.Clone();
×
UNCOV
646
                        this._blockContent = (BlockRecord)this._blockContent?.Clone();
×
UNCOV
647
                }
×
648

649
                protected override void tableOnRemove(object sender, CollectionChangedEventArgs e) {
×
650
                        base.tableOnRemove(sender, e);
×
651

652
                        if (e.Item.Equals(this._style))
×
653
                        {
×
654
                                this._style = this.Document.MLeaderStyles[MultiLeaderStyle.DefaultName];
×
655
                        }
×
656
                        if (e.Item.Equals(this._leaderLineType))
×
657
                        {
×
658
                                this._leaderLineType = this.Document.LineTypes[LineType.ByLayerName];
×
659
                        }
×
660
                        if (e.Item.Equals(this._textStyle))
×
661
                        {
×
662
                                this._textStyle = this.Document.TextStyles[TextStyle.DefaultName];
×
663
                        }
×
664
                        if (e.Item == this._arrowhead)
×
665
                        {
×
666
                                this._arrowhead = null;
×
667
                        }
×
668
                        if (e.Item == this._blockContent)
×
669
                        {
×
670
                                this._blockContent = null;
×
671
                        }
×
672
                }
×
673

674

675
                /// <inheritdoc/>
676
                public override BoundingBox GetBoundingBox()
UNCOV
677
                {
×
UNCOV
678
                        return BoundingBox.Null;
×
UNCOV
679
                }
×
680
        }
681
}
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