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

DomCR / ACadSharp / 17969700796

24 Sep 2025 07:31AM UTC coverage: 75.594% (-2.9%) from 78.47%
17969700796

Pull #191

github

web-flow
Merge 4453f5494 into 3e0fc6cad
Pull Request #191: Solid3D entity

6490 of 9325 branches covered (69.6%)

Branch coverage included in aggregate %.

43 of 319 new or added lines in 10 files covered. (13.48%)

748 existing lines in 15 files now uncovered.

25081 of 32439 relevant lines covered (77.32%)

107449.08 hits per line

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

73.43
/src/ACadSharp/Objects/MultiLeaderObjectContextData.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using ACadSharp.Attributes;
5
using ACadSharp.Entities;
6
using ACadSharp.Tables;
7

8
using CSMath;
9

10

11
namespace ACadSharp.Objects {
12

13
        /// <summary>
14
        /// This class represents a subset ob the properties of the MLeaderAnnotContext
15
        /// object, that are embedded into the MultiLeader entity.
16
        /// </summary>
17
        public partial class MultiLeaderObjectContextData : AnnotScaleObjectContextData
18
        {
19
                private TextStyle _textStyle = TextStyle.Default;
2,011✔
20
                private BlockRecord _blockContent;
21

22
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
23

24
                /// <inheritdoc />
25
                public override string SubclassMarker => DxfSubclassMarker.MultiLeaderObjectContextData;
×
26

27
                /// <inheritdoc />
28
                public override string ObjectName => DxfFileToken.ObjectMLeaderContextData;
×
29

30

31
                /// <summary>
32
                /// Gets the list of <see cref="LeaderRoot"/> objects of the multileader.
33
                /// </summary>
34
                /// <remarks>
35
                /// A <see cref="MultiLeader"/> can have one or two leader roots having one ore more
36
                /// leader lines each.
37
                /// </remarks>
38
                public IList<LeaderRoot> LeaderRoots { get; private set; } = new List<LeaderRoot>();
6,456✔
39

40
                /// <summary>
41
                /// Gets or sets a scale factor (see <see cref="MultiLeaderStyle.ScaleFactor"/>).
42
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
43
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.ScaleFactor"/> flag is set (see
44
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
45
                /// The scale factor is applied by AutoCAD.
46
                /// </summary>
47
                /// <remarks>
48
                /// <para>
49
                /// The following properties entered in AutoCAD are multiplied with this scale factor:
50
                /// </para>
51
                /// <see cref="ArrowheadSize"/>, <see cref="MultiLeader.LandingDistance"/>, <see cref="LandingGap"/>,
52
                /// <see cref="TextHeight"/>, and the elements of <see cref="BlockContentScale"/>.
53
                /// <para>
54
                /// The <see cref="ContentBasePoint"/> is adjusted.
55
                /// </para>
56
                /// </remarks>
57
                [DxfCodeValue(40)]
58
                public double ScaleFactor { get; set; }
2,000✔
59

60
                //        TODO
61
                /// <summary>
62
                /// Gets or sets the content base point. This point is identical with the landing end
63
                /// point of the first leader.
64
                /// </summary>
65
                /// <remarks>
66
                /// This point 
67
                /// </remarks>
68
                [DxfCodeValue(10, 20, 30)]
69
                public XYZ ContentBasePoint { get; set; }
2,009✔
70

71
                /// <summary>
72
                /// Get or sets the text height for the lext label of the multileader
73
                /// (see <see cref="MultiLeaderStyle.TextHeight"/>).
74
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
75
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextHeight"/> flag is set in the
76
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
77
                /// </summary>
78
                /// <value>
79
                /// The value returned is the value entered in AutoCAD multiplied with the <see cref="ScaleFactor"/>.
80
                /// </value>
81
                [DxfCodeValue(41)]
82
                public double TextHeight { get; set; }
2,000✔
83

84
                /// <summary>
85
                /// Gets or sets the arrowhead size (see <see cref="MultiLeaderStyle.Arrowhead"/>)
86
                /// for every leader line.
87
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
88
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.ArrowheadSize"/> flag is set in the
89
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
90
                /// </summary>
91
                /// <remarks>
92
                /// <para>
93
                /// The value for all leader lines can be overridden for each individual leader line by the
94
                /// <see cref="LeaderLine.ArrowheadSize"/> property when the
95
                /// <see cref="LeaderLinePropertOverrideFlags.ArrowheadSize"/> flag is set in the 
96
                /// <see cref="LeaderLine.OverrideFlags"/> property.
97
                /// </para><para>
98
                /// This property is also exposed by the <see cref="MultiLeader"/> class
99
                /// (<see cref="MultiLeader.ArrowheadSize"/>).
100
                /// Values should be equal, the value of this property is assumed to be used.
101
                /// </para>
102
                /// </remarks>
103
                /// <value>
104
                /// The value returned is the value entered in AutoCAD multiplied with the <see cref="ScaleFactor"/>.
105
                /// </value>
106
                [DxfCodeValue(140)]
107
                public double ArrowheadSize { get; set; }
2,000✔
108

109
                /// <summary>
110
                /// Gets or sets the landing gap (see <see cref="MultiLeaderStyle.LandingGap"/>).
111
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
112
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LandingGap"/> flag is set (see
113
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
114
                /// </summary>
115
                [DxfCodeValue(145)]
116
                public double LandingGap { get; set; }
2,000✔
117

118
                /// <summary>
119
                /// Gets or sets the text top attachment type (see <see cref="MultiLeaderStyle.TextLeftAttachment"/>).
120
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
121
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextLeftAttachment"/> flag is set (see
122
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
123
                /// </summary>
124
                /// <remarks>
125
                /// This property is also exposed by the <see cref="MultiLeader"/> class
126
                /// (<see cref="MultiLeader.TextLeftAttachment"/>).
127
                /// Values should be equal, the value of this property is assumed to be used.
128
                /// </remarks>
129
                /// <value>
130
                /// A <see cref="TextAttachmentType"/> having the values 0-8 
131
                /// can be used ("horizontal" attachment types).
132
                /// </value>
133
                [DxfCodeValue(174)]
134
                public TextAttachmentType TextLeftAttachment { get; set; }
1,999✔
135

136
                /// <summary>
137
                /// Gets or sets the text top attachment type (see <see cref="MultiLeaderStyle.TextRightAttachment"/>).
138
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
139
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextRightAttachment"/> flag is set (see
140
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
141
                /// </summary>
142
                /// <remarks>
143
                /// This property is also exposed by the <see cref="MultiLeader"/> class
144
                /// (<see cref="MultiLeader.TextRightAttachment"/>).
145
                /// Values should be equal, the value of this property is assumed to be used.
146
                /// </remarks>
147
                /// <value>
148
                /// A <see cref="TextAttachmentType"/> having the values 0-8 
149
                /// can be used ("horizontal" attachment types).
150
                /// </value>
151
                [DxfCodeValue(175)]
152
                public TextAttachmentType TextRightAttachment { get; set; }
1,999✔
153

154
                /// <summary>
155
                /// Gets or sets the text alignment, i.e. the alignment of text lines if the a multiline
156
                /// text label, relative to the <see cref="Location"/>.
157
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
158
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextAlignment"/> flag is set in the
159
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
160
                /// </summary>
161
                /// <remarks><para>
162
                /// This property contains the alignment value specified in AutoCAD rather than
163
                /// <see cref="MultiLeader.TextAlignment"/> and seems always to be consistent with
164
                /// <see cref="TextAttachmentPoint"/>.
165
                /// </para><para>
166
                /// Note that when changing this value the <see cref="Location"/> must be changed
167
                /// accordingly.
168
                /// </para>
169
                /// </remarks>
170
                [DxfCodeValue(176)]
171
                public TextAlignmentType TextAlignment { get; set; }
1,999✔
172

173
                /// <summary>
174
                /// Gets or sets a value indicating whether the multileader connects to the content-block extents
175
                /// or to the content-block base point.
176
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
177
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentConnection"/> flag is set in the
178
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
179
                /// </summary>
180
                /// <remarks>
181
                /// This property is also exposed by the <see cref="MultiLeader"/> class
182
                /// (<see cref="MultiLeader.BlockContentConnection"/>).
183
                /// Values should be equal, the value of this property is assumed to be used.
184
                /// </remarks>
185
                [DxfCodeValue(177)]
186
                public BlockContentConnectionType BlockContentConnection { get; set; }
1,999✔
187

188
                //        TODO Check dependency of HasTextContent, HasContentBlock and MultiLeader.ContentType
189
                /// <summary>
190
                /// Gets or sets a value indicating that the mutileader has a text label. 
191
                /// </summary>
192
                [DxfCodeValue(290)]
193
                public bool HasTextContents { get; set; }
3,999✔
194

195
                /// <summary>
196
                /// Gets or sets a string containg the text tat is to be dispayed a s text label of the
197
                /// multileader.
198
                /// </summary>
199
                /// <remarks>
200
                /// The string may contain MTEXT markups to specify new-lines, font, size, style, etc. 
201
                /// </remarks>
202
                [DxfCodeValue(304)]
203
                public string TextLabel { get; set; }
2,098✔
204

205
                /// <summary>
206
                /// Gets or sets the normal vector for the text label of the multileader.
207
                /// </summary>
208
                [DxfCodeValue(11, 21, 31)]
209
                public XYZ TextNormal { get; set; }
1,996✔
210

211
                /// <summary>
212
                /// Gets or sets the <see cref="TextStyle"/> to be used to display the text label of the
213
                /// multileader.
214
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
215
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextStyle"/> flag is set in the
216
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
217
                /// </summary>
218
                /// <remarks>
219
                /// This property is also exposed by the <see cref="MultiLeader"/> class
220
                /// (<see cref="MultiLeader.TextStyle"/>).
221
                /// Values should be equal, the value of this property is assumed to be used.
222
                /// </remarks>
223
                [DxfCodeValue(DxfReferenceType.Handle, 340)]
224
                public TextStyle TextStyle
225
                {
UNCOV
226
                        get { return this._textStyle; }
×
227
                        set
228
                        {
1,995✔
229
                                if (value == null)
1,995!
230
                                {
×
231
                                        throw new ArgumentNullException(nameof(value));
×
232
                                }
233

234
                                if (this.Document != null)
1,995!
235
                                {
1,995✔
236
                                        this._textStyle = CadObject.updateCollection(value, this.Document.TextStyles);
1,995✔
237
                                }
1,995✔
238
                                else
239
                                {
×
240
                                        this._textStyle = value;
×
241
                                }
×
242
                        }
1,995✔
243
                }
244

245

246
                /// <summary>
247
                /// Gets or sets the location of the text label of the multileader.
248
                /// </summary>
249
                /// <remarks>
250
                /// This location is evaluated by AutoCAD from the <see cref="Conn"/>
251
                /// </remarks>
252
                [DxfCodeValue(12, 22, 32)]
253
                public XYZ TextLocation { get; set; }
1,996✔
254

255
                /// <summary>
256
                /// Direction
257
                /// </summary>
258
                [DxfCodeValue(13, 23, 33)]
259
                public XYZ Direction { get; set; }
1,996✔
260

261
                /// <summary>
262
                /// Gets or sets the rotation of the text label of the multileader.
263
                /// </summary>
264
                /// <value>
265
                /// The rotation angle in radians.
266
                /// </value>
267
                [DxfCodeValue(DxfReferenceType.IsAngle, 42)]
268
                public double TextRotation { get; set; }
1,996✔
269

270
                //        TODO
271
                /// <summary>
272
                /// Boundary width (DXF Reference: TextWidth)
273
                /// Value seems to be always zero.
274
                /// </summary>
275
                [DxfCodeValue(43)]
276
                public double BoundaryWidth { get; set; }
1,996✔
277

278
                //        TODO
279
                /// <summary>
280
                /// Boundary height (DXF Reference: TextHeight)
281
                /// Value seems to be always zero.
282
                /// </summary>
283
                [DxfCodeValue(44)]
284
                public double BoundaryHeight { get; set; }
1,996✔
285

286
                /// <summary>
287
                /// Gets or sets the line-spacing factor for the display of the text label.
288
                /// </summary>
289
                [DxfCodeValue(45)]
290
                public double LineSpacingFactor { get; set; }
1,996✔
291

292
                /// <summary>
293
                /// Gets or sets the line spacing style for the display of the text label.
294
                /// </summary>
295
                [DxfCodeValue(170)]
296
                public LineSpacingStyle LineSpacing { get; set; }
1,995✔
297

298
                /// <summary>
299
                /// Gets or sets the color for the display of the text label
300
                /// </summary>
301
                [DxfCodeValue(90)]
302
                public Color TextColor { get; set; }
1,996✔
303

304
                /// <summary>
305
                /// Gets or sets a value indicating the text attachment point.
306
                /// </summary>
307
                /// <remarks><para>
308
                /// In the Open Design Specification this property is documented as <i>Alignment</i>, in DXF
309
                /// reference as <i>Text Attachment</i>. It is not clear what the meaning of this property
310
                /// is in contrast to the <see cref="TextAlignment"/> property. The value seems to be always
311
                /// consistent.
312
                /// </para><para>
313
                /// This property is also exposed by the <see cref="MultiLeader"/> class
314
                /// (<see cref="MultiLeader.TextAttachmentPoint"/>).
315
                /// Values should be equal, the value of this property is assumed to be used.
316
                /// </para>
317
                /// </remarks>
318
                [DxfCodeValue(171)]
319
                public TextAttachmentPointType TextAttachmentPoint { get; set; }
1,995✔
320

321
                //        TODO What is exactly ment by "flow direction"?
322
                //                 When the value is not Horizontal line breaks in text label have to be ignored.
323
                //             The value returned by AutoCAD is normally 5. This not a valid enum value.
324
                /// <summary>
325
                /// Gets or sets a value indicating the flow direction.
326
                /// </summary>
327
                [DxfCodeValue(172)]
328
                public FlowDirectionType FlowDirection { get; set; }
1,995✔
329

330
                //        TODO Create test cases
331
                /// <summary>
332
                /// Background fill color
333
                /// </summary>
334
                [DxfCodeValue(91)]
335
                public Color BackgroundFillColor { get; set; }
1,996✔
336

337
                //        TODO Create test cases
338
                /// <summary>
339
                /// Background scale factor
340
                /// </summary>
341
                [DxfCodeValue(141)]
342
                public double BackgroundScaleFactor { get; set; }
1,996✔
343

344
                //        TODO Create test cases
345
                /// <summary>
346
                /// Background transparency
347
                /// </summary>
348
                [DxfCodeValue(92)]
349
                public int BackgroundTransparency { get; set; }
1,996✔
350

351
                //        TODO Create test cases
352
                /// <summary>
353
                /// Is background fill enabled
354
                /// </summary>
355
                [DxfCodeValue(291)]
356
                public bool BackgroundFillEnabled { get; set; }
1,996✔
357

358
                //        TODO Create test cases
359
                /// <summary>
360
                /// Is background mask fill on
361
                /// </summary>
362
                [DxfCodeValue(292)]
363
                public bool BackgroundMaskFillOn { get; set; }
1,996✔
364

365
                //        TODO Create test cases
366
                /// <summary>
367
                /// Column type (ODA writes 0)
368
                /// </summary>
369
                [DxfCodeValue(173)]
370
                public short ColumnType { get; set; }
1,996✔
371

372
                //        TODO Create test cases
373
                /// <summary>
374
                /// Is text height automatic?
375
                /// </summary>
376
                [DxfCodeValue(293)]
377
                public bool TextHeightAutomatic { get; set; }
1,996✔
378

379
                //        TODO Create test cases
380
                /// <summary>
381
                /// Column width
382
                /// </summary>
383
                [DxfCodeValue(142)]
384
                public double ColumnWidth { get; set; }
1,996✔
385

386
                //        TODO Create test cases
387
                /// <summary>
388
                /// Column gutter
389
                /// </summary>
390
                [DxfCodeValue(143)]
391
                public double ColumnGutter { get; set; }
1,996✔
392

393
                //        TODO Create test cases
394
                /// <summary>
395
                /// Column flow reversed
396
                /// </summary>
397
                [DxfCodeValue(294)]
398
                public bool ColumnFlowReversed { get; set; }
1,996✔
399

400
                //        TODO Create test cases
401
                /// <summary>
402
                /// Get a list of column sizes
403
                /// </summary>
404
                [DxfCodeValue(144)]
405
                public IList<double> ColumnSizes { get; } = new List<double>();
2,011✔
406

407
                //        TODO Create test cases
408
                /// <summary>
409
                /// Word break
410
                /// </summary>
411
                [DxfCodeValue(295)]
412
                public bool WordBreak { get; set; }
1,996✔
413

414
                //        TODO Check dependency of HasTextContent, HasContentBlock and MultiLeader.ContentType
415
                /// <summary>
416
                /// Gets or sets a value indicating that the multileader has a content block.
417
                /// </summary>
418
                [DxfCodeValue(296)]
419
                public bool HasContentsBlock { get; set; }
5✔
420

421
                /// <summary>
422
                /// Gets a <see cref="BlockRecord"/> containing elements
423
                /// to be drawn as content for the multileader.
424
                /// </summary>
425
                [DxfCodeValue(DxfReferenceType.Handle, 341)]
426
                public BlockRecord BlockContent
427
                {
428
                        get { return this._blockContent; }
×
429
                        set 
430
                        {
×
431
                                this._blockContent = CadObject.updateCollection(value, this.Document?.BlockRecords);
×
432
                        }
×
433
                }
434

435
                /// <summary>
436
                /// Gets or sets the normal vector for the block content of the multileader.
437
                /// </summary>
438
                [DxfCodeValue(14, 24, 34)]
439
                public XYZ BlockContentNormal { get; set; }
1✔
440

441
                /// <summary>
442
                /// Gets or sets the location of the böock content of the multileader.
443
                /// </summary>
444
                /// <remarks>
445
                /// This location is evaluated by AutoCAD from the <see cref="Conn"/>
446
                /// </remarks>
447
                [DxfCodeValue(15, 25, 35)]
448
                public XYZ BlockContentLocation { get; set; }
1✔
449

450
                /// <summary>
451
                /// Gets or sets the scale factor for block content.
452
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
453
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentScale"/> flag is set (see
454
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
455
                /// </summary>
456
                /// <remarks>
457
                /// This property is also exposed by the <see cref="MultiLeader"/> class
458
                /// (<see cref="MultiLeader.BlockContentScale"/>).
459
                /// Values should be equal, the value of this property is assumed to be used.
460
                /// </remarks>
461
                [DxfCodeValue(16, 26, 36)]
462
                public XYZ BlockContentScale { get; set; }
1✔
463

464
                /// <summary>
465
                /// Gets or sets the rotation of the block content of the multileader.
466
                /// </summary>
467
                /// <remarks>
468
                /// This property is also exposed by the <see cref="MultiLeader"/> class
469
                /// (<see cref="MultiLeader.BlockContentRotation"/>).
470
                /// Values should be equal, the value of this property is assumed to be used.
471
                /// </remarks>
472
                /// <value>
473
                /// The rotation angle in radians.
474
                /// </value>
475
                [DxfCodeValue(DxfReferenceType.IsAngle, 46)]
476
                public double BlockContentRotation { get; set; }
1✔
477

478
                /// <summary>
479
                /// Gets or sets the block-content color.
480
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
481
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentColor"/> flag is set (see
482
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
483
                /// </summary>
484
                /// <remarks>
485
                /// This property is also exposed by the <see cref="MultiLeader"/> class
486
                /// (<see cref="MultiLeader.BlockContentColor"/>).
487
                /// Values should be equal, the value of this property is assumed to be used.
488
                /// </remarks>
489
                [DxfCodeValue(93)]
490
                public Color BlockContentColor { get; set; }
1✔
491

492
                /// <summary>
493
                /// Gets a array of 16 doubles containg the complete transformation
494
                /// matrix.
495
                /// </summary>
496
                /// <remarks>
497
                /// <para>
498
                /// Order of transformation is:
499
                /// </para>
500
                /// <list type="ordered">
501
                ///        <item>Rotation,</item>
502
                ///        <item>OCS to WCS (using normal vector),</item>
503
                ///        <item>Scaling (using scale vector),</item>
504
                ///        <item>Translation (using location)</item>
505
                /// </list>
506
                /// </remarks>
507
                [DxfCodeValue(93)]
508
                public Matrix4 TransformationMatrix { get; set; }
×
509

510
                /// <summary>
511
                /// Base point
512
                /// </summary>
513
                [DxfCodeValue(110, 120, 130)]
514
                public XYZ BasePoint { get; set; }
2,009✔
515

516
                /// <summary>
517
                /// Base direction
518
                /// </summary>
519
                [DxfCodeValue(111, 121, 131)]
520
                public XYZ BaseDirection { get; set; }
2,000✔
521

522
                /// <summary>
523
                /// Base vertical
524
                /// </summary>
525
                [DxfCodeValue(112, 122, 132)]
526
                public XYZ BaseVertical { get; set; }
2,000✔
527

528
                /// <summary>
529
                /// Is normal reversed?
530
                /// </summary>
531
                [DxfCodeValue(297)]
532
                public bool NormalReversed { get; set; }
2,000✔
533

534
                /// <summary>
535
                /// Gets or sets the text top attachment type (see <see cref="MultiLeaderStyle.TextTopAttachment"/>).
536
                /// This property override the value from <see cref="MultiLeaderStyle"/>
537
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextTopAttachment"/> flag is set (see
538
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
539
                /// </summary>
540
                /// <remarks>
541
                /// This property is also exposed by the <see cref="MultiLeader"/> class
542
                /// (<see cref="MultiLeader.TextTopAttachment"/>).
543
                /// Values should be equal, the value of this property is assumed to be used.
544
                /// </remarks>
545
                /// <value>
546
                /// A <see cref="TextAttachmentType"/> having the values
547
                ///         9 = Center,
548
                ///         10 = Underline and Center
549
                /// can be used ("vertical" attachment types).
550
                /// </value>
551
                [DxfCodeValue(273)]
552
                public TextAttachmentType TextTopAttachment { get; set; }
858✔
553

554
                /// <summary>
555
                /// Gets or sets the text bottom attachment type (see <see cref="MultiLeaderStyle.TextBottomAttachment"/>).
556
                /// This property override the value from <see cref="MultiLeaderStyle"/>
557
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextBottomAttachment"/> flag is set (see
558
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
559
                /// </summary>
560
                /// <remarks>
561
                /// This property is also exposed by the <see cref="MultiLeader"/> class
562
                /// (<see cref="MultiLeader.TextBottomAttachment"/>).
563
                /// Values should be equal, the value of this property is assumed to be used.
564
                /// </remarks>
565
                /// <value>
566
                /// A <see cref="TextAttachmentType"/> having the values
567
                ///         9 = Center,
568
                ///         10 = Underline and Center
569
                /// can be used ("vertical" attachment types).
570
                /// </value>
571
                [DxfCodeValue(272)]
572
                public TextAttachmentType TextBottomAttachment { get; set; }
858✔
573

574
                /// <summary>
575
                /// Initializes a new instance of a <see cref="MultiLeaderObjectContextData"/>.
576
                /// </summary>
577
                public MultiLeaderObjectContextData() : base() { }
6,033✔
578

579
                public override CadObject Clone() {
4✔
580
                        MultiLeaderObjectContextData clone = (MultiLeaderObjectContextData)base.Clone();
4✔
581

582
                        clone._textStyle = (TextStyle)this._textStyle.Clone();
4✔
583
                        clone._blockContent = (BlockRecord)this._blockContent?.Clone();
4!
584

585
                        clone.LeaderRoots = new List<LeaderRoot>();
4✔
586
                        foreach (LeaderRoot leaderRoot in this.LeaderRoots)
12!
587
                        {
×
588
                                clone.LeaderRoots.Add((LeaderRoot)leaderRoot.Clone());
×
589
                        }
×
590

591
                        return clone;
4✔
592
                }
4✔
593

594
                internal override void AssignDocument(CadDocument doc)
595
                {
2,215✔
596
                        base.AssignDocument(doc);
2,215✔
597

598
                        this._textStyle = CadObject.updateCollection(this._textStyle, doc.TextStyles);
2,215✔
599
                        this._blockContent = CadObject.updateCollection(this._blockContent, doc.BlockRecords);
2,215✔
600

601
                        foreach (LeaderRoot leaderRoot in this.LeaderRoots)
11,073✔
602
                        {
2,214✔
603
                                foreach (LeaderLine leaderLine in leaderRoot.Lines)
11,070✔
604
                                {
2,214✔
605
                                        leaderLine.AssignDocument(doc);
2,214✔
606
                                }
2,214✔
607
                        }
2,214✔
608

609
                        this.Document.TextStyles.OnRemove += tableOnRemove;
2,215✔
610
                        this.Document.BlockRecords.OnRemove += tableOnRemove;
2,215✔
611
                }
2,215✔
612

613
                internal override void UnassignDocument()
614
                {
210✔
615
                        this.Document.TextStyles.OnRemove -= tableOnRemove;
210✔
616
                        this.Document.BlockRecords.OnRemove -= tableOnRemove;
210✔
617

618
                        base.UnassignDocument();
210✔
619

620
                        this._textStyle = (TextStyle)this._textStyle.Clone();
210✔
621
                        this._blockContent = (BlockRecord)this._blockContent?.Clone();
210!
622

623
                        foreach (LeaderRoot leaderRoot in this.LeaderRoots)
1,050✔
624
                        {
210✔
625
                                foreach (LeaderLine leaderLine in leaderRoot.Lines)
1,050✔
626
                                {
210✔
627
                                        leaderLine.UassignDocument();
210✔
628
                                }
210✔
629
                        }
210✔
630
                }
210✔
631

632
                private void tableOnRemove(object sender, CollectionChangedEventArgs e)
633
                {
×
634
                        if (e.Item.Equals(this._textStyle))
×
635
                        {
×
636
                                this._textStyle = this.Document.TextStyles[TextStyle.DefaultName];
×
637
                        }
×
638
                        if (e.Item == this._blockContent)
×
639
                        {
×
640
                                this._blockContent = null;
×
641
                        }
×
642
                }
×
643
        }
644
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc