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

DomCR / ACadSharp / 22303299884

23 Feb 2026 11:00AM UTC coverage: 77.093% (-0.2%) from 77.315%
22303299884

Pull #982

github

web-flow
Merge ee2dcef46 into e5434eb50
Pull Request #982: Refactor Field, FieldList, and CadValue handling

8173 of 11478 branches covered (71.21%)

Branch coverage included in aggregate %.

14 of 131 new or added lines in 9 files covered. (10.69%)

20 existing lines in 3 files now uncovered.

29571 of 37481 relevant lines covered (78.9%)

150350.56 hits per line

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

28.57
/src/ACadSharp/Objects/Field.cs
1
using ACadSharp.Attributes;
2
using System;
3
using System.Collections.Generic;
4

5
namespace ACadSharp.Objects;
6

7
/// <summary>
8
/// Represents a <see cref="Field"/> object.
9
/// </summary>
10
/// <remarks>
11
/// Object name <see cref="DxfFileToken.ObjectField"/> <br/>
12
/// Dxf class name <see cref="DxfSubclassMarker.Field"/>
13
/// </remarks>
14
[DxfName(DxfFileToken.ObjectField)]
15
[DxfSubClass(DxfSubclassMarker.Field)]
16
public class Field : NonGraphicalObject
17
{
18
        /// <summary>
19
        /// Gets or sets the collection of CAD objects associated with this entity.
20
        /// </summary>
21
        [DxfCodeValue(DxfReferenceType.Count, 97)]
22
        [DxfCollectionCodeValue(DxfReferenceType.Handle, 331)]
23
        public List<CadObject> CadObjects { get; set; } = new();
1✔
24

25
        /// <summary>
26
        /// Gets the collection of child fields associated with this object.
27
        /// </summary>
28
        [DxfCodeValue(DxfReferenceType.Count, 90)]
29
        [DxfCollectionCodeValue(DxfReferenceType.Handle, 360)]
30
        public CadObjectCollection<Field> Children { get; private set; }
1✔
31

32
        /// <summary>
33
        /// Gets or sets the error code resulting from the evaluation process.
34
        /// </summary>
35
        [DxfCodeValue(96)]
36
        public int EvaluationErrorCode { get; set; }
1✔
37

38
        /// <summary>
39
        /// Gets or sets the error message generated during evaluation.
40
        /// </summary>
41
        [DxfCodeValue(300)]
42
        public string EvaluationErrorMessage { get; set; }
×
43

44
        /// <summary>
45
        /// Gets or sets the evaluation option flags that control how the associated expression is evaluated.
46
        /// </summary>
47
        [DxfCodeValue(91)]
48
        public EvaluationOptionFlags EvaluationOptionFlags { get; set; }
×
49

50
        /// <summary>
51
        /// Gets or sets the evaluation status flags that indicate the current state of the object evaluation process.
52
        /// </summary>
53
        /// <remarks>These flags provide information about the outcome or progress of the evaluation, such as whether
54
        /// the evaluation succeeded, failed, or is in progress. The specific meaning of each flag is defined by the
55
        /// EvaluationStatusFlags enumeration.</remarks>
56
        [DxfCodeValue(95)]
57
        public EvaluationStatusFlags EvaluationStatusFlags { get; set; }
×
58

59
        /// <summary>
60
        /// Gets or sets the identifier of the evaluator associated with this entity.
61
        /// </summary>
62
        [DxfCodeValue(1)]
63
        public string EvaluatorId { get; set; }
×
64

65
        [DxfCodeValue(2)]
66
        public string FieldCode { get; set; }
×
67

68
        [DxfCodeValue(94)]
69
        public FieldStateFlags FieldStateFlags { get; set; }
×
70

71
        [DxfCodeValue(92)]
72
        public FilingOptionFlags FilingOptionFlags { get; set; }
×
73

74
        [DxfCodeValue(301)]
NEW
75
        public string FormatString { get; set; }
×
76

77
        /// <inheritdoc/>
78
        public override string ObjectName => DxfFileToken.ObjectField;
×
79

80
        //Binary data(if data type of field value is binary)
81
        [DxfCodeValue(9)]
NEW
82
        public string OverflowFormatString { get; set; }
×
83

84
        /// <inheritdoc/>
85
        public override string SubclassMarker => DxfSubclassMarker.Field;
×
86

87
        /// <inheritdoc/>
88
        public Field() : base()
1✔
89
        {
1✔
90
                this.Children = new(this);
1✔
91
        }
1✔
92

93
        /// <summary>
94
        /// Gets or sets the collection of CAD values associated with the field.
95
        /// </summary>
96
        [DxfCodeValue(DxfReferenceType.Count, 93)]
97
        [DxfCollectionCodeValue(6)]
98
        public Dictionary<string, CadValue> Values { get; private set; } = new(StringComparer.InvariantCultureIgnoreCase);
1✔
99

100
        [DxfCodeValue(7)]
NEW
101
        public CadValue Value { get; set; }
×
102

103
        //90
104
        //Data type of field value
105

106
        //140
107
        //Double value(if data type of field value is double)
108

109
        //330
110
        //ID value, AcDbSoftPointerId (if data type of field value is ID)
111

112
        //92
113
        //Binary data buffer size(if data type of field value is binary)
114

115
        //310
116
        //Binary data(if data type of field value is binary)
117

118
        //301        Format string
119

120
        //9        Overflow of format string
121

122
        //98        Length of format string
123

124
        internal override void AssignDocument(CadDocument doc)
NEW
125
        {
×
NEW
126
                base.AssignDocument(doc);
×
127

NEW
128
                doc.RegisterCollection(this.Children);
×
NEW
129
        }
×
130

131
        internal override void UnassignDocument()
NEW
132
        {
×
NEW
133
                this.Document.UnregisterCollection(this.Children);
×
134

NEW
135
                base.UnassignDocument();
×
NEW
136
        }
×
137
}
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

© 2026 Coveralls, Inc