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

DomCR / ACadSharp / 14834551532

05 May 2025 10:40AM UTC coverage: 75.488% (+0.4%) from 75.056%
14834551532

Pull #641

github

web-flow
Merge 658b524fc into 9a87bd970
Pull Request #641: MultiLeader SPIKE

5714 of 8329 branches covered (68.6%)

Branch coverage included in aggregate %.

220 of 245 new or added lines in 7 files covered. (89.8%)

86 existing lines in 13 files now uncovered.

22880 of 29550 relevant lines covered (77.43%)

82421.21 hits per line

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

65.52
/src/ACadSharp/Objects/NonGraphicalObject.cs
1
using ACadSharp.Attributes;
2
using System;
3

4
namespace ACadSharp.Objects
5
{
6
        /// <summary>
7
        /// The standard class for a basic CAD non-graphical object.
8
        /// </summary>
9
        [DxfSubClass(null, true)]
10
        public abstract class NonGraphicalObject : CadObject, INamedCadObject
11
        {
12
                public event EventHandler<OnNameChangedArgs> OnNameChanged;
13

14
                /// <inheritdoc/>
15
                /// <remarks>
16
                /// The name of a <see cref="NonGraphicalObject"/> will be used as the name of the entry when the owner is a <see cref="CadDictionary"/>
17
                /// otherwise the name may not be saved if there is no dxf code assigned to the <see cref="CadObject"/>.
18
                /// </remarks>
19
                public virtual string Name
20
                {
21
                        get { return this._name; }
521,235✔
22
                        set
23
                        {
205,565✔
24
                                OnNameChanged?.Invoke(this, new OnNameChangedArgs(this._name, value));
205,565✔
25
                                this._name = value;
205,565✔
26
                        }
205,565✔
27
                }
28

29
                /// <inheritdoc/>
UNCOV
30
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
31

32
                private string _name = string.Empty;
124,573✔
33

34
                /// <summary>
35
                /// Default constructor.
36
                /// </summary>
37
                public NonGraphicalObject()
124,571✔
38
                { }
249,142✔
39

40
                /// <summary>
41
                /// Initialize a <see cref="NonGraphicalObject"/> with an specific name.
42
                /// </summary>
43
                /// <param name="name"></param>
44
                public NonGraphicalObject(string name)
2✔
45
                {
2✔
46
                        this._name = name;
2✔
47
                }
2✔
48

49
                /// <inheritdoc/>
50
                public override CadObject Clone()
51
                {
339✔
52
                        NonGraphicalObject clone = (NonGraphicalObject)base.Clone();
339✔
53
                        clone.OnNameChanged = null;
339✔
54
                        return clone;
339✔
55
                }
339✔
56

57
                /// <inheritdoc/>
58
                public override string ToString()
59
                {
×
UNCOV
60
                        if (string.IsNullOrEmpty(this.Name))
×
UNCOV
61
                        {
×
UNCOV
62
                                return $"{this.ObjectName}:{this.Handle}";
×
63
                        }
64
                        else
UNCOV
65
                        {
×
UNCOV
66
                                return $"{this.ObjectName}:{this.Name}:{this.Handle}";
×
67
                        }
UNCOV
68
                }
×
69
        }
70
}
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