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

DomCR / ACadSharp / 17737836230

15 Sep 2025 03:12PM UTC coverage: 2.092% (-76.2%) from 78.245%
17737836230

push

github

web-flow
Merge pull request #790 from DomCR/addflag-refactor

addflag refactor

141 of 9225 branches covered (1.53%)

Branch coverage included in aggregate %.

0 of 93 new or added lines in 10 files covered. (0.0%)

24910 existing lines in 372 files now uncovered.

724 of 32119 relevant lines covered (2.25%)

5.76 hits per line

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

0.0
/src/ACadSharp/Objects/BookColor.cs
1
using ACadSharp.Attributes;
2
using CSUtilities.Extensions;
3
using System;
4
using System.Drawing;
5
using System.Linq;
6

7
namespace ACadSharp.Objects
8
{
9
        /// <summary>
10
        /// Represents a <see cref="BookColor"/> object.
11
        /// </summary>
12
        /// <remarks>
13
        /// Object name <see cref="DxfFileToken.ObjectDBColor"/> <br/>
14
        /// Dxf class name <see cref="DxfSubclassMarker.DbColor"/>
15
        /// </remarks>
16
        [DxfName(DxfFileToken.ObjectDBColor)]
17
        [DxfSubClass(DxfSubclassMarker.DbColor)]
18
        public class BookColor : NonGraphicalObject
19
        {
20
                /// <inheritdoc/>
UNCOV
21
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
22

23
                /// <inheritdoc/>
UNCOV
24
                public override string ObjectName => DxfFileToken.ObjectDBColor;
×
25

26
                /// <inheritdoc/>
27
                public override string SubclassMarker => DxfSubclassMarker.DbColor;
×
28

29
                /// <summary>
30
                /// Returns the full name of the color, following the structure BookName$ColorName,
31
                /// if when set doesn't follow this structure only the name will be changed.
32
                /// </summary>
33
                /// <inheritdoc/>
34
                public override string Name
35
                {
36
                        get
UNCOV
37
                        {
×
UNCOV
38
                                if (this.ColorName.IsNullOrEmpty())
×
UNCOV
39
                                {
×
UNCOV
40
                                        return string.Empty;
×
41
                                }
42
                                else
UNCOV
43
                                {
×
UNCOV
44
                                        return $"{this.BookName}${this.ColorName}";
×
45
                                }
UNCOV
46
                        }
×
47
                        set
UNCOV
48
                        {
×
UNCOV
49
                                if (value.Contains('$'))
×
UNCOV
50
                                {
×
UNCOV
51
                                        base.Name = value;
×
52

UNCOV
53
                                        this.BookName = value.Split('$').First();
×
UNCOV
54
                                        this.ColorName = value.Split('$').Last();
×
UNCOV
55
                                }
×
56
                                else
UNCOV
57
                                {
×
UNCOV
58
                                        this.ColorName = value;
×
UNCOV
59
                                }
×
UNCOV
60
                        }
×
61
                }
62

63
                /// <summary>
64
                /// Color name.
65
                /// </summary>
UNCOV
66
                public string ColorName { get; set; }
×
67

68
                /// <summary>
69
                /// Book name where the color is stored.
70
                /// </summary>
UNCOV
71
                public string BookName { get; set; }
×
72

73
                [DxfCodeValue(62, 420)]
UNCOV
74
                public Color Color { get; set; }
×
75

76
                /// <inheritdoc/>
UNCOV
77
                public BookColor() : base() { }
×
78

79
                /// <summary>
80
                /// Initialize a <see cref="BookColor"/> with an specific name.
81
                /// </summary>
82
                /// <param name="name"></param>
UNCOV
83
                public BookColor(string name) : base(name)
×
UNCOV
84
                {
×
UNCOV
85
                }
×
86

87
                /// <summary>
88
                /// Initialize a <see cref="BookColor"/> with an specific book and color name.
89
                /// </summary>
90
                /// <param name="name"></param>
91
                /// <param name="bookName"></param>
92
                public BookColor(string name, string bookName) : base()
×
93
                {
×
94
                        this.Name = name;
×
95
                        this.BookName = bookName;
×
96
                }
×
97
        }
98
}
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