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

DomCR / ACadSharp / 12619114630

05 Jan 2025 11:27AM UTC coverage: 75.645% (+0.6%) from 75.001%
12619114630

Pull #490

github

web-flow
Merge 01b5ca4aa into 0d0db0394
Pull Request #490: Issue 474 header defaults

5217 of 7612 branches covered (68.54%)

Branch coverage included in aggregate %.

129 of 157 new or added lines in 5 files covered. (82.17%)

581 existing lines in 13 files now uncovered.

20882 of 26890 relevant lines covered (77.66%)

39172.96 hits per line

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

39.13
/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/>
UNCOV
15
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
16

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

32
                private string _name = string.Empty;
72,215✔
33

34
                /// <summary>
35
                /// Default constructor.
36
                /// </summary>
37
                public NonGraphicalObject() { }
216,645✔
38

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

48
                /// <inheritdoc/>
49
                public override string ToString()
50
                {
×
UNCOV
51
                        if (string.IsNullOrEmpty(this.Name))
×
UNCOV
52
                        {
×
53
                                return $"{this.ObjectName}:{this.Handle}";
×
54
                        }
55
                        else
56
                        {
×
UNCOV
57
                                return $"{this.ObjectName}:{this.Name}:{this.Handle}";
×
58
                        }
UNCOV
59
                }
×
60
        }
61
}
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