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

DomCR / ACadSharp / 22018280625

14 Feb 2026 01:30PM UTC coverage: 77.356% (-0.1%) from 77.463%
22018280625

Pull #978

github

web-flow
Merge cd1c403d2 into 4609c0caf
Pull Request #978: issue-976 context data

8148 of 11392 branches covered (71.52%)

Branch coverage included in aggregate %.

28 of 90 new or added lines in 6 files covered. (31.11%)

722 existing lines in 9 files now uncovered.

29481 of 37252 relevant lines covered (79.14%)

151138.57 hits per line

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

39.13
/src/ACadSharp/Objects/AnnotScaleObjectContextData.cs
1
using System;
2

3
using ACadSharp.Attributes;
4

5
namespace ACadSharp.Objects
6
{
7
        [DxfSubClass(DxfSubclassMarker.AnnotScaleObjectContextData)]
8
        public abstract class AnnotScaleObjectContextData : ObjectContextData
9
        {
10
                [DxfCodeValue(DxfReferenceType.Handle, 340)]
11
                public Scale Scale
12
                {
UNCOV
13
                        get { return _scale; }
×
14
                        set
15
                        {
×
16
                                if (value == null)
×
17
                                {
×
18
                                        throw new ArgumentNullException(nameof(value));
×
19
                                }
20

21
                                if (this.Document != null)
×
22
                                {
×
23
                                        this._scale = CadObject.updateCollection(value, this.Document.Scales);
×
24
                                }
×
25
                                else
26
                                {
×
27
                                        this._scale = value;
×
28
                                }
×
29
                        }
×
30
                }
31

32
                /// <inheritdoc/>
33
                public override string SubclassMarker => DxfSubclassMarker.AnnotScaleObjectContextData;
×
34

35
                private Scale _scale = Scale.Default;
5,070✔
36

37
                public override CadObject Clone()
38
                {
3✔
39
                        AnnotScaleObjectContextData clone = (AnnotScaleObjectContextData)base.Clone();
3✔
40

41
                        clone._scale = (Scale)this._scale?.Clone();
3!
42

43
                        return clone;
3✔
44
                }
3✔
45

46
                internal override void AssignDocument(CadDocument doc)
47
                {
5,187✔
48
                        base.AssignDocument(doc);
5,187✔
49

50
                        this._scale = CadObject.updateCollection(this._scale, this.Document?.Scales);
5,187!
51

52
                        this.Document.Scales.OnRemove += tableOnRemove;
5,187✔
53
                }
5,187✔
54

55
                internal override void UnassignDocument()
56
                {
300✔
57
                        this.Document.Scales.OnRemove -= tableOnRemove;
300✔
58

59
                        base.UnassignDocument();
300✔
60

61
                        this._scale = (Scale)this._scale.Clone();
300✔
62
                }
300✔
63

64
                private void tableOnRemove(object sender, CollectionChangedEventArgs e)
UNCOV
65
                {
×
66
                        if (e.Item.Equals(this._scale))
×
67
                        {
×
68
                                this._scale = this.Document.Scales[Scale.Default.Name];
×
69
                        }
×
70
                }
×
71
        }
72
}
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