• 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/BookColor.cs
1
using ACadSharp.Attributes;
2
using System;
3
using System.Linq;
4

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

21
                /// <inheritdoc/>
22
                public override string ObjectName => DxfFileToken.ObjectDBColor;
×
23

24
                /// <inheritdoc/>
25
                public override string SubclassMarker => DxfSubclassMarker.DbColor;
×
26

27
                /// <inheritdoc/>
28
                public override string Name
29
                {
30
                        get { return base.Name; }
×
31
                        set
32
                        {
×
33
                                if (!value.Contains('$'))
×
34
                                {
×
35
                                        throw new ArgumentException($"Invalid BookColor name: ({value}), a book color name has to separate the book name and the color name by the character '$'", nameof(value));
×
36
                                }
37

38
                                base.Name = value;
×
39
                        }
×
40
                }
41

42
                /// <summary>
43
                /// Color name.
44
                /// </summary>
45
                public string ColorName { get { return this.Name.Split('$').Last(); } }
×
46

47
                /// <summary>
48
                /// Book name where the color is stored.
49
                /// </summary>
50
                public string BookName { get { return this.Name.Split('$').First(); } }
×
51

52
                [DxfCodeValue(62, 420)]
53
                public Color Color { get; set; }
×
54

55
                public BookColor() : base() { }
×
56

57
                public BookColor(string name) : base(name)
×
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