Show / Hide Table of Contents

Class EntityCollection

Represent a collection of EntityObject that fire events when it is modified.

Inheritance
System.Object
EntityCollection
Implements
System.Collections.Generic.IList<EntityObject>
System.Collections.Generic.ICollection<EntityObject>
System.Collections.Generic.IEnumerable<EntityObject>
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: netDxf.Collections
Assembly: CADability.dll
Syntax
public class EntityCollection : IList<EntityObject>, ICollection<EntityObject>, IEnumerable<EntityObject>, IEnumerable

Constructors

| Improve this Doc View Source

EntityCollection()

Initializes a new instance of EntityCollection.

Declaration
public EntityCollection()
| Improve this Doc View Source

EntityCollection(Int32)

Initializes a new instance of EntityCollection and has the specified initial capacity.

Declaration
public EntityCollection(int capacity)
Parameters
Type Name Description
System.Int32 capacity

The number of items the collection can initially store.

Properties

| Improve this Doc View Source

Count

Gets the number of EntityObject contained in the collection.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

IsReadOnly

Gets a value indicating whether the collection is read-only.

Declaration
public virtual bool IsReadOnly { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Item[Int32]

Gets or sets the EntityObject at the specified index.

Declaration
public EntityObject this[int index] { get; set; }
Parameters
Type Name Description
System.Int32 index

The zero-based index of the element to get or set.

Property Value
Type Description
EntityObject

The EntityObject at the specified index.

Methods

| Improve this Doc View Source

Add(EntityObject)

Adds an EntityObject to the collection.

Declaration
public void Add(EntityObject item)
Parameters
Type Name Description
EntityObject item

The EntityObject to add to the collection.

| Improve this Doc View Source

AddRange(IEnumerable<EntityObject>)

Adds an EntityObject list to the end of the collection.

Declaration
public void AddRange(IEnumerable<EntityObject> collection)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<EntityObject> collection

The collection whose elements should be added.

| Improve this Doc View Source

Clear()

Removes all EntityObject from the collection.

Declaration
public void Clear()
| Improve this Doc View Source

Contains(EntityObject)

Determines whether an EntityObject is in the collection.

Declaration
public bool Contains(EntityObject item)
Parameters
Type Name Description
EntityObject item

The EntityObject to locate in the collection.

Returns
Type Description
System.Boolean

True if item is found in the collection; otherwise, false.

| Improve this Doc View Source

CopyTo(EntityObject[], Int32)

Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.

Declaration
public void CopyTo(EntityObject[] array, int arrayIndex)
Parameters
Type Name Description
EntityObject[] array

The one-dimensional System.Array that is the destination of the elements copied from the collection. The System.Array must have zero-based indexing.

System.Int32 arrayIndex

The zero-based index in array at which copying begins.

| Improve this Doc View Source

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration
public IEnumerator<EntityObject> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<EntityObject>

An enumerator that can be used to iterate through the collection.

| Improve this Doc View Source

IndexOf(EntityObject)

Searches for the specified EntityObject and returns the zero-based index of the first occurrence within the entire collection.

Declaration
public int IndexOf(EntityObject item)
Parameters
Type Name Description
EntityObject item

The EntityObject to locate in the collection.

Returns
Type Description
System.Int32

The zero-based index of the first occurrence of item within the entire collection, if found; otherwise, –1.

| Improve this Doc View Source

Insert(Int32, EntityObject)

Inserts an EntityObject into the collection at the specified index.

Declaration
public void Insert(int index, EntityObject item)
Parameters
Type Name Description
System.Int32 index

The zero-based index at which item should be inserted.

EntityObject item

The EntityObject to insert. The value can not be null.

| Improve this Doc View Source

OnAddItemEvent(EntityObject)

Declaration
protected virtual void OnAddItemEvent(EntityObject item)
Parameters
Type Name Description
EntityObject item
| Improve this Doc View Source

OnBeforeAddItemEvent(EntityObject)

Declaration
protected virtual bool OnBeforeAddItemEvent(EntityObject item)
Parameters
Type Name Description
EntityObject item
Returns
Type Description
System.Boolean
| Improve this Doc View Source

OnBeforeRemoveItemEvent(EntityObject)

Declaration
protected virtual bool OnBeforeRemoveItemEvent(EntityObject item)
Parameters
Type Name Description
EntityObject item
Returns
Type Description
System.Boolean
| Improve this Doc View Source

OnRemoveItemEvent(EntityObject)

Declaration
protected virtual void OnRemoveItemEvent(EntityObject item)
Parameters
Type Name Description
EntityObject item
| Improve this Doc View Source

Remove(EntityObject)

Removes the first occurrence of a specific EntityObject from the collection

Declaration
public bool Remove(EntityObject item)
Parameters
Type Name Description
EntityObject item

The EntityObject to remove from the collection.

Returns
Type Description
System.Boolean

True if EntityObject is successfully removed; otherwise, false.

| Improve this Doc View Source

Remove(IEnumerable<EntityObject>)

Removes the first occurrence of a specific object from the collection

Declaration
public void Remove(IEnumerable<EntityObject> items)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<EntityObject> items

The list of objects to remove from the collection.

| Improve this Doc View Source

RemoveAt(Int32)

Removes the EntityObject at the specified index of the collection.

Declaration
public void RemoveAt(int index)
Parameters
Type Name Description
System.Int32 index

The zero-based index of the EntityObject to remove.

Events

| Improve this Doc View Source

AddItem

Declaration
public event EntityCollection.AddItemEventHandler AddItem
Event Type
Type Description
EntityCollection.AddItemEventHandler
| Improve this Doc View Source

BeforeAddItem

Declaration
public event EntityCollection.BeforeAddItemEventHandler BeforeAddItem
Event Type
Type Description
EntityCollection.BeforeAddItemEventHandler
| Improve this Doc View Source

BeforeRemoveItem

Declaration
public event EntityCollection.BeforeRemoveItemEventHandler BeforeRemoveItem
Event Type
Type Description
EntityCollection.BeforeRemoveItemEventHandler
| Improve this Doc View Source

RemoveItem

Declaration
public event EntityCollection.RemoveItemEventHandler RemoveItem
Event Type
Type Description
EntityCollection.RemoveItemEventHandler

Explicit Interface Implementations

| Improve this Doc View Source

ICollection<EntityObject>.Add(EntityObject)

Declaration
void ICollection<EntityObject>.Add(EntityObject item)
Parameters
Type Name Description
EntityObject item
| Improve this Doc View Source

IList<EntityObject>.Insert(Int32, EntityObject)

Declaration
void IList<EntityObject>.Insert(int index, EntityObject item)
Parameters
Type Name Description
System.Int32 index
EntityObject item
| Improve this Doc View Source

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

Implements

System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX