YamlArray Class
Definition
Represents a mutable YAML sequence node whose elements are YamlNode values.
public sealed class YamlArray : YamlNode, IList<YamlNode?>, ICollection<YamlNode?>, IEnumerable<YamlNode?>, IEnumerable
- Inheritance
-
YamlArray
- Implements
- Inherited Members
- Extension Methods
Constructors
YamlArray()
public YamlArray()
Properties
Count
Gets the number of elements in the sequence.
public int Count { get; }
Property Value
- int
The element count.
IsReadOnly
Gets a value indicating whether the sequence is read-only.
public bool IsReadOnly { get; }
Property Value
this[int]
Gets or sets the element at the specified index.
public override YamlNode? this[int index] { get; set; }
Parameters
indexintThe zero-based index.
Property Value
Methods
Add(YamlNode?)
Adds an element to the end of the sequence.
public void Add(YamlNode? item)
Parameters
itemYamlNodeThe element to add.
Clear()
Removes all elements from the sequence.
public void Clear()
Contains(YamlNode?)
Determines whether the sequence contains the specified element.
public bool Contains(YamlNode? item)
Parameters
itemYamlNodeThe element to locate.
Returns
CopyTo(YamlNode?[], int)
Copies the sequence elements to an array.
public void CopyTo(YamlNode?[] array, int arrayIndex)
Parameters
GetEnumerator()
Returns an enumerator over the elements.
public IEnumerator<YamlNode?> GetEnumerator()
Returns
- IEnumerator<YamlNode>
The element enumerator.
IndexOf(YamlNode?)
Returns the index of the specified element.
public int IndexOf(YamlNode? item)
Parameters
itemYamlNodeThe element to locate.
Returns
- int
The zero-based index, or
-1when not found.
Insert(int, YamlNode?)
Inserts an element at the specified index.
public void Insert(int index, YamlNode? item)
Parameters
Remove(YamlNode?)
Removes the first occurrence of the specified element.
public bool Remove(YamlNode? item)
Parameters
itemYamlNodeThe element to remove.
Returns
RemoveAt(int)
Removes the element at the specified index.
public void RemoveAt(int index)
Parameters
indexintThe zero-based index.
WriteTo(Utf8YamlWriter)
Writes this node to the given writer.
public override void WriteTo(Utf8YamlWriter writer)
Parameters
writerUtf8YamlWriterThe writer to emit into.
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
IEnumerator? IEnumerable.GetEnumerator()
Returns
- IEnumerator
An IEnumerator object that can be used to iterate through the collection.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |