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

DomCR / ACadSharp / 12905761471

22 Jan 2025 10:03AM UTC coverage: 2.0% (-74.0%) from 75.963%
12905761471

push

github

DomCR
version 1.0.6

104 of 7676 branches covered (1.35%)

Branch coverage included in aggregate %.

590 of 27024 relevant lines covered (2.18%)

5.13 hits per line

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

0.0
/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
                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; }
×
25
                        set
26
                        {
×
27
                                OnNameChanged?.Invoke(this, new OnNameChangedArgs(this._name, value));
×
28
                                this._name = value;
×
29
                        }
×
30
                }
31

32
                private string _name = string.Empty;
×
33

34
                /// <summary>
35
                /// Default constructor.
36
                /// </summary>
37
                public NonGraphicalObject() { }
×
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)
×
44
                {
×
45
                        this._name = name;
×
46
                }
×
47

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