YamlSequence
OfficeIMO.Yaml
A sequence node: block (- item) or flow ([a, b]), in source order.
Inheritance
- YamlNode
- YamlSequence
Usage
Explore 5 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 5
- Method YamlAlias.AsSequence
- Method YamlMapping.AsSequence
- Method YamlNode.AsSequence
- Method YamlScalar.AsSequence
- Method YamlSequence.AsSequence
Constructors
public YamlSequence() #Creates an empty block sequence. Inside a flow collection it is written as flow.
public YamlSequence(YamlStyle style) #Creates an empty sequence with a style: YamlStyle.Block or YamlStyle.Flow ([a, b]).
Parameters
- style OfficeIMO.Yaml.YamlStyle
Exceptions
ArgumentOutOfRangeException– style is not a collection style.
Methods
public YamlNode Add(YamlNode? item) #Adds an item at the end, in the layout and quoting of the other items.
Parameters
- item OfficeIMO.Yaml.YamlNode?
Exceptions
InvalidOperationException– item already belongs to a collection.
public Enumerator GetEnumerator() #Returns an enumerator over the items that does not allocate.
Returns
Enumeratorpublic YamlNode Insert(int index, YamlNode? item) #Inserts an item before the item at index, or at the end when it equals YamlSequence.Count.
Parameters
- index int
- item OfficeIMO.Yaml.YamlNode?
Exceptions
ArgumentOutOfRangeException– index is outside 0..YamlSequence.Count.
public void RemoveAt(int index) #Removes the item at a position together with the comment lines above it, its lines and its trailing comment.
Parameters
- index int
Exceptions
ArgumentOutOfRangeException– index is outside the sequence.InvalidOperationException– Aliases elsewhere refer to an anchor inside the item.
Inherited Methods
public YamlNode SetAnchor(string? name) #Parameters
- name string?
Returns
YamlNodepublic YamlNode SetComment(string? text) #Parameters
- text string?
Returns
YamlNodepublic YamlNode SetCommentBefore(string? text) #Parameters
- text string?
Returns
YamlNodepublic YamlNode SetSpaceBefore(bool value) #Parameters
- value bool
Returns
YamlNodeProperties
public YamlNode this[int index] { get; set; } #Gets the item at a zero-based index, or replaces it. Aliases are returned as YamlAlias nodes. A scalar set over a scalar updates it in place, keeping its anchor, tag, comments and, for an equal value, its text.
Parameters
- index int
Exceptions
ArgumentOutOfRangeException– index is outside the sequence.