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

DomCR / ACadSharp / 18679832337

21 Oct 2025 09:46AM UTC coverage: 77.883% (-0.2%) from 78.126%
18679832337

push

github

web-flow
Merge pull request #832 from DomCR/multileader-dxf

multileader dxf

6920 of 9695 branches covered (71.38%)

Branch coverage included in aggregate %.

341 of 429 new or added lines in 16 files covered. (79.49%)

77 existing lines in 8 files now uncovered.

26664 of 33426 relevant lines covered (79.77%)

110330.18 hits per line

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

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

8
namespace ACadSharp.Objects
9
{
10
        /// <summary>
11
        /// This class represents a subset ob the properties of the MLeaderAnnotContext
12
        /// object, that are embedded into the MultiLeader entity.
13
        /// </summary>
14
        [DxfName(DxfFileToken.ObjectMLeaderContextData)]
15
        [DxfSubClass(DxfSubclassMarker.MultiLeaderObjectContextData)]
16
        public partial class MultiLeaderObjectContextData : AnnotScaleObjectContextData
17
        {
18
                /// <summary>
19
                /// Gets or sets the arrowhead size (see <see cref="MultiLeaderStyle.Arrowhead"/>)
20
                /// for every leader line.
21
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
22
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.ArrowheadSize"/> flag is set in the
23
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
24
                /// </summary>
25
                /// <remarks>
26
                /// <para>
27
                /// The value for all leader lines can be overridden for each individual leader line by the
28
                /// <see cref="LeaderLine.ArrowheadSize"/> property when the
29
                /// <see cref="LeaderLinePropertOverrideFlags.ArrowheadSize"/> flag is set in the
30
                /// <see cref="LeaderLine.OverrideFlags"/> property.
31
                /// </para><para>
32
                /// This property is also exposed by the <see cref="MultiLeader"/> class
33
                /// (<see cref="MultiLeader.ArrowheadSize"/>).
34
                /// Values should be equal, the value of this property is assumed to be used.
35
                /// </para>
36
                /// </remarks>
37
                /// <value>
38
                /// The value returned is the value entered in AutoCAD multiplied with the <see cref="ScaleFactor"/>.
39
                /// </value>
40
                [DxfCodeValue(140)]
41
                public double ArrowheadSize { get; set; }
5,995✔
42

43
                //        TODO Create test cases
44
                /// <summary>
45
                /// Background fill color
46
                /// </summary>
47
                [DxfCodeValue(91)]
48
                public Color BackgroundFillColor { get; set; }
2,391✔
49

50
                //        TODO Create test cases
51
                /// <summary>
52
                /// Is background fill enabled
53
                /// </summary>
54
                [DxfCodeValue(291)]
55
                public bool BackgroundFillEnabled { get; set; }
5,991✔
56

57
                //        TODO Create test cases
58
                /// <summary>
59
                /// Is background mask fill on
60
                /// </summary>
61
                [DxfCodeValue(292)]
62
                public bool BackgroundMaskFillOn { get; set; }
5,991✔
63

64
                //        TODO Create test cases
65
                /// <summary>
66
                /// Background scale factor
67
                /// </summary>
68
                [DxfCodeValue(141)]
69
                public double BackgroundScaleFactor { get; set; }
5,991✔
70

71
                //        TODO Create test cases
72
                /// <summary>
73
                /// Background transparency
74
                /// </summary>
75
                [DxfCodeValue(92)]
76
                public int BackgroundTransparency { get; set; }
5,991✔
77

78
                /// <summary>
79
                /// Base direction
80
                /// </summary>
81
                [DxfCodeValue(111, 121, 131)]
82
                public XYZ BaseDirection { get; set; }
23,995✔
83

84
                /// <summary>
85
                /// Base point
86
                /// </summary>
87
                [DxfCodeValue(110, 120, 130)]
88
                public XYZ BasePoint { get; set; }
24,004✔
89

90
                /// <summary>
91
                /// Base vertical
92
                /// </summary>
93
                [DxfCodeValue(112, 122, 132)]
94
                public XYZ BaseVertical { get; set; }
23,995✔
95

96
                /// <summary>
97
                /// Gets a <see cref="BlockRecord"/> containing elements
98
                /// to be drawn as content for the multileader.
99
                /// </summary>
100
                [DxfCodeValue(DxfReferenceType.Handle, 341)]
101
                public BlockRecord BlockContent
102
                {
NEW
103
                        get { return this._blockContent; }
×
104
                        set
NEW
105
                        {
×
NEW
106
                                this._blockContent = CadObject.updateCollection(value, this.Document?.BlockRecords);
×
NEW
107
                        }
×
108
                }
109

110
                /// <summary>
111
                /// Gets or sets the block-content color.
112
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
113
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentColor"/> flag is set (see
114
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
115
                /// </summary>
116
                /// <remarks>
117
                /// This property is also exposed by the <see cref="MultiLeader"/> class
118
                /// (<see cref="MultiLeader.BlockContentColor"/>).
119
                /// Values should be equal, the value of this property is assumed to be used.
120
                /// </remarks>
121
                //[DxfCodeValue(93)]
122
                public Color BlockContentColor { get; set; }
1✔
123

124
                /// <summary>
125
                /// Gets or sets a value indicating whether the multileader connects to the content-block extents
126
                /// or to the content-block base point.
127
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
128
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentConnection"/> flag is set in the
129
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
130
                /// </summary>
131
                /// <remarks>
132
                /// This property is also exposed by the <see cref="MultiLeader"/> class
133
                /// (<see cref="MultiLeader.BlockContentConnection"/>).
134
                /// Values should be equal, the value of this property is assumed to be used.
135
                /// </remarks>
136
                [DxfCodeValue(177)]
137
                public BlockContentConnectionType BlockContentConnection { get; set; }
5,994✔
138

139
                /// <summary>
140
                /// Gets or sets the location of the böock content of the multileader.
141
                /// </summary>
142
                /// <remarks>
143
                /// This location is evaluated by AutoCAD from the <see cref="Conn"/>
144
                /// </remarks>
145
                [DxfCodeValue(15, 25, 35)]
146
                public XYZ BlockContentLocation { get; set; }
1✔
147

148
                /// <summary>
149
                /// Gets or sets the normal vector for the block content of the multileader.
150
                /// </summary>
151
                [DxfCodeValue(14, 24, 34)]
152
                public XYZ BlockContentNormal { get; set; }
1✔
153

154
                /// <summary>
155
                /// Gets or sets the rotation of the block content of the multileader.
156
                /// </summary>
157
                /// <remarks>
158
                /// This property is also exposed by the <see cref="MultiLeader"/> class
159
                /// (<see cref="MultiLeader.BlockContentRotation"/>).
160
                /// Values should be equal, the value of this property is assumed to be used.
161
                /// </remarks>
162
                /// <value>
163
                /// The rotation angle in radians.
164
                /// </value>
165
                [DxfCodeValue(DxfReferenceType.IsAngle, 46)]
166
                public double BlockContentRotation { get; set; }
1✔
167

168
                /// <summary>
169
                /// Gets or sets the scale factor for block content.
170
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
171
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentScale"/> flag is set (see
172
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
173
                /// </summary>
174
                /// <remarks>
175
                /// This property is also exposed by the <see cref="MultiLeader"/> class
176
                /// (<see cref="MultiLeader.BlockContentScale"/>).
177
                /// Values should be equal, the value of this property is assumed to be used.
178
                /// </remarks>
179
                [DxfCodeValue(16, 26, 36)]
180
                public XYZ BlockContentScale { get; set; }
1✔
181

182
                //        TODO
183
                /// <summary>
184
                /// Boundary height (DXF Reference: TextHeight)
185
                /// Value seems to be always zero.
186
                /// </summary>
187
                [DxfCodeValue(44)]
188
                public double BoundaryHeight { get; set; }
5,991✔
189

190
                //        TODO
191
                /// <summary>
192
                /// Boundary width (DXF Reference: TextWidth)
193
                /// Value seems to be always zero.
194
                /// </summary>
195
                [DxfCodeValue(43)]
196
                public double BoundaryWidth { get; set; }
5,991✔
197

198
                //        TODO Create test cases
199
                /// <summary>
200
                /// Column flow reversed
201
                /// </summary>
202
                [DxfCodeValue(294)]
203
                public bool ColumnFlowReversed { get; set; }
5,991✔
204

205
                //        TODO Create test cases
206
                /// <summary>
207
                /// Column gutter
208
                /// </summary>
209
                [DxfCodeValue(143)]
210
                public double ColumnGutter { get; set; }
5,991✔
211

212
                //        TODO Create test cases
213
                /// <summary>
214
                /// Get a list of column sizes
215
                /// </summary>
216
                [DxfCodeValue(144)]
217
                public IList<double> ColumnSizes { get; } = new List<double>();
5,611✔
218

219
                //        TODO Create test cases
220
                /// <summary>
221
                /// Column type (ODA writes 0)
222
                /// </summary>
223
                [DxfCodeValue(173)]
224
                public short ColumnType { get; set; }
5,991✔
225

226
                //        TODO Create test cases
227
                /// <summary>
228
                /// Column width
229
                /// </summary>
230
                [DxfCodeValue(142)]
231
                public double ColumnWidth { get; set; }
5,991✔
232

233
                //        TODO
234
                /// <summary>
235
                /// Gets or sets the content base point. This point is identical with the landing end
236
                /// point of the first leader.
237
                /// </summary>
238
                /// <remarks>
239
                /// This point
240
                /// </remarks>
241
                [DxfCodeValue(10, 20, 30)]
242
                public XYZ ContentBasePoint { get; set; }
24,004✔
243

244
                /// <summary>
245
                /// Direction
246
                /// </summary>
247
                [DxfCodeValue(13, 23, 33)]
248
                public XYZ Direction { get; set; }
23,991✔
249

250
                //        TODO What is exactly ment by "flow direction"?
251
                //                 When the value is not Horizontal line breaks in text label have to be ignored.
252
                //             The value returned by AutoCAD is normally 5. This not a valid enum value.
253
                /// <summary>
254
                /// Gets or sets a value indicating the flow direction.
255
                /// </summary>
256
                [DxfCodeValue(172)]
257
                public FlowDirectionType FlowDirection { get; set; }
5,990✔
258

259
                //        TODO Check dependency of HasTextContent, HasContentBlock and MultiLeader.ContentType
260
                /// <summary>
261
                /// Gets or sets a value indicating that the multileader has a content block.
262
                /// </summary>
263
                [DxfCodeValue(296)]
264
                public bool HasContentsBlock { get; set; }
4,000✔
265

266
                //        TODO Check dependency of HasTextContent, HasContentBlock and MultiLeader.ContentType
267
                /// <summary>
268
                /// Gets or sets a value indicating that the mutileader has a text label.
269
                /// </summary>
270
                [DxfCodeValue(290)]
271
                public bool HasTextContents { get; set; }
7,994✔
272

273
                /// <summary>
274
                /// Gets or sets the landing gap (see <see cref="MultiLeaderStyle.LandingGap"/>).
275
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
276
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LandingGap"/> flag is set (see
277
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
278
                /// </summary>
279
                [DxfCodeValue(145)]
280
                public double LandingGap { get; set; }
5,995✔
281

282
                /// <summary>
283
                /// Gets the list of <see cref="LeaderRoot"/> objects of the multileader.
284
                /// </summary>
285
                /// <remarks>
286
                /// A <see cref="MultiLeader"/> can have one or two leader roots having one ore more
287
                /// leader lines each.
288
                /// </remarks>
289
                public IList<LeaderRoot> LeaderRoots { get; private set; } = new List<LeaderRoot>();
17,831✔
290

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

297
                /// <summary>
298
                /// Gets or sets the line-spacing factor for the display of the text label.
299
                /// </summary>
300
                [DxfCodeValue(45)]
301
                public double LineSpacingFactor { get; set; }
5,991✔
302

303
                /// <summary>
304
                /// Is normal reversed?
305
                /// </summary>
306
                [DxfCodeValue(297)]
307
                public bool NormalReversed { get; set; }
5,995✔
308

309
                /// <inheritdoc />
NEW
310
                public override string ObjectName => DxfFileToken.ObjectMLeaderContextData;
×
311

NEW
312
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
313

314
                /// <summary>
315
                /// Gets or sets a scale factor (see <see cref="MultiLeaderStyle.ScaleFactor"/>).
316
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
317
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.ScaleFactor"/> flag is set (see
318
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
319
                /// The scale factor is applied by AutoCAD.
320
                /// </summary>
321
                /// <remarks>
322
                /// <para>
323
                /// The following properties entered in AutoCAD are multiplied with this scale factor:
324
                /// </para>
325
                /// <see cref="ArrowheadSize"/>, <see cref="MultiLeader.LandingDistance"/>, <see cref="LandingGap"/>,
326
                /// <see cref="TextHeight"/>, and the elements of <see cref="BlockContentScale"/>.
327
                /// <para>
328
                /// The <see cref="ContentBasePoint"/> is adjusted.
329
                /// </para>
330
                /// </remarks>
331
                [DxfCodeValue(40)]
332
                public double ScaleFactor { get; set; }
5,995✔
333

334
                /// <inheritdoc />
335
                public override string SubclassMarker => DxfSubclassMarker.MultiLeaderObjectContextData;
190,800✔
336

337
                /// <summary>
338
                /// Gets or sets the text alignment, i.e. the alignment of text lines if the a multiline
339
                /// text label, relative to the <see cref="Location"/>.
340
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
341
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextAlignment"/> flag is set in the
342
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
343
                /// </summary>
344
                /// <remarks><para>
345
                /// This property contains the alignment value specified in AutoCAD rather than
346
                /// <see cref="MultiLeader.TextAlignment"/> and seems always to be consistent with
347
                /// <see cref="TextAttachmentPoint"/>.
348
                /// </para><para>
349
                /// Note that when changing this value the <see cref="Location"/> must be changed
350
                /// accordingly.
351
                /// </para>
352
                /// </remarks>
353
                [DxfCodeValue(176)]
354
                public TextAlignmentType TextAlignment { get; set; }
5,994✔
355

356
                /// <summary>
357
                /// Gets or sets a value indicating the text attachment point.
358
                /// </summary>
359
                /// <remarks><para>
360
                /// In the Open Design Specification this property is documented as <i>Alignment</i>, in DXF
361
                /// reference as <i>Text Attachment</i>. It is not clear what the meaning of this property
362
                /// is in contrast to the <see cref="TextAlignment"/> property. The value seems to be always
363
                /// consistent.
364
                /// </para><para>
365
                /// This property is also exposed by the <see cref="MultiLeader"/> class
366
                /// (<see cref="MultiLeader.TextAttachmentPoint"/>).
367
                /// Values should be equal, the value of this property is assumed to be used.
368
                /// </para>
369
                /// </remarks>
370
                [DxfCodeValue(171)]
371
                public TextAttachmentPointType TextAttachmentPoint { get; set; }
5,990✔
372

373
                /// <summary>
374
                /// Gets or sets the text bottom attachment type (see <see cref="MultiLeaderStyle.TextBottomAttachment"/>).
375
                /// This property override the value from <see cref="MultiLeaderStyle"/>
376
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextBottomAttachment"/> flag is set (see
377
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
378
                /// </summary>
379
                /// <remarks>
380
                /// This property is also exposed by the <see cref="MultiLeader"/> class
381
                /// (<see cref="MultiLeader.TextBottomAttachment"/>).
382
                /// Values should be equal, the value of this property is assumed to be used.
383
                /// </remarks>
384
                /// <value>
385
                /// A <see cref="TextAttachmentType"/> having the values
386
                ///         9 = Center,
387
                ///         10 = Underline and Center
388
                /// can be used ("vertical" attachment types).
389
                /// </value>
390
                [DxfCodeValue(272)]
391
                public TextAttachmentType TextBottomAttachment { get; set; }
3,053✔
392

393
                /// <summary>
394
                /// Gets or sets the color for the display of the text label
395
                /// </summary>
396
                [DxfCodeValue(90)]
397
                public Color TextColor { get; set; }
2,391✔
398

399
                /// <summary>
400
                /// Get or sets the text height for the lext label of the multileader
401
                /// (see <see cref="MultiLeaderStyle.TextHeight"/>).
402
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
403
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextHeight"/> flag is set in the
404
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
405
                /// </summary>
406
                /// <value>
407
                /// The value returned is the value entered in AutoCAD multiplied with the <see cref="ScaleFactor"/>.
408
                /// </value>
409
                [DxfCodeValue(41)]
410
                public double TextHeight { get; set; }
5,995✔
411

412
                //        TODO Create test cases
413
                /// <summary>
414
                /// Is text height automatic?
415
                /// </summary>
416
                [DxfCodeValue(293)]
417
                public bool TextHeightAutomatic { get; set; }
5,991✔
418

419
                /// <summary>
420
                /// Gets or sets a string containg the text tat is to be dispayed a s text label of the
421
                /// multileader.
422
                /// </summary>
423
                /// <remarks>
424
                /// The string may contain MTEXT markups to specify new-lines, font, size, style, etc.
425
                /// </remarks>
426
                [DxfCodeValue(304)]
427
                public string TextLabel { get; set; }
6,255✔
428

429
                /// <summary>
430
                /// Gets or sets the text top attachment type (see <see cref="MultiLeaderStyle.TextLeftAttachment"/>).
431
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
432
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextLeftAttachment"/> flag is set (see
433
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
434
                /// </summary>
435
                /// <remarks>
436
                /// This property is also exposed by the <see cref="MultiLeader"/> class
437
                /// (<see cref="MultiLeader.TextLeftAttachment"/>).
438
                /// Values should be equal, the value of this property is assumed to be used.
439
                /// </remarks>
440
                /// <value>
441
                /// A <see cref="TextAttachmentType"/> having the values 0-8
442
                /// can be used ("horizontal" attachment types).
443
                /// </value>
444
                [DxfCodeValue(174)]
445
                public TextAttachmentType TextLeftAttachment { get; set; }
5,994✔
446

447
                /// <summary>
448
                /// Gets or sets the location of the text label of the multileader.
449
                /// </summary>
450
                /// <remarks>
451
                /// This location is evaluated by AutoCAD from the <see cref="Conn"/>
452
                /// </remarks>
453
                [DxfCodeValue(12, 22, 32)]
454
                public XYZ TextLocation { get; set; }
23,991✔
455

456
                /// <summary>
457
                /// Gets or sets the normal vector for the text label of the multileader.
458
                /// </summary>
459
                [DxfCodeValue(11, 21, 31)]
460
                public XYZ TextNormal { get; set; }
23,991✔
461

462
                /// <summary>
463
                /// Gets or sets the text top attachment type (see <see cref="MultiLeaderStyle.TextRightAttachment"/>).
464
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
465
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextRightAttachment"/> flag is set (see
466
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
467
                /// </summary>
468
                /// <remarks>
469
                /// This property is also exposed by the <see cref="MultiLeader"/> class
470
                /// (<see cref="MultiLeader.TextRightAttachment"/>).
471
                /// Values should be equal, the value of this property is assumed to be used.
472
                /// </remarks>
473
                /// <value>
474
                /// A <see cref="TextAttachmentType"/> having the values 0-8
475
                /// can be used ("horizontal" attachment types).
476
                /// </value>
477
                [DxfCodeValue(175)]
478
                public TextAttachmentType TextRightAttachment { get; set; }
5,994✔
479

480
                /// <summary>
481
                /// Gets or sets the rotation of the text label of the multileader.
482
                /// </summary>
483
                /// <value>
484
                /// The rotation angle in radians.
485
                /// </value>
486
                [DxfCodeValue(DxfReferenceType.IsAngle, 42)]
487
                public double TextRotation { get; set; }
5,991✔
488

489
                /// <summary>
490
                /// Gets or sets the <see cref="TextStyle"/> to be used to display the text label of the
491
                /// multileader.
492
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
493
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextStyle"/> flag is set in the
494
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
495
                /// </summary>
496
                /// <remarks>
497
                /// This property is also exposed by the <see cref="MultiLeader"/> class
498
                /// (<see cref="MultiLeader.TextStyle"/>).
499
                /// Values should be equal, the value of this property is assumed to be used.
500
                /// </remarks>
501
                [DxfCodeValue(DxfReferenceType.Handle, 340)]
502
                public TextStyle TextStyle
503
                {
504
                        get { return this._textStyle; }
1,185✔
505
                        set
506
                        {
5,415✔
507
                                if (value == null)
5,415!
NEW
508
                                {
×
NEW
509
                                        throw new ArgumentNullException(nameof(value));
×
510
                                }
511

512
                                if (this.Document != null)
5,415!
513
                                {
5,415✔
514
                                        this._textStyle = CadObject.updateCollection(value, this.Document.TextStyles);
5,415✔
515
                                }
5,415✔
516
                                else
NEW
517
                                {
×
NEW
518
                                        this._textStyle = value;
×
NEW
519
                                }
×
520
                        }
5,415✔
521
                }
522

523
                /// <summary>
524
                /// Gets or sets the text top attachment type (see <see cref="MultiLeaderStyle.TextTopAttachment"/>).
525
                /// This property override the value from <see cref="MultiLeaderStyle"/>
526
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextTopAttachment"/> flag is set (see
527
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
528
                /// </summary>
529
                /// <remarks>
530
                /// This property is also exposed by the <see cref="MultiLeader"/> class
531
                /// (<see cref="MultiLeader.TextTopAttachment"/>).
532
                /// Values should be equal, the value of this property is assumed to be used.
533
                /// </remarks>
534
                /// <value>
535
                /// A <see cref="TextAttachmentType"/> having the values
536
                ///         9 = Center,
537
                ///         10 = Underline and Center
538
                /// can be used ("vertical" attachment types).
539
                /// </value>
540
                [DxfCodeValue(273)]
541
                public TextAttachmentType TextTopAttachment { get; set; }
3,053✔
542

543
                /// <summary>
544
                /// Gets a array of 16 doubles containg the complete transformation
545
                /// matrix.
546
                /// </summary>
547
                /// <remarks>
548
                /// <para>
549
                /// Order of transformation is:
550
                /// </para>
551
                /// <list type="ordered">
552
                ///        <item>Rotation,</item>
553
                ///        <item>OCS to WCS (using normal vector),</item>
554
                ///        <item>Scaling (using scale vector),</item>
555
                ///        <item>Translation (using location)</item>
556
                /// </list>
557
                /// </remarks>
558
                //[DxfCodeValue(93)]
NEW
559
                public Matrix4 TransformationMatrix { get; set; }
×
560

561
                //        TODO Create test cases
562
                /// <summary>
563
                /// Word break
564
                /// </summary>
565
                [DxfCodeValue(295)]
566
                public bool WordBreak { get; set; }
5,991✔
567

568
                private BlockRecord _blockContent;
569

570
                private TextStyle _textStyle = TextStyle.Default;
5,611✔
571

572
                /// <summary>
573
                /// Initializes a new instance of a <see cref="MultiLeaderObjectContextData"/>.
574
                /// </summary>
575
                public MultiLeaderObjectContextData() : base() { }
16,833✔
576

577
                /// <inheritdoc/>
578
                public override CadObject Clone()
579
                {
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
                {
5,815✔
596
                        base.AssignDocument(doc);
5,815✔
597

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

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

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

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

618
                        base.UnassignDocument();
390✔
619

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

623
                        foreach (LeaderRoot leaderRoot in this.LeaderRoots)
1,950✔
624
                        {
390✔
625
                                foreach (LeaderLine leaderLine in leaderRoot.Lines)
1,950✔
626
                                {
390✔
627
                                        leaderLine.UassignDocument();
390✔
628
                                }
390✔
629
                        }
390✔
630
                }
390✔
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