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

DomCR / ACadSharp / 17737836230

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

push

github

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

addflag refactor

141 of 9225 branches covered (1.53%)

Branch coverage included in aggregate %.

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

24910 existing lines in 372 files now uncovered.

724 of 32119 relevant lines covered (2.25%)

5.76 hits per line

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

0.0
/src/ACadSharp/Objects/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
        {
UNCOV
20
                private LineType _leaderLineType = LineType.ByLayer;
×
UNCOV
21
                private TextStyle _textStyle = TextStyle.Default;
×
22
                private BlockRecord _arrowhead;
23
                private BlockRecord _blockContent;
24

25

26
                /// <summary>
27
                /// Default multiline style name
28
                /// </summary>
29
                public const string DefaultName = "Standard";
30

31
                /// <summary>
32
                /// Gets the default MultiLeaderStyle
33
                /// </summary>
UNCOV
34
                public static MultiLeaderStyle Default { get { return new MultiLeaderStyle(DefaultName); } }
×
35

36
                /// <inheritdoc/>
UNCOV
37
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
38

39
                /// <inheritdoc/>
UNCOV
40
                public override string ObjectName => DxfFileToken.ObjectMLeaderStyle;
×
41

42
                /// <inheritdoc/>
43
                public override string SubclassMarker => DxfSubclassMarker.MLeaderStyle;
×
44

45
                /// <summary>
46
                /// Gets or sets a value indicating the content type for the multileader.
47
                /// </summary>
48
                /// <remarks>
49
                /// <para>
50
                /// This value can be overridden by the <see cref="MultiLeader.ContentType"/> property when the
51
                /// <see cref="MultiLeaderPropertyOverrideFlags.ContentType"/> flag is set in the
52
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
53
                /// </para>
54
                /// </remarks>
55
                [DxfCodeValue(170)]
UNCOV
56
                public LeaderContentType ContentType { get; set; }
×
57

58
                //        TODO What is the meaning of this property? Is it relevant for drawing a multileader?
59
                /// <summary>
60
                /// DrawMLeaderOrder Type
61
                /// </summary>
62
                [DxfCodeValue(171)]
UNCOV
63
                public MultiLeaderDrawOrderType MultiLeaderDrawOrder { get; set; }
×
64

65
                //        TODO What is the meaning of this property? Is it relevant for drawing a multileader?
66
                /// <summary>
67
                /// DrawLeaderOrder Type
68
                /// </summary>
69
                [DxfCodeValue(172)]
UNCOV
70
                public LeaderDrawOrderType LeaderDrawOrder { get; set; }
×
71

72
                /// <summary>
73
                /// Gets or sets the max number of segments when a new leader is being created for a multileader.
74
                /// </summary>
75
                /// <remarks>
76
                /// This property supports creating and editing a multileader but has no meaning for
77
                /// the display of multileaders.
78
                /// </remarks>
79
                [DxfCodeValue(90)]
UNCOV
80
                public int MaxLeaderSegmentsPoints { get; set; }
×
81

82
                /// <summary>
83
                /// Gets or sets a snap angle value for the first leader segment when a leader line
84
                /// is being created for the mutileader.
85
                /// </summary>
86
                /// <remarks>
87
                /// This property supports creating and editing a multileader but has no meaning for
88
                /// the display of multileaders.
89
                /// </remarks>
90
                /// <value>
91
                /// An angle value in radians or zero if no angle contstraint is set.
92
                /// </value>
93
                [DxfCodeValue(40)]
UNCOV
94
                public double FirstSegmentAngleConstraint { get; set; }
×
95

96
                /// <summary>
97
                /// Gets or sets a snap angle value for the second leader segment when a leader line
98
                /// is being created for the mutileader.
99
                /// </summary>
100
                /// <remarks>
101
                /// This property supports creating and editing a multileader but has no meaning for
102
                /// the display of multileaders.
103
                /// </remarks>
104
                /// <value>
105
                /// An angle value in radians or zero if no angle contstraint is set.
106
                /// </value>
107
                [DxfCodeValue(41)]
UNCOV
108
                public double SecondSegmentAngleConstraint { get; set; }
×
109

110
                /// <summary>
111
                /// Gets or sets a value indicating whether leaders are to be displayed as polyline,
112
                /// a spline curve or invisible. This setting applies for all leader lines of the
113
                /// multileader.
114
                /// </summary>
115
                /// <remarks>
116
                /// <para>
117
                /// This value can be overridden by the <see cref="MultiLeader.PathType"/> property when the
118
                /// <see cref="MultiLeaderPropertyOverrideFlags.PathType"/> flag is set in the
119
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
120
                /// </para><para>
121
                /// The value for all leader lines can be overridden for each individual leader line by the
122
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.PathType"/> property when the
123
                /// <see cref="LeaderLinePropertOverrideFlags.PathType"/> flag is set in the 
124
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
125
                /// </para>
126
                /// </remarks>
127
                [DxfCodeValue(173)]
UNCOV
128
                public MultiLeaderPathType PathType { get; set; }
×
129

130
                /// <summary>
131
                /// Gets or sets color to be applied all leader lines of the multileader.
132
                /// </summary>
133
                /// <remarks>
134
                /// <para>
135
                /// This value can be overridden by the <see cref="MultiLeader.LineColor"/> property when the
136
                /// <see cref="MultiLeaderPropertyOverrideFlags.LineColor"/> flag is set in the
137
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
138
                /// </para><para>
139
                /// The value for all leader lines can be overridden for each individual leader line by the
140
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.LineColor"/> property when the
141
                /// <see cref="LeaderLinePropertOverrideFlags.LineColor"/> flag is set in the 
142
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
143
                /// </para>
144
                /// </remarks>
145
                [DxfCodeValue(91)]
UNCOV
146
                public Color LineColor { get; set; }
×
147

148
                /// <summary>
149
                /// Gets or sets a <see cref="LineType"/> object specifying line-type properties for the
150
                /// musltileader. This setting applies for all leader lines of the multileader.
151
                /// </summary>
152
                /// <remarks>
153
                /// <para>
154
                /// This setting can be overridden by the <see cref="MultiLeader.LeaderLineType"/> property
155
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LeaderLineType"/> flag is set in the
156
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
157
                /// </para><para>
158
                /// The setting for all leader lines can be overridden for each individual leader line by the
159
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.LineType"/> property when the
160
                /// <see cref="LeaderLinePropertOverrideFlags.LineType"/> flag is set in the 
161
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
162
                /// </para>
163
                /// </remarks>
164
                [DxfCodeValue(DxfReferenceType.Handle, 340)]
165
                public LineType LeaderLineType
166
                {
UNCOV
167
                        get { return this._leaderLineType; }
×
168
                        set
UNCOV
169
                        {
×
UNCOV
170
                                if (value == null)
×
171
                                {
×
172
                                        throw new ArgumentNullException(nameof(value));
×
173
                                }
174

UNCOV
175
                                if (this.Document != null)
×
UNCOV
176
                                {
×
UNCOV
177
                                        this._leaderLineType = CadObject.updateCollection(value, this.Document.LineTypes);
×
UNCOV
178
                                }
×
179
                                else
UNCOV
180
                                {
×
UNCOV
181
                                        this._leaderLineType = value;
×
UNCOV
182
                                }
×
UNCOV
183
                        }
×
184
                }
185

186
                /// <summary>
187
                /// Gets or sets a value specifying the lineweight to be applied to all leader lines of the multileader.
188
                /// </summary>
189
                /// <remarks>
190
                /// <para>
191
                /// This value can be overridden by the <see cref="MultiLeader.LeaderLineWeight"/> property when the
192
                /// <see cref="MultiLeaderPropertyOverrideFlags.LeaderLineWeight"/> flag is set in the
193
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
194
                /// </para><para>
195
                /// The value for all leader lines can be overridden for each individual leader line by the
196
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.LineWeight"/> property when the
197
                /// <see cref="LeaderLinePropertOverrideFlags.LineWeight"/> flag is set in the 
198
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
199
                /// </para>
200
                /// </remarks>
201
                [DxfCodeValue(92)]
UNCOV
202
                public LineWeightType LeaderLineWeight { get; set; }
×
203

204
                //        TODO It seems that this value indicates that for a new leader that is being created
205
                //                 with this <see cref="MultiLeaderStyle" /> landing i.e. a dogleg is enabled.
206
                //                 But why can this value be overridden?
207
                //
208
                /// <summary>
209
                /// Gets or sets a value indicating whether landing is enabled.
210
                /// </summary>
211
                /// <remarks>
212
                /// <para>
213
                /// This value can be overridden by the <see cref="MultiLeader.EnableLanding"/> property
214
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.EnableLanding"/> flag is set in the
215
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
216
                /// </para>
217
                /// </remarks>
218
                [DxfCodeValue(290)]
UNCOV
219
                public bool EnableLanding { get; set; }
×
220

221
                /// <summary>
222
                /// Gets or sets the landing gap. This is the distance between the leader end point or, if present,
223
                /// the end of the dogleg and the text label or the content block.
224
                /// </summary>
225
                /// <remarks>
226
                /// <para>
227
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.LandingGap"/> property
228
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LandingGap"/> flag is set in the
229
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
230
                /// </para>
231
                /// </remarks>
232
                [DxfCodeValue(42)]
UNCOV
233
                public double LandingGap { get; set; }
×
234

235
                /// <summary>
236
                /// Gets or sets a value indicating that leader lines are to be drawn with a dogleg.
237
                /// </summary>
238
                /// <remarks>
239
                /// <para>
240
                /// This value can be overridden by the <see cref="MultiLeader.EnableDogleg"/> property
241
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.EnableDogleg"/> flag is set in the
242
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
243
                /// </para><para>
244
                /// Note that this setting has no effect when the <see cref="TextAttachmentDirection"/>
245
                /// is <see cref="TextAttachmentDirectionType.Vertical"/>.
246
                /// </para>
247
                /// </remarks>
248
                [DxfCodeValue(291)]
UNCOV
249
                public bool EnableDogleg { get; set; }
×
250

251
                /// <summary>
252
                /// Gets or sets the landing distance, i.e. the length of the dogleg. 
253
                /// </summary>
254
                /// <remarks>
255
                /// <para>
256
                /// This value can be overridden by the <see cref="MultiLeader.LandingDistance"/> property
257
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LandingDistance"/> flag is set in the
258
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
259
                /// </para>
260
                /// </remarks>
261
                [DxfCodeValue(43)]
UNCOV
262
                public double LandingDistance { get; set; }
×
263

264
                /// <summary>
265
                /// Gets or sets a text containing the description of this <see cref="MultiLeaderStyle"/>.
266
                /// </summary>
267
                [DxfCodeValue(3)]
UNCOV
268
                public string Description { get; set; }
×
269

270
                /// <summary>
271
                /// Gets or sets a <see cref="BlockRecord"/> representing the arrowhead
272
                /// to be displayed with every leader line.
273
                /// </summary>
274
                /// <remarks>
275
                /// <para>
276
                /// This value can be overridden by the <see cref="MultiLeader.Arrowhead"/> property
277
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.Arrowhead"/> flag is set in the
278
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
279
                /// </para><para>
280
                /// The value for all leader lines can be overridden for each individual leader line by the
281
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.Arrowhead"/> property when the
282
                /// <see cref="LeaderLinePropertOverrideFlags.Arrowhead"/> flag is set in the 
283
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
284
                /// </para>
285
                /// </remarks>
286
                [DxfCodeValue(DxfReferenceType.Handle, 341)]
287
                public BlockRecord Arrowhead
288
                {
UNCOV
289
                        get { return this._arrowhead; }
×
290
                        set
UNCOV
291
                        {
×
UNCOV
292
                                this._arrowhead = CadObject.updateCollection(value, this.Document?.BlockRecords);
×
UNCOV
293
                        }
×
294
                }
295

296
                /// <summary>
297
                /// Gests or sets the arrowhead size.
298
                /// </summary>
299
                /// <remarks>
300
                /// <para>
301
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.ArrowheadSize"/> property
302
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.ArrowheadSize"/> flag is set in the
303
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
304
                /// </para><para>
305
                /// The value for all leader lines can be overridden for each individual leader line by the
306
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.ArrowheadSize"/> property when the
307
                /// <see cref="LeaderLinePropertOverrideFlags.ArrowheadSize"/> flag is set in the 
308
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
309
                /// </para>
310
                /// </remarks>
311
                [DxfCodeValue(44)]
UNCOV
312
                public double ArrowheadSize { get; set; }
×
313

314
                /// <summary>
315
                /// Gests or sets a default text that is to be set when a mutileader is being created
316
                /// with this <see cref="MultiLeaderStyle"/>.
317
                /// </summary>
318
                [DxfCodeValue(300)]
UNCOV
319
                public string DefaultTextContents { get; set; }
×
320

321
                /// <summary>
322
                /// Gets or sets the <see cref="TextStyle"/> to be used to display the text label of the
323
                /// multileader.
324
                /// </summary>
325
                /// <remarks>
326
                /// <para>
327
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.TextStyle"/> property
328
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextStyle"/> flag is set in the
329
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
330
                /// </para>
331
                /// </remarks>
332
                [DxfCodeValue(DxfReferenceType.Handle, 342)]
333
                public TextStyle TextStyle
334
                {
UNCOV
335
                        get { return this._textStyle; }
×
336
                        set
UNCOV
337
                        {
×
UNCOV
338
                                if (value == null)
×
339
                                {
×
340
                                        throw new ArgumentNullException(nameof(value));
×
341
                                }
342

UNCOV
343
                                if (this.Document != null)
×
UNCOV
344
                                {
×
UNCOV
345
                                        this._textStyle = CadObject.updateCollection(value, this.Document.TextStyles);
×
UNCOV
346
                                }
×
347
                                else
UNCOV
348
                                {
×
UNCOV
349
                                        this._textStyle = value;
×
UNCOV
350
                                }
×
UNCOV
351
                        }
×
352
                }
353

354
                /// <summary>
355
                /// Gets or sets the Text Left Attachment Type.
356
                /// This value controls the position of the connection point of the leader
357
                /// attached to the left side of the text label.
358
                /// </summary>
359
                /// <remarks>
360
                /// <para>
361
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.TextLeftAttachment"/> property
362
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextLeftAttachment"/> flag is set in the
363
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
364
                /// </para><para>
365
                /// This property is only relevant if <see cref="TextAttachmentDirection"/> is
366
                /// <see cref="TextAttachmentDirectionType.Horizontal"/> and a leader attached
367
                /// to the left side of the text label exists.
368
                /// </para>
369
                /// </remarks>
370
                /// <value>
371
                /// A <see cref="TextAttachmentType"/> having the values 0-8 
372
                /// can be used ("horizontal" attachment types).
373
                /// </value>
374
                [DxfCodeValue(174)]
UNCOV
375
                public TextAttachmentType TextLeftAttachment { get; set; }
×
376

377
                //        TODO How to set this value?
378
                /// <summary>
379
                /// Gets or sets a value indicating the text angle.
380
                /// </summary>
381
                /// <remarks>
382
                /// <para>
383
                /// This value can be overridden by the <see cref="MultiLeader.TextAngle"/> property
384
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextAngle"/> flag is set in the
385
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
386
                /// </para>
387
                /// </remarks>
388
                [DxfCodeValue(175)]
UNCOV
389
                public TextAngleType TextAngle { get; set; }
×
390

391
                /// <summary>
392
                /// Gets or sets the text alignment, i.e. the alignment of text lines if the a multiline
393
                /// text label, relative to the <see cref="MultiLeaderAnnotContext.TextLocation"/>.
394
                /// </summary>
395
                /// <remarks>
396
                /// <para>
397
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.TextAlignment"/> property
398
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextAlignment"/> flag is set in the
399
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
400
                /// </para>
401
                /// </remarks>
402
                [DxfCodeValue(176)]
UNCOV
403
                public TextAlignmentType TextAlignment { get; set; }
×
404

405
                /// <summary>
406
                /// Gets or sets the Text Right Attachment Type.
407
                /// This value controls the position of the connection point of the leader
408
                /// attached to the right side of the text label.
409
                /// </summary>
410
                /// <remarks>
411
                /// <para>
412
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.TextRightAttachment"/> property
413
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextRightAttachment"/> flag is set in the
414
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
415
                /// </para><para>
416
                /// This property is only relevant if <see cref="TextAttachmentDirection"/> is
417
                /// <see cref="TextAttachmentDirectionType.Horizontal"/> and a leader attached
418
                /// to the right side of the text label exists.
419
                /// </para>
420
                /// </remarks>
421
                /// <value>
422
                /// A <see cref="TextAttachmentType"/> having the values 0-8 
423
                /// can be used ("horizontal" attachment types).
424
                /// </value>
425
                [DxfCodeValue(178)]
UNCOV
426
                public TextAttachmentType TextRightAttachment { get; set; }
×
427

428
                /// <summary>
429
                /// Gest or sets the color for the text label of the multileader.
430
                /// </summary>
431
                /// <remarks>
432
                /// <para>
433
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.TextColor"/> property
434
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextColor"/> flag is set in the
435
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
436
                /// </para>
437
                /// </remarks>
438
                [DxfCodeValue(93)]
UNCOV
439
                public Color TextColor { get; set; }
×
440

441
                /// <summary>
442
                /// Gest or sets the text height for the text label of the multileader.
443
                /// </summary>
444
                /// <remarks>
445
                /// <para>
446
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.TextHeight"/> property
447
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextHeight"/> flag is set in the
448
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
449
                /// </para>
450
                /// </remarks>
451
                [DxfCodeValue(45)]
UNCOV
452
                public double TextHeight { get; set; }
×
453

454
                /// <summary>
455
                /// Gets or sets a value indicating that the text label is to be drawn with a frame.
456
                /// </summary>
457
                /// <remarks>
458
                /// <para>
459
                /// This value can be overridden by the <see cref="MultiLeader.TextFrame"/> property
460
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextFrame"/> flag is set in the
461
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
462
                /// </para>
463
                /// </remarks>
464
                [DxfCodeValue(292)]
UNCOV
465
                public bool TextFrame { get; set; }
×
466

467
                //        TODO Is this property only relevant for new leaders?
468
                /// <summary>
469
                /// Text Align Always Left
470
                /// </summary>
471
                [DxfCodeValue(297)]
UNCOV
472
                public bool TextAlignAlwaysLeft { get; set; }
×
473

474
                //        TODO What is the meaning of this property?
475
                /// <summary>
476
                /// Align Space
477
                /// </summary>
478
                [DxfCodeValue(46)]
UNCOV
479
                public double AlignSpace { get; set; }
×
480

481
                /// <summary>
482
                /// Gets a <see cref="BlockRecord"/> containing elements
483
                /// to be drawn as content for the multileader.
484
                /// </summary>
485
                /// <remarks>
486
                /// <para>
487
                /// Thw standard content block can be overridden by the <see cref="MultiLeaderAnnotContext.BlockContent"/>
488
                /// property when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContent"/> flag is set in the
489
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
490
                /// </para>
491
                /// </remarks>
492
                [DxfCodeValue(DxfReferenceType.Handle, 343)]
493
                public BlockRecord BlockContent
494
                {
UNCOV
495
                        get { return this._blockContent; }
×
UNCOV
496
                        set {
×
UNCOV
497
                                this._blockContent = CadObject.updateCollection(value, this.Document?.BlockRecords);
×
UNCOV
498
                        }
×
499
                }
500

501
                /// <summary>
502
                /// Gets or sets the block-content color.
503
                /// </summary>
504
                /// <remarks>
505
                /// <para>
506
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.BlockContentColor"/> property
507
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentColor"/> flag is set in the
508
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
509
                /// </para>
510
                /// </remarks>
511
                [DxfCodeValue(94)]
UNCOV
512
                public Color BlockContentColor { get; set; }
×
513

514
                /// <summary>
515
                /// Gets or sets the scale factor for block content.
516
                /// </summary>
517
                /// <remarks>
518
                /// <para>
519
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.BlockContentScale"/> property
520
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentScale"/> flag is set in the
521
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
522
                /// </para>
523
                /// </remarks>
524
                [DxfCodeValue(47, 49, 140)]
UNCOV
525
                public XYZ BlockContentScale { get; set; }
×
526

527
                //        TODO: Cannot be overridden? Is this property only relevant in AutoCAD?
528
                /// <summary>
529
                /// Gets or sets a value indicating whether scaling of the block content is enabled.
530
                /// </summary>
531
                [DxfCodeValue(293)]
UNCOV
532
                public bool EnableBlockContentScale { get; set; }
×
533

534
                /// <summary>
535
                /// Gets or sets the block content rotation.
536
                /// </summary>
537
                /// <remarks>
538
                /// <para>
539
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.BlockContentRotation"/> property
540
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentRotation"/> flag is set in the
541
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
542
                /// </para>
543
                /// </remarks>
544
                [DxfCodeValue(DxfReferenceType.IsAngle, 141)]
UNCOV
545
                public double BlockContentRotation { get; set; }
×
546

547
                //        TODO: Cannot be overridden? Is this property only relevant in AutoCAD?
548
                /// <summary>
549
                /// Gets or sets a value indicating whether rotation of the block content is enabled.
550
                /// </summary>
551
                [DxfCodeValue(294)]
UNCOV
552
                public bool EnableBlockContentRotation { get; set; }
×
553

554
                /// <summary>
555
                /// Gets or sets a value indicating whether the multileader connects to the content-block extents
556
                /// or to the content-block base point.
557
                /// </summary>
558
                /// <remarks>
559
                /// <para>
560
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.BlockContentConnection"/> property
561
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentConnection"/> flag is set in the
562
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
563
                /// </para>
564
                /// </remarks>
565
                [DxfCodeValue(177)]
UNCOV
566
                public BlockContentConnectionType BlockContentConnection { get; set; }
×
567

568
                /// <summary>
569
                /// Gets or sets the scale factor for the <see cref="ArrowheadSize"/>, <see cref="LandingDistance"/>,
570
                /// <see cref="LandingGap"/>, <see cref="TextHeight"/>, and the elements of <see cref="BlockContentScale"/>.
571
                /// </summary>
572
                /// <remarks>
573
                /// <para>
574
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.ScaleFactor"/> property
575
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.ScaleFactor"/> flag is set in the
576
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
577
                /// </para>
578
                /// </remarks>
579
                [DxfCodeValue(142)]
UNCOV
580
                public double ScaleFactor { get; set; }
×
581

582
                /// <summary>
583
                /// Overwrite Property Value
584
                /// </summary>
585
                /// <remarks>
586
                /// Property changed, meaning not totally clear
587
                /// might be set to true if something changed after loading,
588
                /// or might be used to trigger updates in dependent MLeaders.
589
                /// sequence seems to be different in DXF
590
                /// </remarks>
591
                [DxfCodeValue(295)]
UNCOV
592
                public bool OverwritePropertyValue { get; set; }
×
593

594
                /// <summary>
595
                /// Is Annotative
596
                /// </summary>
597
                [DxfCodeValue(296)]
UNCOV
598
                public bool IsAnnotative { get; set; }
×
599

600
                //        TODO What is the meaning of this property?
601
                /// <summary>
602
                /// Break Gap Size
603
                /// </summary>
604
                [DxfCodeValue(143)]
UNCOV
605
                public double BreakGapSize { get; set; }
×
606

607
                //        TODO Check
608
                //                 whether this property is relevant for both text an block content
609
                //                 How it can be overridden by LeaderRoot.AttachmentDirection
610
                /// <summary>
611
                /// Gets or sets the Text attachment direction for text or block contents, rename?
612
                /// This property defines whether the leaders attach to the left/right of the content block/text,
613
                /// or attach to the top/bottom.
614
                /// </summary>
615
                /// <remarks>
616
                /// <para>
617
                /// This value can be overridden by the <see cref="MultiLeader.TextAttachmentDirection"/> property
618
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextAttachmentDirection"/> flag is set in the
619
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
620
                /// </para><para>
621
                /// The value for all leader lines can be overridden for each individual leader line by the
622
                /// <see cref="MultiLeaderAnnotContext.LeaderRoot.TextAttachmentDirection"/> property when the
623
                /// <see cref="LeaderLinePropertOverrideFlags.TextAttachmentDirection"/> flag is set in the 
624
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
625
                /// </para>
626
                /// </remarks>
627
                /// <value>
628
                /// A <see cref="TextAttachmentDirectionType"/>.
629
                /// </value>
630
                [DxfCodeValue(271)]
UNCOV
631
                public TextAttachmentDirectionType TextAttachmentDirection { get; set; }
×
632

633
                /// <summary>
634
                /// Gets or sets the text bottom attachment type.
635
                /// This value controls the position of the connection point of the leader
636
                /// attached to the bottom of the text label.
637
                /// </summary>
638
                /// <remarks>
639
                /// <para>
640
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.TextBottomAttachment"/> property
641
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextBottomAttachment"/> flag is set in the
642
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
643
                /// </para><para>
644
                /// This property is only relevant if <see cref="TextAttachmentDirection"/> is
645
                /// <see cref="TextAttachmentDirectionType.Vertical"/> and a leader attached
646
                /// to the bottom of the text label exists.
647
                /// </para>
648
                /// </remarks>
649
                /// <value>
650
                /// A <see cref="TextAttachmentType"/> having the values
651
                ///         9 = Center,
652
                ///         10 = Underline and Center
653
                /// can be used ("vertical" attachment types).
654
                /// </value>
655
                [DxfCodeValue(272)]
UNCOV
656
                public TextAttachmentType TextBottomAttachment { get; set; }
×
657

658
                /// <summary>
659
                /// Gets or sets the text top attachment type.
660
                /// This value controls the position of the connection point of the leader
661
                /// attached to the top of the text label.
662
                /// </summary>
663
                /// <remarks>
664
                /// <para>
665
                /// This value can be overridden by the <see cref="MultiLeaderAnnotContext.TextTopAttachment"/> property
666
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextTopAttachment"/> flag is set in the
667
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
668
                /// </para><para>
669
                /// This property is only relevant if <see cref="TextAttachmentDirection"/> is
670
                /// <see cref="TextAttachmentDirectionType.Vertical"/> and a leader attached
671
                /// to the top of the text label exists.
672
                /// </para>
673
                /// </remarks>
674
                /// <value>
675
                /// A <see cref="TextAttachmentType"/> having the values
676
                ///         9 = Center,
677
                ///         10 = Underline and Center
678
                /// can be used ("vertical" attachment types).
679
                /// </value>
680
                [DxfCodeValue(273)]
UNCOV
681
                public TextAttachmentType TextTopAttachment { get; set; }
×
682

683
                /// <summary>
684
                /// Undocumented in ODS and DXF-ref boolean, found in DXF
685
                /// </summary>
686
                [DxfCodeValue(298)]
UNCOV
687
                public bool UnknownFlag298 { get; set; }
×
688

689
                /// <summary>
690
                /// Initializes a new instance of the <see cref="MultiLeaderStyle"/> class.
691
                /// </summary>
UNCOV
692
                public MultiLeaderStyle() : this(string.Empty) { }
×
693

694
                /// <summary>
695
                /// Initializes a new instance of the <see cref="MultiLeaderStyle"/> class
696
                /// and sets the name of this style.
697
                /// </summary>
UNCOV
698
                public MultiLeaderStyle(string name) : base()
×
UNCOV
699
                {
×
UNCOV
700
                        this.Name = name;
×
UNCOV
701
                }
×
702

703
                public override CadObject Clone()
UNCOV
704
                {
×
UNCOV
705
                        MultiLeaderStyle clone = (MultiLeaderStyle)base.Clone();
×
UNCOV
706
                        clone.TextStyle = (TextStyle)this._textStyle.Clone();
×
UNCOV
707
                        clone.LeaderLineType = (LineType)this._leaderLineType.Clone();
×
708
                        
UNCOV
709
                        clone.Arrowhead = (BlockRecord)this._arrowhead?.Clone();
×
UNCOV
710
                        clone.BlockContent = (BlockRecord)this._blockContent?.Clone();
×
711

UNCOV
712
                        return clone;
×
UNCOV
713
                }
×
714

715
                internal override void AssignDocument(CadDocument doc)
UNCOV
716
                {
×
UNCOV
717
                        base.AssignDocument(doc);
×
718

UNCOV
719
                        this._textStyle = CadObject.updateCollection(this._textStyle, doc.TextStyles);
×
UNCOV
720
                        this._leaderLineType = CadObject.updateCollection(this._leaderLineType, doc.LineTypes);
×
UNCOV
721
                        this._arrowhead = CadObject.updateCollection(this._arrowhead, doc.BlockRecords);
×
UNCOV
722
                        this._blockContent = CadObject.updateCollection(this._blockContent, doc.BlockRecords);
×
723

UNCOV
724
                        doc.TextStyles.OnRemove += this.tableOnRemove;
×
UNCOV
725
                        doc.LineTypes.OnRemove += this.tableOnRemove;
×
UNCOV
726
                        doc.BlockRecords.OnRemove += this.tableOnRemove;
×
UNCOV
727
                }
×
728

729
                internal override void UnassignDocument()
730
                {
×
731
                        this.Document.TextStyles.OnRemove -= this.tableOnRemove;
×
732
                        this.Document.LineTypes.OnRemove -= this.tableOnRemove;
×
733
                        this.Document.BlockRecords.OnRemove -= this.tableOnRemove;
×
734

735
                        base.UnassignDocument();
×
736

737
                        this._textStyle = (TextStyle)this._textStyle.Clone();
×
738
                        this._leaderLineType = (LineType)this._leaderLineType.Clone();
×
739
                        this._arrowhead = (BlockRecord)this._arrowhead?.Clone();
×
740
                        this._blockContent = (BlockRecord)this._blockContent?.Clone();
×
741
                }
×
742

743
                protected virtual void tableOnRemove(object sender, CollectionChangedEventArgs e)
UNCOV
744
                {
×
UNCOV
745
                        if (e.Item.Equals(this._textStyle))
×
746
                        {
×
747
                                this._textStyle = this.Document.TextStyles[Layer.DefaultName];
×
748
                        }
×
749

UNCOV
750
                        if (e.Item.Equals(this._leaderLineType))
×
751
                        {
×
752
                                this._leaderLineType = this.Document.LineTypes[LineType.ByLayerName];
×
753
                        }
×
754

UNCOV
755
                        if (e.Item.Equals(this.Arrowhead))
×
756
                        {
×
757
                                this._arrowhead = null;
×
758
                        }
×
759

UNCOV
760
                        if (e.Item.Equals(this.BlockContent))
×
761
                        {
×
762
                                this._blockContent = null;
×
763
                        }
×
UNCOV
764
                }
×
765
        }
766
}
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