Class EntityCollection
A class that inherits from System.Collections.Generic.IDictionary<TKey, TValue> where TKey is a string and TValue is an entity. This collection is used to store Entity objects by their Handle
Inheritance
System.Object
EntityCollection
Implements
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, Entity>>
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, Entity>>
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Dxflib.AcadEntities
Assembly: Dxflib.dll
Syntax
public class EntityCollection : IDictionary<string, Entity>, ICollection<KeyValuePair<string, Entity>>, IEnumerable<KeyValuePair<string, Entity>>, IEnumerable
Constructors
| Improve this Doc View SourceEntityCollection(IReadOnlyCollection<Entity>)
Constructor for the EntityCollection Type.
This constructor allocate the backing dictionary
with the handles of entities
.
It will however not link the entities
Declaration
public EntityCollection(IReadOnlyCollection<Entity> entities)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IReadOnlyCollection<Entity> | entities |
Properties
| Improve this Doc View SourceCount
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
IsReadOnly
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Item[String]
Declaration
public Entity this[string key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
Property Value
Type | Description |
---|---|
Entity |
Keys
Declaration
public ICollection<string> Keys { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<System.String> |
Values
Declaration
public ICollection<Entity> Values { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<Entity> |
Methods
| Improve this Doc View SourceAdd(KeyValuePair<String, Entity>)
Declaration
public void Add(KeyValuePair<string, Entity> item)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.KeyValuePair<System.String, Entity> | item |
Add(String, Entity)
Declaration
public void Add(string handle, Entity entity)
Parameters
Type | Name | Description |
---|---|---|
System.String | handle | The Entity Handle |
Entity | entity | The Entity |
Clear()
Declaration
public void Clear()
Contains(KeyValuePair<String, Entity>)
Declaration
public bool Contains(KeyValuePair<string, Entity> item)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.KeyValuePair<System.String, Entity> | item |
Returns
Type | Description |
---|---|
System.Boolean |
ContainsKey(String)
Declaration
public bool ContainsKey(string handle)
Parameters
Type | Name | Description |
---|---|---|
System.String | handle |
Returns
Type | Description |
---|---|
System.Boolean |
CopyTo(KeyValuePair<String, Entity>[], Int32)
Declaration
public void CopyTo(KeyValuePair<string, Entity>[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.KeyValuePair<System.String, Entity>[] | array | |
System.Int32 | arrayIndex |
GetEntitiesByType<T>()
Returns a list of entities that match the type given
Declaration
public List<T> GetEntitiesByType<T>()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<T> | A list of entities |
Type Parameters
Name | Description |
---|---|
T | The return type of the entities |
GetEnumerator()
Declaration
public IEnumerator<KeyValuePair<string, Entity>> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String, Entity>> |
Remove(KeyValuePair<String, Entity>)
Declaration
public bool Remove(KeyValuePair<string, Entity> item)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.KeyValuePair<System.String, Entity> | item |
Returns
Type | Description |
---|---|
System.Boolean |
Remove(String)
Declaration
public bool Remove(string handle)
Parameters
Type | Name | Description |
---|---|---|
System.String | handle | The Entity Handle |
Returns
Type | Description |
---|---|
System.Boolean |
TryGetValue(String, out Entity)
Declaration
public bool TryGetValue(string handle, out Entity entity)
Parameters
Type | Name | Description |
---|---|---|
System.String | handle | |
Entity | entity |
Returns
Type | Description |
---|---|
System.Boolean |
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
Implements
System.Collections.Generic.IDictionary<TKey, TValue>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable