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

DomCR / ACadSharp / 12612533277

04 Jan 2025 05:51PM UTC coverage: 75.623% (+0.6%) from 75.001%
12612533277

push

github

web-flow
Merge pull request #486 from DomCR/dynamic-blocks

Dynamic blocks

5196 of 7588 branches covered (68.48%)

Branch coverage included in aggregate %.

276 of 360 new or added lines in 21 files covered. (76.67%)

3 existing lines in 1 file now uncovered.

20797 of 26784 relevant lines covered (77.65%)

36308.12 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/>
NEW
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; }
271,299✔
25
                        set
26
                        {
79,641✔
27
                                OnNameChanged?.Invoke(this, new OnNameChangedArgs(this._name, value));
79,641✔
28
                                this._name = value;
79,641✔
29
                        }
79,641✔
30
                }
31

32
                private string _name = string.Empty;
66,682✔
33

34
                /// <summary>
35
                /// Default constructor.
36
                /// </summary>
37
                public NonGraphicalObject() { }
200,046✔
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