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

DomCR / ACadSharp / 29143042407

11 Jul 2026 06:34AM UTC coverage: 2.912% (-73.0%) from 75.918%
29143042407

push

github

web-flow
Merge pull request #1146 from ilCosmico/acds-read-payload-anchor

Read the AcDs payload area offset from the data segment header

264 of 12999 branches covered (2.03%)

Branch coverage included in aggregate %.

0 of 30 new or added lines in 1 file covered. (0.0%)

31243 existing lines in 465 files now uncovered.

1337 of 41984 relevant lines covered (3.18%)

5.38 hits per line

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

0.0
/src/ACadSharp/Objects/MultiLeaderStyle.cs
1
using System;
2
using ACadSharp.Attributes;
3
using ACadSharp.Entities;
4
using ACadSharp.Tables;
5
using CSMath;
6

7
namespace ACadSharp.Objects
8
{
9
        /// <summary>
10
        /// Represents a <see cref="MultiLeaderStyle"/> object.
11
        /// </summary>
12
        /// <remarks>
13
        /// Object name <see cref="DxfFileToken.ObjectMLeaderStyle"/> <br/>
14
        /// Dxf class name <see cref="DxfSubclassMarker.MLeaderStyle"/>
15
        /// </remarks>
16
        [DxfName(DxfFileToken.ObjectMLeaderStyle)]
17
        [DxfSubClass(DxfSubclassMarker.MLeaderStyle)]
18
        public class MultiLeaderStyle : NonGraphicalObject
19
        {
20
                /// <summary>
21
                /// Gets the default MultiLeaderStyle
22
                /// </summary>
UNCOV
23
                public static MultiLeaderStyle Default { get { return new MultiLeaderStyle(DefaultName); } }
×
24

25
                //        TODO What is the meaning of this property?
26
                /// <summary>
27
                /// Align Space
28
                /// </summary>
29
                [DxfCodeValue(46)]
UNCOV
30
                public double AlignSpace { get; set; } = 0.0;
×
31

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

58
                /// <summary>
59
                /// Gests or sets the arrowhead size.
60
                /// </summary>
61
                /// <remarks>
62
                /// <para>
63
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.ArrowheadSize"/> property
64
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.ArrowheadSize"/> flag is set in the
65
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
66
                /// </para><para>
67
                /// The value for all leader lines can be overridden for each individual leader line by the
68
                /// <see cref="MultiLeaderObjectContextData.LeaderLine.ArrowheadSize"/> property when the
69
                /// <see cref="LeaderLinePropertOverrideFlags.ArrowheadSize"/> flag is set in the
70
                /// <see cref="MultiLeaderObjectContextData.LeaderLine.OverrideFlags"/> property.
71
                /// </para>
72
                /// </remarks>
73
                [DxfCodeValue(44)]
UNCOV
74
                public double ArrowheadSize { get; set; } = 0.18;
×
75

76
                /// <summary>
77
                /// Gets a <see cref="BlockRecord"/> containing elements
78
                /// to be drawn as content for the multileader.
79
                /// </summary>
80
                /// <remarks>
81
                /// <para>
82
                /// Thw standard content block can be overridden by the <see cref="MultiLeaderObjectContextData.BlockContent"/>
83
                /// property when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContent"/> flag is set in the
84
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
85
                /// </para>
86
                /// </remarks>
87
                [DxfCodeValue(DxfReferenceType.Handle, 343)]
88
                public BlockRecord BlockContent
89
                {
UNCOV
90
                        get { return this._blockContent; }
×
91
                        set
UNCOV
92
                        {
×
UNCOV
93
                                this._blockContent = CadObject.updateCollection(value, this.Document?.BlockRecords);
×
UNCOV
94
                        }
×
95
                }
96

97
                /// <summary>
98
                /// Gets or sets the block-content color.
99
                /// </summary>
100
                /// <remarks>
101
                /// <para>
102
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.BlockContentColor"/> property
103
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentColor"/> flag is set in the
104
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
105
                /// </para>
106
                /// </remarks>
107
                [DxfCodeValue(94)]
UNCOV
108
                public Color BlockContentColor { get; set; } = Color.ByBlock;
×
109

110
                /// <summary>
111
                /// Gets or sets a value indicating whether the multileader connects to the content-block extents
112
                /// or to the content-block base point.
113
                /// </summary>
114
                /// <remarks>
115
                /// <para>
116
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.BlockContentConnection"/> property
117
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentConnection"/> flag is set in the
118
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
119
                /// </para>
120
                /// </remarks>
121
                [DxfCodeValue(177)]
UNCOV
122
                public BlockContentConnectionType BlockContentConnection { get; set; }
×
123

124
                /// <summary>
125
                /// Gets or sets the block content rotation.
126
                /// </summary>
127
                /// <remarks>
128
                /// <para>
129
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.BlockContentRotation"/> property
130
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentRotation"/> flag is set in the
131
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
132
                /// </para>
133
                /// </remarks>
134
                [DxfCodeValue(DxfReferenceType.IsAngle, 141)]
UNCOV
135
                public double BlockContentRotation { get; set; } = 0.0;
×
136

137
                /// <summary>
138
                /// Gets or sets the scale factor for block content.
139
                /// </summary>
140
                /// <remarks>
141
                /// <para>
142
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.BlockContentScale"/> property
143
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentScale"/> flag is set in the
144
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
145
                /// </para>
146
                /// </remarks>
147
                public XYZ BlockContentScale
148
                {
149
                        get
UNCOV
150
                        {
×
UNCOV
151
                                return this._blockContentScale;
×
UNCOV
152
                        }
×
153
                        set
UNCOV
154
                        {
×
UNCOV
155
                                this._blockContentScale = value;
×
UNCOV
156
                        }
×
157
                }
158

159
                /// <summary>
160
                /// Gets or sets the scale factor along the X-axis for the block content.
161
                /// </summary>
162
                [DxfCodeValue(47)]
163
                public double BlockContentScaleX
164
                {
165
                        get { return this._blockContentScale.X; }
×
166
                        set
UNCOV
167
                        {
×
UNCOV
168
                                this._blockContentScale.X = value;
×
UNCOV
169
                        }
×
170
                }
171

172
                /// <summary>
173
                /// Gets or sets the scale factor applied to the Y-axis of the block content.
174
                /// </summary>
175
                [DxfCodeValue(49)]
176
                public double BlockContentScaleY
177
                {
178
                        get { return this._blockContentScale.Y; }
×
179
                        set
UNCOV
180
                        {
×
UNCOV
181
                                this._blockContentScale.Y = value;
×
UNCOV
182
                        }
×
183
                }
184

185
                /// <summary>
186
                /// Gets or sets the scale factor along the Z-axis for the block content.
187
                /// </summary>
188
                [DxfCodeValue(140)]
189
                public double BlockContentScaleZ
190
                {
191
                        get { return this._blockContentScale.Z; }
×
192
                        set
UNCOV
193
                        {
×
UNCOV
194
                                this._blockContentScale.Z = value;
×
UNCOV
195
                        }
×
196
                }
197

198
                //        TODO What is the meaning of this property?
199
                /// <summary>
200
                /// Break Gap Size
201
                /// </summary>
202
                [DxfCodeValue(143)]
UNCOV
203
                public double BreakGapSize { get; set; } = 0.125;
×
204

205
                /// <summary>
206
                /// Gets or sets a value indicating the content type for the multileader.
207
                /// </summary>
208
                /// <remarks>
209
                /// <para>
210
                /// This value can be overridden by the <see cref="MultiLeader.ContentType"/> property when the
211
                /// <see cref="MultiLeaderPropertyOverrideFlags.ContentType"/> flag is set in the
212
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
213
                /// </para>
214
                /// </remarks>
215
                [DxfCodeValue(170)]
UNCOV
216
                public LeaderContentType ContentType { get; set; } = LeaderContentType.MText;
×
217

218
                /// <summary>
219
                /// Gests or sets a default text that is to be set when a mutileader is being created
220
                /// with this <see cref="MultiLeaderStyle"/>.
221
                /// </summary>
222
                [DxfCodeValue(300)]
UNCOV
223
                public string DefaultTextContents { get; set; } = string.Empty;
×
224

225
                /// <summary>
226
                /// Gets or sets a text containing the description of this <see cref="MultiLeaderStyle"/>.
227
                /// </summary>
228
                [DxfCodeValue(3)]
UNCOV
229
                public string Description { get; set; } = string.Empty;
×
230

231
                //        TODO: Cannot be overridden? Is this property only relevant in AutoCAD?
232
                /// <summary>
233
                /// Gets or sets a value indicating whether rotation of the block content is enabled.
234
                /// </summary>
235
                [DxfCodeValue(294)]
UNCOV
236
                public bool EnableBlockContentRotation { get; set; }
×
237

238
                //        TODO: Cannot be overridden? Is this property only relevant in AutoCAD?
239
                /// <summary>
240
                /// Gets or sets a value indicating whether scaling of the block content is enabled.
241
                /// </summary>
242
                [DxfCodeValue(293)]
UNCOV
243
                public bool EnableBlockContentScale { get; set; }
×
244

245
                /// <summary>
246
                /// Gets or sets a value indicating that leader lines are to be drawn with a dogleg.
247
                /// </summary>
248
                /// <remarks>
249
                /// <para>
250
                /// This value can be overridden by the <see cref="MultiLeader.EnableDogleg"/> property
251
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.EnableDogleg"/> flag is set in the
252
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
253
                /// </para><para>
254
                /// Note that this setting has no effect when the <see cref="TextAttachmentDirection"/>
255
                /// is <see cref="TextAttachmentDirectionType.Vertical"/>.
256
                /// </para>
257
                /// </remarks>
258
                [DxfCodeValue(291)]
UNCOV
259
                public bool EnableDogleg { get; set; } = true;
×
260

261
                //        TODO It seems that this value indicates that for a new leader that is being created
262
                //                 with this <see cref="MultiLeaderStyle" /> landing i.e. a dogleg is enabled.
263
                //                 But why can this value be overridden?
264
                //
265
                /// <summary>
266
                /// Gets or sets a value indicating whether landing is enabled.
267
                /// </summary>
268
                /// <remarks>
269
                /// <para>
270
                /// This value can be overridden by the <see cref="MultiLeader.EnableLanding"/> property
271
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.EnableLanding"/> flag is set in the
272
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
273
                /// </para>
274
                /// </remarks>
275
                [DxfCodeValue(290)]
UNCOV
276
                public bool EnableLanding { get; set; } = true;
×
277

278
                /// <summary>
279
                /// Gets or sets a snap angle value for the first leader segment when a leader line
280
                /// is being created for the mutileader.
281
                /// </summary>
282
                /// <remarks>
283
                /// This property supports creating and editing a multileader but has no meaning for
284
                /// the display of multileaders.
285
                /// </remarks>
286
                /// <value>
287
                /// An angle value in radians or zero if no angle contstraint is set.
288
                /// </value>
289
                [DxfCodeValue(40)]
UNCOV
290
                public double FirstSegmentAngleConstraint { get; set; }
×
291

292
                /// <summary>
293
                /// Is Annotative
294
                /// </summary>
295
                [DxfCodeValue(296)]
UNCOV
296
                public bool IsAnnotative { get; set; }
×
297

298
                /// <summary>
299
                /// Gets or sets the landing distance, i.e. the length of the dogleg.
300
                /// </summary>
301
                /// <remarks>
302
                /// <para>
303
                /// This value can be overridden by the <see cref="MultiLeader.LandingDistance"/> property
304
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LandingDistance"/> flag is set in the
305
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
306
                /// </para>
307
                /// </remarks>
308
                [DxfCodeValue(43)]
UNCOV
309
                public double LandingDistance { get; set; } = 0.36;
×
310

311
                /// <summary>
312
                /// Gets or sets the landing gap. This is the distance between the leader end point or, if present,
313
                /// the end of the dogleg and the text label or the content block.
314
                /// </summary>
315
                /// <remarks>
316
                /// <para>
317
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.LandingGap"/> property
318
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LandingGap"/> flag is set in the
319
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
320
                /// </para>
321
                /// </remarks>
322
                [DxfCodeValue(42)]
UNCOV
323
                public double LandingGap { get; set; } = 0.09;
×
324

325
                //        TODO What is the meaning of this property? Is it relevant for drawing a multileader?
326
                /// <summary>
327
                /// DrawLeaderOrder Type
328
                /// </summary>
329
                [DxfCodeValue(172)]
UNCOV
330
                public LeaderDrawOrderType LeaderDrawOrder { get; set; }
×
331

332
                /// <summary>
333
                /// Gets or sets a <see cref="LineType"/> object specifying line-type properties for the
334
                /// musltileader. This setting applies for all leader lines of the multileader.
335
                /// </summary>
336
                /// <remarks>
337
                /// <para>
338
                /// This setting can be overridden by the <see cref="MultiLeader.LeaderLineType"/> property
339
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LeaderLineType"/> flag is set in the
340
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
341
                /// </para><para>
342
                /// The setting for all leader lines can be overridden for each individual leader line by the
343
                /// <see cref="MultiLeaderObjectContextData.LeaderLine.LineType"/> property when the
344
                /// <see cref="LeaderLinePropertOverrideFlags.LineType"/> flag is set in the
345
                /// <see cref="MultiLeaderObjectContextData.LeaderLine.OverrideFlags"/> property.
346
                /// </para>
347
                /// </remarks>
348
                [DxfCodeValue(DxfReferenceType.Handle, 340)]
349
                public LineType LeaderLineType
350
                {
UNCOV
351
                        get { return this._leaderLineType; }
×
352
                        set
UNCOV
353
                        {
×
UNCOV
354
                                if (value == null)
×
355
                                {
×
356
                                        throw new ArgumentNullException(nameof(value));
×
357
                                }
358

UNCOV
359
                                if (this.Document != null)
×
UNCOV
360
                                {
×
UNCOV
361
                                        this._leaderLineType = CadObject.updateCollection(value, this.Document.LineTypes);
×
UNCOV
362
                                }
×
363
                                else
UNCOV
364
                                {
×
UNCOV
365
                                        this._leaderLineType = value;
×
UNCOV
366
                                }
×
UNCOV
367
                        }
×
368
                }
369

370
                /// <summary>
371
                /// Gets or sets a value specifying the lineweight to be applied to all leader lines of the multileader.
372
                /// </summary>
373
                /// <remarks>
374
                /// <para>
375
                /// This value can be overridden by the <see cref="MultiLeader.LeaderLineWeight"/> property when the
376
                /// <see cref="MultiLeaderPropertyOverrideFlags.LeaderLineWeight"/> flag is set in the
377
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
378
                /// </para><para>
379
                /// The value for all leader lines can be overridden for each individual leader line by the
380
                /// <see cref="MultiLeaderObjectContextData.LeaderLine.LineWeight"/> property when the
381
                /// <see cref="LeaderLinePropertOverrideFlags.LineWeight"/> flag is set in the
382
                /// <see cref="MultiLeaderObjectContextData.LeaderLine.OverrideFlags"/> property.
383
                /// </para>
384
                /// </remarks>
385
                [DxfCodeValue(92)]
UNCOV
386
                public LineWeightType LeaderLineWeight { get; set; } = LineWeightType.ByBlock;
×
387

388
                /// <summary>
389
                /// Gets or sets color to be applied all leader lines of the multileader.
390
                /// </summary>
391
                /// <remarks>
392
                /// <para>
393
                /// This value can be overridden by the <see cref="MultiLeader.LineColor"/> property when the
394
                /// <see cref="MultiLeaderPropertyOverrideFlags.LineColor"/> flag is set in the
395
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
396
                /// </para><para>
397
                /// The value for all leader lines can be overridden for each individual leader line by the
398
                /// <see cref="MultiLeaderObjectContextData.LeaderLine.LineColor"/> property when the
399
                /// <see cref="LeaderLinePropertOverrideFlags.LineColor"/> flag is set in the
400
                /// <see cref="MultiLeaderObjectContextData.LeaderLine.OverrideFlags"/> property.
401
                /// </para>
402
                /// </remarks>
403
                [DxfCodeValue(91)]
UNCOV
404
                public Color LineColor { get; set; }
×
405

406
                /// <summary>
407
                /// Gets or sets the max number of segments when a new leader is being created for a multileader.
408
                /// </summary>
409
                /// <remarks>
410
                /// This property supports creating and editing a multileader but has no meaning for
411
                /// the display of multileaders.
412
                /// </remarks>
413
                [DxfCodeValue(90)]
UNCOV
414
                public int MaxLeaderSegmentsPoints { get; set; } = 2;
×
415

416
                //        TODO What is the meaning of this property? Is it relevant for drawing a multileader?
417
                /// <summary>
418
                /// DrawMLeaderOrder Type
419
                /// </summary>
420
                [DxfCodeValue(171)]
UNCOV
421
                public MultiLeaderDrawOrderType MultiLeaderDrawOrder { get; set; }
×
422

423
                /// <inheritdoc/>
UNCOV
424
                public override string ObjectName => DxfFileToken.ObjectMLeaderStyle;
×
425

426
                /// <inheritdoc/>
UNCOV
427
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
428

429
                /// <summary>
430
                /// Overwrite Property Value
431
                /// </summary>
432
                /// <remarks>
433
                /// Property changed, meaning not totally clear
434
                /// might be set to true if something changed after loading,
435
                /// or might be used to trigger updates in dependent MLeaders.
436
                /// sequence seems to be different in DXF
437
                /// </remarks>
438
                [DxfCodeValue(295)]
UNCOV
439
                public bool OverwritePropertyValue { get; set; }
×
440

441
                /// <summary>
442
                /// Gets or sets a value indicating whether leaders are to be displayed as polyline,
443
                /// a spline curve or invisible. This setting applies for all leader lines of the
444
                /// multileader.
445
                /// </summary>
446
                /// <remarks>
447
                /// <para>
448
                /// This value can be overridden by the <see cref="MultiLeader.PathType"/> property when the
449
                /// <see cref="MultiLeaderPropertyOverrideFlags.PathType"/> flag is set in the
450
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
451
                /// </para><para>
452
                /// The value for all leader lines can be overridden for each individual leader line by the
453
                /// <see cref="MultiLeaderObjectContextData.LeaderLine.PathType"/> property when the
454
                /// <see cref="LeaderLinePropertOverrideFlags.PathType"/> flag is set in the
455
                /// <see cref="MultiLeaderObjectContextData.LeaderLine.OverrideFlags"/> property.
456
                /// </para>
457
                /// </remarks>
458
                [DxfCodeValue(173)]
UNCOV
459
                public MultiLeaderPathType PathType { get; set; }
×
460

461
                /// <summary>
462
                /// Gets or sets the scale factor for the <see cref="ArrowheadSize"/>, <see cref="LandingDistance"/>,
463
                /// <see cref="LandingGap"/>, <see cref="TextHeight"/>, and the elements of <see cref="BlockContentScale"/>.
464
                /// </summary>
465
                /// <remarks>
466
                /// <para>
467
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.ScaleFactor"/> property
468
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.ScaleFactor"/> flag is set in the
469
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
470
                /// </para>
471
                /// </remarks>
472
                [DxfCodeValue(142)]
UNCOV
473
                public double ScaleFactor { get; set; } = 1;
×
474

475
                /// <summary>
476
                /// Gets or sets a snap angle value for the second leader segment when a leader line
477
                /// is being created for the mutileader.
478
                /// </summary>
479
                /// <remarks>
480
                /// This property supports creating and editing a multileader but has no meaning for
481
                /// the display of multileaders.
482
                /// </remarks>
483
                /// <value>
484
                /// An angle value in radians or zero if no angle contstraint is set.
485
                /// </value>
486
                [DxfCodeValue(41)]
UNCOV
487
                public double SecondSegmentAngleConstraint { get; set; }
×
488

489
                /// <inheritdoc/>
UNCOV
490
                public override string SubclassMarker => DxfSubclassMarker.MLeaderStyle;
×
491

492
                //        TODO Is this property only relevant for new leaders?
493
                /// <summary>
494
                /// Text Align Always Left
495
                /// </summary>
496
                [DxfCodeValue(297)]
UNCOV
497
                public bool TextAlignAlwaysLeft { get; set; }
×
498

499
                /// <summary>
500
                /// Gets or sets the text alignment, i.e. the alignment of text lines if the a multiline
501
                /// text label, relative to the <see cref="MultiLeaderObjectContextData.TextLocation"/>.
502
                /// </summary>
503
                /// <remarks>
504
                /// <para>
505
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.TextAlignment"/> property
506
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextAlignment"/> flag is set in the
507
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
508
                /// </para>
509
                /// </remarks>
510
                [DxfCodeValue(176)]
UNCOV
511
                public TextAlignmentType TextAlignment { get; set; }
×
512

513
                //        TODO How to set this value?
514
                /// <summary>
515
                /// Gets or sets a value indicating the text angle.
516
                /// </summary>
517
                /// <remarks>
518
                /// <para>
519
                /// This value can be overridden by the <see cref="MultiLeader.TextAngle"/> property
520
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextAngle"/> flag is set in the
521
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
522
                /// </para>
523
                /// </remarks>
524
                [DxfCodeValue(175)]
UNCOV
525
                public TextAngleType TextAngle { get; set; } = TextAngleType.Horizontal;
×
526

527
                //        TODO Check
528
                //                 whether this property is relevant for both text an block content
529
                //                 How it can be overridden by LeaderRoot.AttachmentDirection
530
                /// <summary>
531
                /// Gets or sets the Text attachment direction for text or block contents, rename?
532
                /// This property defines whether the leaders attach to the left/right of the content block/text,
533
                /// or attach to the top/bottom.
534
                /// </summary>
535
                /// <remarks>
536
                /// <para>
537
                /// This value can be overridden by the <see cref="MultiLeader.TextAttachmentDirection"/> property
538
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextAttachmentDirection"/> flag is set in the
539
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
540
                /// </para><para>
541
                /// The value for all leader lines can be overridden for each individual leader line by the
542
                /// <see cref="MultiLeaderObjectContextData.LeaderRoot.TextAttachmentDirection"/> property when the
543
                /// <see cref="LeaderLinePropertOverrideFlags.TextAttachmentDirection"/> flag is set in the
544
                /// <see cref="MultiLeaderObjectContextData.LeaderLine.OverrideFlags"/> property.
545
                /// </para>
546
                /// </remarks>
547
                /// <value>
548
                /// A <see cref="TextAttachmentDirectionType"/>.
549
                /// </value>
550
                [DxfCodeValue(271)]
UNCOV
551
                public TextAttachmentDirectionType TextAttachmentDirection { get; set; }
×
552

553
                /// <summary>
554
                /// Gets or sets the text bottom attachment type.
555
                /// This value controls the position of the connection point of the leader
556
                /// attached to the bottom of the text label.
557
                /// </summary>
558
                /// <remarks>
559
                /// <para>
560
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.TextBottomAttachment"/> property
561
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextBottomAttachment"/> flag is set in the
562
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
563
                /// </para><para>
564
                /// This property is only relevant if <see cref="TextAttachmentDirection"/> is
565
                /// <see cref="TextAttachmentDirectionType.Vertical"/> and a leader attached
566
                /// to the bottom of the text label exists.
567
                /// </para>
568
                /// </remarks>
569
                /// <value>
570
                /// A <see cref="TextAttachmentType"/> having the values
571
                ///         9 = Center,
572
                ///         10 = Underline and Center
573
                /// can be used ("vertical" attachment types).
574
                /// </value>
575
                [DxfCodeValue(272)]
UNCOV
576
                public TextAttachmentType TextBottomAttachment { get; set; }
×
577

578
                /// <summary>
579
                /// Gest or sets the color for the text label of the multileader.
580
                /// </summary>
581
                /// <remarks>
582
                /// <para>
583
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.TextColor"/> property
584
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextColor"/> flag is set in the
585
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
586
                /// </para>
587
                /// </remarks>
588
                [DxfCodeValue(93)]
UNCOV
589
                public Color TextColor { get; set; } = Color.ByBlock;
×
590

591
                /// <summary>
592
                /// Gets or sets a value indicating that the text label is to be drawn with a frame.
593
                /// </summary>
594
                /// <remarks>
595
                /// <para>
596
                /// This value can be overridden by the <see cref="MultiLeader.TextFrame"/> property
597
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextFrame"/> flag is set in the
598
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
599
                /// </para>
600
                /// </remarks>
601
                [DxfCodeValue(292)]
UNCOV
602
                public bool TextFrame { get; set; }
×
603

604
                /// <summary>
605
                /// Gets or sets the text height for the text label of the multileader.
606
                /// </summary>
607
                /// <remarks>
608
                /// <para>
609
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.TextHeight"/> property
610
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextHeight"/> flag is set in the
611
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
612
                /// </para>
613
                /// </remarks>
614
                [DxfCodeValue(45)]
UNCOV
615
                public double TextHeight { get; set; } = 0.18;
×
616

617
                /// <summary>
618
                /// Gets or sets the Text Left Attachment Type.
619
                /// This value controls the position of the connection point of the leader
620
                /// attached to the left side of the text label.
621
                /// </summary>
622
                /// <remarks>
623
                /// <para>
624
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.TextLeftAttachment"/> property
625
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextLeftAttachment"/> flag is set in the
626
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
627
                /// </para><para>
628
                /// This property is only relevant if <see cref="TextAttachmentDirection"/> is
629
                /// <see cref="TextAttachmentDirectionType.Horizontal"/> and a leader attached
630
                /// to the left side of the text label exists.
631
                /// </para>
632
                /// </remarks>
633
                /// <value>
634
                /// A <see cref="TextAttachmentType"/> having the values 0-8
635
                /// can be used ("horizontal" attachment types).
636
                /// </value>
637
                [DxfCodeValue(174)]
UNCOV
638
                public TextAttachmentType TextLeftAttachment { get; set; }
×
639

640
                /// <summary>
641
                /// Gets or sets the Text Right Attachment Type.
642
                /// This value controls the position of the connection point of the leader
643
                /// attached to the right side of the text label.
644
                /// </summary>
645
                /// <remarks>
646
                /// <para>
647
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.TextRightAttachment"/> property
648
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextRightAttachment"/> flag is set in the
649
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
650
                /// </para><para>
651
                /// This property is only relevant if <see cref="TextAttachmentDirection"/> is
652
                /// <see cref="TextAttachmentDirectionType.Horizontal"/> and a leader attached
653
                /// to the right side of the text label exists.
654
                /// </para>
655
                /// </remarks>
656
                /// <value>
657
                /// A <see cref="TextAttachmentType"/> having the values 0-8
658
                /// can be used ("horizontal" attachment types).
659
                /// </value>
660
                [DxfCodeValue(178)]
UNCOV
661
                public TextAttachmentType TextRightAttachment { get; set; }
×
662

663
                /// <summary>
664
                /// Gets or sets the <see cref="TextStyle"/> to be used to display the text label of the
665
                /// multileader.
666
                /// </summary>
667
                /// <remarks>
668
                /// <para>
669
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.TextStyle"/> property
670
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextStyle"/> flag is set in the
671
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
672
                /// </para>
673
                /// </remarks>
674
                [DxfCodeValue(DxfReferenceType.Handle, 342)]
675
                public TextStyle TextStyle
676
                {
UNCOV
677
                        get { return this._textStyle; }
×
678
                        set
UNCOV
679
                        {
×
UNCOV
680
                                if (value == null)
×
681
                                {
×
682
                                        throw new ArgumentNullException(nameof(value));
×
683
                                }
684

UNCOV
685
                                if (this.Document != null)
×
UNCOV
686
                                {
×
UNCOV
687
                                        this._textStyle = CadObject.updateCollection(value, this.Document.TextStyles);
×
UNCOV
688
                                }
×
689
                                else
UNCOV
690
                                {
×
UNCOV
691
                                        this._textStyle = value;
×
UNCOV
692
                                }
×
UNCOV
693
                        }
×
694
                }
695

696
                /// <summary>
697
                /// Gets or sets the text top attachment type.
698
                /// This value controls the position of the connection point of the leader
699
                /// attached to the top of the text label.
700
                /// </summary>
701
                /// <remarks>
702
                /// <para>
703
                /// This value can be overridden by the <see cref="MultiLeaderObjectContextData.TextTopAttachment"/> property
704
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextTopAttachment"/> flag is set in the
705
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
706
                /// </para><para>
707
                /// This property is only relevant if <see cref="TextAttachmentDirection"/> is
708
                /// <see cref="TextAttachmentDirectionType.Vertical"/> and a leader attached
709
                /// to the top of the text label exists.
710
                /// </para>
711
                /// </remarks>
712
                /// <value>
713
                /// A <see cref="TextAttachmentType"/> having the values
714
                ///         9 = Center,
715
                ///         10 = Underline and Center
716
                /// can be used ("vertical" attachment types).
717
                /// </value>
718
                [DxfCodeValue(273)]
UNCOV
719
                public TextAttachmentType TextTopAttachment { get; set; }
×
720

721
                /// <summary>
722
                /// Undocumented in ODS and DXF-ref boolean, found in DXF.
723
                /// </summary>
724
                [DxfCodeValue(298)]
UNCOV
725
                public bool UnknownFlag298 { get; set; }
×
726

727
                /// <summary>
728
                /// Default multiline style name.
729
                /// </summary>
730
                public const string DefaultName = "Standard";
731

732
                private BlockRecord _arrowhead;
733

734
                private BlockRecord _blockContent;
735

UNCOV
736
                private XYZ _blockContentScale = new XYZ(1);
×
737

UNCOV
738
                private LineType _leaderLineType = LineType.ByLayer;
×
739

UNCOV
740
                private TextStyle _textStyle = TextStyle.Default;
×
741

742
                /// <summary>
743
                /// Initializes a new instance of the <see cref="MultiLeaderStyle"/> class.
744
                /// </summary>
UNCOV
745
                public MultiLeaderStyle() : this(string.Empty) { }
×
746

747
                /// <summary>
748
                /// Initializes a new instance of the <see cref="MultiLeaderStyle"/> class
749
                /// and sets the name of this style.
750
                /// </summary>
UNCOV
751
                public MultiLeaderStyle(string name) : base(name)
×
UNCOV
752
                {
×
UNCOV
753
                }
×
754

755
                /// <inheritdoc/>
756
                public override CadObject Clone()
UNCOV
757
                {
×
UNCOV
758
                        MultiLeaderStyle clone = (MultiLeaderStyle)base.Clone();
×
UNCOV
759
                        clone.TextStyle = (TextStyle)this._textStyle.Clone();
×
UNCOV
760
                        clone.LeaderLineType = (LineType)this._leaderLineType.Clone();
×
761

UNCOV
762
                        clone.Arrowhead = (BlockRecord)this._arrowhead?.Clone();
×
UNCOV
763
                        clone.BlockContent = (BlockRecord)this._blockContent?.Clone();
×
764

UNCOV
765
                        return clone;
×
UNCOV
766
                }
×
767

768
                internal override void AssignDocument(CadDocument doc)
UNCOV
769
                {
×
UNCOV
770
                        base.AssignDocument(doc);
×
771

UNCOV
772
                        this._textStyle = CadObject.updateCollection(this._textStyle, doc.TextStyles);
×
UNCOV
773
                        this._leaderLineType = CadObject.updateCollection(this._leaderLineType, doc.LineTypes);
×
UNCOV
774
                        this._arrowhead = CadObject.updateCollection(this._arrowhead, doc.BlockRecords);
×
UNCOV
775
                        this._blockContent = CadObject.updateCollection(this._blockContent, doc.BlockRecords);
×
776

UNCOV
777
                        doc.TextStyles.OnRemove += this.tableOnRemove;
×
UNCOV
778
                        doc.LineTypes.OnRemove += this.tableOnRemove;
×
UNCOV
779
                        doc.BlockRecords.OnRemove += this.tableOnRemove;
×
UNCOV
780
                }
×
781

782
                internal override void UnassignDocument()
783
                {
×
784
                        this.Document.TextStyles.OnRemove -= this.tableOnRemove;
×
785
                        this.Document.LineTypes.OnRemove -= this.tableOnRemove;
×
786
                        this.Document.BlockRecords.OnRemove -= this.tableOnRemove;
×
787

788
                        base.UnassignDocument();
×
789

790
                        this._textStyle = (TextStyle)this._textStyle.Clone();
×
791
                        this._leaderLineType = (LineType)this._leaderLineType.Clone();
×
792
                        this._arrowhead = (BlockRecord)this._arrowhead?.Clone();
×
793
                        this._blockContent = (BlockRecord)this._blockContent?.Clone();
×
794
                }
×
795

796
                protected virtual void tableOnRemove(object sender, CollectionChangedEventArgs e)
UNCOV
797
                {
×
UNCOV
798
                        if (e.Item.Equals(this._textStyle))
×
799
                        {
×
800
                                this._textStyle = this.Document.TextStyles[Layer.DefaultName];
×
801
                        }
×
802

UNCOV
803
                        if (e.Item.Equals(this._leaderLineType))
×
804
                        {
×
805
                                this._leaderLineType = this.Document.LineTypes[LineType.ByLayerName];
×
806
                        }
×
807

UNCOV
808
                        if (e.Item.Equals(this.Arrowhead))
×
809
                        {
×
810
                                this._arrowhead = null;
×
811
                        }
×
812

UNCOV
813
                        if (e.Item.Equals(this.BlockContent))
×
814
                        {
×
815
                                this._blockContent = null;
×
816
                        }
×
UNCOV
817
                }
×
818
        }
819
}
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