Table of Contents

YamlArray Class

Definition

Namespace
Bodu.Text.Yaml.Nodes
Assembly
Bodu.Text.Yaml.dll
Package
Bodu.Text.Yaml 1.0.0
Source
YamlArray.cs

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

bool

Always false.

this[int]

Gets or sets the element at the specified index.

public override YamlNode? this[int index] { get; set; }

Parameters

index int

The zero-based index.

Property Value

YamlNode

The element node, or null.

Methods

Add(YamlNode?)

Adds an element to the end of the sequence.

public void Add(YamlNode? item)

Parameters

item YamlNode

The 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

item YamlNode

The element to locate.

Returns

bool

true when the element is present.

CopyTo(YamlNode?[], int)

Copies the sequence elements to an array.

public void CopyTo(YamlNode?[] array, int arrayIndex)

Parameters

array YamlNode[]

The destination array.

arrayIndex int

The starting index in the destination.

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

item YamlNode

The element to locate.

Returns

int

The zero-based index, or -1 when not found.

Insert(int, YamlNode?)

Inserts an element at the specified index.

public void Insert(int index, YamlNode? item)

Parameters

index int

The zero-based index.

item YamlNode

The element to insert.

Remove(YamlNode?)

Removes the first occurrence of the specified element.

public bool Remove(YamlNode? item)

Parameters

item YamlNode

The element to remove.

Returns

bool

true when an element was removed.

RemoveAt(int)

Removes the element at the specified index.

public void RemoveAt(int index)

Parameters

index int

The zero-based index.

WriteTo(Utf8YamlWriter)

Writes this node to the given writer.

public override void WriteTo(Utf8YamlWriter writer)

Parameters

writer Utf8YamlWriter

The 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

ProductVersions
.NET8, 10