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

DomCR / ACadSharp / 29143042407

11 Jul 2026 06:34AM UTC coverage: 2.912% (-73.0%) from 75.918%
29143042407

push

github

web-flow
Merge pull request #1146 from ilCosmico/acds-read-payload-anchor

Read the AcDs payload area offset from the data segment header

264 of 12999 branches covered (2.03%)

Branch coverage included in aggregate %.

0 of 30 new or added lines in 1 file covered. (0.0%)

31243 existing lines in 465 files now uncovered.

1337 of 41984 relevant lines covered (3.18%)

5.38 hits per line

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

0.0
/src/ACadSharp/Objects/Collections/DictionaryVariableCollection.cs
1
namespace ACadSharp.Objects.Collections
2
{
3
        /// <summary>
4
        /// Represents a collection of named <see cref="DictionaryVariable"/> stored as key-value pairs, providing methods to add, update, and
5
        /// retrieve variable values by name.
6
        /// </summary>
7
        /// <remarks>This collection is typically used to manage custom variables within a CAD dictionary context.
8
        /// Variable names are case-insensitive and must be unique within the collection. Adding a variable with an existing name
9
        /// updates its value.</remarks>
10
        public class DictionaryVariableCollection : ObjectDictionaryCollection<DictionaryVariable>
11
        {
12
                /// <inheritdoc/>
UNCOV
13
                public DictionaryVariableCollection(CadDictionary dictionary) : base(dictionary)
×
UNCOV
14
                {
×
UNCOV
15
                }
×
16

17
                /// <summary>
18
                /// Adds a variable with the specified name and value to the collection. If a variable with the same name already
19
                /// exists, its value is updated.
20
                /// </summary>
21
                /// <param name="name">The name of the variable to add or update. Cannot be null.</param>
22
                /// <param name="value">The value to assign to the variable. Can be null.</param>
23
                public void AddOrUpdateVariable(string name, string value)
UNCOV
24
                {
×
UNCOV
25
                        if (this.TryGet(name, out DictionaryVariable v))
×
UNCOV
26
                        {
×
UNCOV
27
                                v.Value = value;
×
UNCOV
28
                        }
×
29
                        else
UNCOV
30
                        {
×
UNCOV
31
                                this.Add(new DictionaryVariable(name, value));
×
UNCOV
32
                        }
×
UNCOV
33
                }
×
34

35
                /// <summary>
36
                /// Adds a new variable with the specified name and value to the collection if a variable with the same name does not
37
                /// already exist.
38
                /// </summary>
39
                /// <param name="name">The name of the variable to add. Cannot be null or empty.</param>
40
                /// <param name="value">The value to assign to the variable. Can be null or empty.</param>
41
                public void AddVariable(string name, string value)
UNCOV
42
                {
×
UNCOV
43
                        if (!this.ContainsKey(name))
×
UNCOV
44
                        {
×
UNCOV
45
                                this.Add(new DictionaryVariable(name, value));
×
UNCOV
46
                        }
×
UNCOV
47
                }
×
48

49
                /// <summary>
50
                /// Creates and adds default variables to the collection.
51
                /// </summary>
52
                /// <remarks>Call this method to ensure that the collection contains the standard default variables.
53
                /// Calling this method multiple times has no effect on existing entries.</remarks>
54
                public void CreateDefaults()
UNCOV
55
                {
×
UNCOV
56
                        this.AddVariable(DictionaryVariable.CurrentMultiLeaderStyle, MultiLeaderStyle.DefaultName);
×
UNCOV
57
                        this.AddVariable(DictionaryVariable.CurrentAnnotationScale, Scale.DefaultName);
×
UNCOV
58
                        this.AddVariable(DictionaryVariable.CurrentTableStyle, TableStyle.DefaultName);
×
UNCOV
59
                        this.AddVariable(DictionaryVariable.WipeoutFrame, ((int)WipeoutFrameType.DisplayAndPlotted).ToString());
×
60

61
                        //View Section Style object not implemented
UNCOV
62
                        this.AddVariable("CVIEWDETAILSTYLE", "Metric50");
×
UNCOV
63
                        this.AddVariable("CVIEWSECTIONSTYLE", "Metric50");
×
UNCOV
64
                }
×
65

66
                /// <summary>
67
                /// Retrieves the value associated with the specified variable name.
68
                /// </summary>
69
                /// <param name="name">The name of the variable whose value to retrieve. Cannot be null.</param>
70
                /// <returns>The value of the variable if found; otherwise, null.</returns>
71
                public string GetValue(string name)
UNCOV
72
                {
×
UNCOV
73
                        if (this.TryGet(name, out DictionaryVariable v))
×
UNCOV
74
                        {
×
UNCOV
75
                                return v.Value;
×
76
                        }
77
                        else
UNCOV
78
                        {
×
UNCOV
79
                                return null;
×
80
                        }
UNCOV
81
                }
×
82
        }
83
}
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