Skip to main content

SnapshotNodeChildren Struct

Definition​

Assembly:Avalonia.Controls.Documents
Package:Avalonia.Controls.Documents

Lightweight view over a children array with an explicit count. Avoids copying when builder arrays are over-allocated.

public struct SnapshotNodeChildren

Inheritance: ValueType -> SnapshotNodeChildren

Implements: IEnumerable<SnapshotNode>, IReadOnlyCollection<SnapshotNode>, IReadOnlyList<SnapshotNode>, IEnumerable, IEquatable<SnapshotNodeChildren>

Constructors​

NameDescription
SnapshotNodeChildrenInitializes a view over items, of which the first count entries are children.

SnapshotNodeChildren Constructor​

Initializes a view over items, of which the first count entries are children.

public SnapshotNodeChildren(Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNode[] items, int count)

Parameters​

items Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNode[]

The backing array. Stored by reference, not copied.

count int

How many leading entries are in use.

Remarks​

The array is stored by reference, so a later write to it changes an object the rest of the surface presents as immutable. Building a snapshot tree goes through Avalonia.Controls.Documents.Serialization.Snapshot.DocumentSnapshotBuilder, which owns its arrays; Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNodeChildren.Empty is the only instance a caller outside the assembly needs to name.

Methods​

NameDescription
Equals (2 overloads)No summary available.
GetEnumeratorReturns a Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNodeChildren.Enumerator over this collection.
GetHashCodeNo summary available.

Equals overloads​

Equals Method​

public bool Equals(Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNodeChildren other)
Parameters​

other Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNodeChildren

Returns​

bool

Equals Method​

public bool Equals(object obj)
Parameters​

obj object

Returns​

bool

GetEnumerator Method​

Returns a Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNodeChildren.Enumerator over this collection.

public Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNodeChildren.Enumerator GetEnumerator()

Returns​

Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNodeChildren.Enumerator

GetHashCode Method​

public int GetHashCode()

Returns​

int

Properties​

NameDescription
CountNo summary available.
EmptyGets an empty Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNodeChildren instance.
ItemNo summary available.

Count Property​

public int Count { get; set; }

Empty Property​

Gets an empty Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNodeChildren instance.

public Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNodeChildren Empty { get; set; }

Item Property​

public Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNode Item { get; set; }