Table of Contents

BencodeElement.ArrayEnumerator Struct

Definition

Namespace
Bodu.Text.Bencode.Document
Assembly
Bodu.Text.Bencode.dll
Package
Bodu.Text.Bencode 1.0.0
Source
BencodeElement.ArrayEnumerator.cs

Enumerates the elements of an array BencodeElement in order.

public struct BencodeElement.ArrayEnumerator : IEnumerable<BencodeElement>, IEnumerable, IEnumerator<BencodeElement>, IEnumerator, IDisposable
Implements
Inherited Members
Extension Methods

Remarks

The enumerator walks the array's contiguous subtree rows, advancing past each element's whole subtree so that iteration costs one hop per element regardless of element complexity. It is a mutable struct; avoid copying it once enumeration has begun.

Properties

Current

Gets the element at the enumerator's current position.

public readonly BencodeElement Current { get; }

Property Value

BencodeElement

The current element.

Methods

Dispose()

Releases the resources used by the enumerator. This enumerator holds no resources to release.

public readonly void Dispose()

GetEnumerator()

Returns this enumerator, enabling foreach over the array.

public readonly BencodeElement.ArrayEnumerator GetEnumerator()

Returns

BencodeElement.ArrayEnumerator

This enumerator positioned before the first element.

MoveNext()

Advances the enumerator to the next element of the array.

public bool MoveNext()

Returns

bool

true when the enumerator advanced to a further element; false when the end of the array was reached.

Reset()

Resets the enumerator to its initial position, before the first element.

public void Reset()

Explicit Interface Implementations

IEnumerable<BencodeElement>.GetEnumerator()

Returns this enumerator, enabling foreach over the array.

readonly IEnumerator<BencodeElement> IEnumerable<BencodeElement>.GetEnumerator()

Returns

IEnumerator<BencodeElement>

This enumerator positioned before the first element.

IEnumerable.GetEnumerator()

Returns this enumerator, enabling foreach over the array.

readonly IEnumerator IEnumerable.GetEnumerator()

Returns

IEnumerator

This enumerator positioned before the first element.

IEnumerator.Current

Gets the element at the enumerator's current position.

readonly object IEnumerator.Current { get; }

Returns

object

The current element, boxed.

Applies to

ProductVersions
.NET8, 10