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

5
namespace ACadSharp
6
{
7
        /// <summary>
8
        /// Represents a collection of <see cref="CadObject"/> ended by a <see cref="Entities.Seqend"/> entity.
9
        /// </summary>
10
        /// <typeparam name="T"></typeparam>
11
        public class SeqendCollection<T> : CadObjectCollection<T>, ISeqendCollection
12
                where T : CadObject
13
        {
14
                public event EventHandler<CollectionChangedEventArgs> OnSeqendAdded;
15

16
                public event EventHandler<CollectionChangedEventArgs> OnSeqendRemoved;
17

18
                /// <summary>
19
                /// Sequence end entity for dxf.
20
                /// </summary>
21
                public Seqend Seqend
22
                {
23
                        get
UNCOV
24
                        {
×
UNCOV
25
                                if (this._entries.Any())
×
UNCOV
26
                                        return this._seqend;
×
27
                                else
UNCOV
28
                                        return null;
×
UNCOV
29
                        }
×
30
                        internal set
UNCOV
31
                        {
×
UNCOV
32
                                this._seqend = value;
×
UNCOV
33
                                this._seqend.Owner = this.Owner;
×
UNCOV
34
                        }
×
35
                }
36

37
                private Seqend _seqend;
38

UNCOV
39
                public SeqendCollection(CadObject owner) : base(owner)
×
UNCOV
40
                {
×
UNCOV
41
                        this._seqend = new Seqend(owner);
×
UNCOV
42
                }
×
43

44
                /// <inheritdoc/>
45
                public override void Add(T item)
UNCOV
46
                {
×
UNCOV
47
                        bool addSeqend = false;
×
UNCOV
48
                        if (!this._entries.Any())
×
UNCOV
49
                        {
×
UNCOV
50
                                addSeqend = true;
×
UNCOV
51
                        }
×
52

UNCOV
53
                        base.Add(item);
×
54

55
                        // The add could fail due an Exception
UNCOV
56
                        if (addSeqend && this._entries.Any())
×
UNCOV
57
                        {
×
UNCOV
58
                                this.OnSeqendAdded?.Invoke(this, new CollectionChangedEventArgs(this._seqend));
×
UNCOV
59
                        }
×
UNCOV
60
                }
×
61

62
                /// <inheritdoc/>
63
                public override T Remove(T item)
UNCOV
64
                {
×
UNCOV
65
                        var e = base.Remove(item);
×
UNCOV
66
                        if(e != null)
×
UNCOV
67
                        {
×
UNCOV
68
                                this.OnSeqendRemoved?.Invoke(this, new CollectionChangedEventArgs(this._seqend));
×
UNCOV
69
                        }
×
70

UNCOV
71
                        return e;
×
UNCOV
72
                }
×
73
        }
74
}
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