Class AttributeCollection
Represents a collection of Attribute.
Inheritance
Implements
Inherited Members
Namespace: netDxf.Collections
Assembly: CADability.dll
Syntax
public sealed class AttributeCollection : IReadOnlyList<Attribute>, IReadOnlyCollection<Attribute>, IEnumerable<Attribute>, IEnumerable
Constructors
| Improve this Doc View SourceAttributeCollection()
Initializes a new instance of AttributeCollection with the specified collection of attributes.
Declaration
public AttributeCollection()
AttributeCollection(IEnumerable<Attribute>)
Initializes a new instance of AttributeCollection with the specified collection of attributes.
Declaration
public AttributeCollection(IEnumerable<Attribute> attributes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<Attribute> | attributes | The collection of attributes from which build the dictionary. |
Properties
| Improve this Doc View SourceCount
Gets the number of object contained in the collection.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
IsReadOnly
Gets a value indicating whether the collection is read-only.
Declaration
public static bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Item[Int32]
Gets the attribute at the specified index.
Declaration
public Attribute this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The zero-based index of the element to get or set. |
Property Value
| Type | Description |
|---|---|
| Attribute | The object at the specified index. |
Methods
| Improve this Doc View SourceAttributeWithTag(String)
Searches for the first occurrence attribute with the specified attribute definition tag within the entire collection
Declaration
public Attribute AttributeWithTag(string tag)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | tag |
Returns
| Type | Description |
|---|---|
| Attribute | The first occurrence of the attribute with the specified attribute definition tag within the entire collection. |
Contains(Attribute)
Determines whether an attribute is in the collection.
Declaration
public bool Contains(Attribute item)
Parameters
| Type | Name | Description |
|---|---|---|
| Attribute | item | The attribute to locate in the collection. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if attribute is found in the collection; otherwise, false. |
CopyTo(Attribute[], Int32)
Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.
Declaration
public void CopyTo(Attribute[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| Attribute[] | 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. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<Attribute> GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerator<Attribute> | An enumerator that can be used to iterate through the collection. |
IndexOf(Attribute)
Searches for the specified attribute and returns the zero-based index of the first occurrence within the entire collection.
Declaration
public int IndexOf(Attribute item)
Parameters
| Type | Name | Description |
|---|---|---|
| Attribute | item | The attribute 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. |
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.IEnumerator |