• 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/SortEntitiesTable.cs
1
using ACadSharp.Attributes;
2
using ACadSharp.Entities;
3
using ACadSharp.Tables;
4
using System;
5
using System.Collections.Generic;
6

7
namespace ACadSharp.Objects
8
{
9
        /// <summary>
10
        /// Represents a <see cref="SortEntitiesTable"/> object
11
        /// </summary>
12
        /// <remarks>
13
        /// Object name <see cref="DxfFileToken.ObjectSortEntsTable"/> <br/>
14
        /// Dxf class name <see cref="DxfSubclassMarker.SortentsTable"/>
15
        /// </remarks>
16
        [DxfName(DxfFileToken.ObjectSortEntsTable)]
17
        [DxfSubClass(DxfSubclassMarker.SortentsTable)]
18
        public partial class SortEntitiesTable : NonGraphicalObject
19
        {
20
                /// <summary>
21
                /// Dictionary entry name for the object <see cref="SortEntitiesTable"/>
22
                /// </summary>
23
                public const string DictionaryEntryName = "ACAD_SORTENTS";
24

25
                /// <inheritdoc/>
26
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
27

28
                /// <inheritdoc/>
29
                public override string ObjectName => DxfFileToken.ObjectSortEntsTable;
×
30

31
                /// <inheritdoc/>
32
                public override string SubclassMarker => DxfSubclassMarker.SortentsTable;
×
33

34
                /// <summary>
35
                /// Block owner where the table is applied
36
                /// </summary>
37
                [DxfCodeValue(330)]
38
                public BlockRecord BlockOwner { get; internal set; }
×
39

40
                /// <summary>
41
                /// List of the <see cref="BlockOwner"/> entities sorted.
42
                /// </summary>
43
                public IEnumerable<Sorter> Sorters { get { return this._sorters; } }
×
44

45
                private List<Sorter> _sorters = new();
×
46

47
                internal SortEntitiesTable()
×
48
                {
×
49
                        this.Name = DictionaryEntryName;
×
50
                }
×
51

52
                internal SortEntitiesTable(BlockRecord owner) : this()
×
53
                {
×
54
                        this.BlockOwner = owner;
×
55
                }
×
56

57
                /// <summary>
58
                /// Sorter attached to an entity.
59
                /// </summary>
60
                /// <param name="entity">Enity in the block to be sorted.</param>
61
                /// <param name="sorterHandle">Sorter handle, will use the entity handle if null.</param>
62
                /// <exception cref="ArgumentException"></exception>
63
                public void AddEntity(Entity entity, ulong? sorterHandle = null)
64
                {
×
65
                        if (entity.Owner != null && entity.Owner != this.BlockOwner)
×
66
                        {
×
67
                                throw new ArgumentException($"Entity is not owned by the block {this.BlockOwner.Name}", nameof(entity));
×
68
                        }
69

70
                        this._sorters.Add(new Sorter(entity, sorterHandle));
×
71
                }
×
72

73
                internal void OnAddEntity(object sender, CollectionChangedEventArgs e)
74
                {
×
75
                        this._sorters.Add(new Sorter((Entity)e.Item));
×
76
                }
×
77
        }
78
}
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