<PackageReference Include="Google.Protobuf" Version="3.36.2" />

Google.Protobuf.Collections.RepeatedField<T>

The contents of a repeated field: essentially, a collection with some extra restrictions (no null values) and capabilities (deep cloning).
public int Capacity { get; set; }

Gets and sets the capacity of the RepeatedField's internal array. When set, the internal array is reallocated to the given capacity. The new value is less than Count.

public int Count { get; }

Gets the number of elements contained in the collection.

public bool IsReadOnly { get; }

Gets a value indicating whether the collection is read-only.

public T this[int index] { get; set; }

Gets or sets the item at the specified index.

public RepeatedField()

public void Add(T item)

Adds the specified item to the collection.

public void Add(IEnumerable<T> values)

Adds all of the specified values into this collection. This method is present to allow repeated fields to be constructed from queries within collection initializers. Within non-collection-initializer code, consider using the equivalent AddRange method instead for clarity.

public void AddEntriesFrom(CodedInputStream input, FieldCodec<T> codec)

Adds the entries from the given input stream, decoding them with the specified codec.

public void AddEntriesFrom(ref ParseContext ctx, FieldCodec<T> codec)

Adds the entries from the given parse context, decoding them with the specified codec.

public void AddRange(IEnumerable<T> values)

Adds all of the specified values into this collection.

public int CalculateSize(FieldCodec<T> codec)

Calculates the size of this collection based on the given codec.

public void Clear()

Removes all items from the collection.

public RepeatedField<T> Clone()

Creates a deep clone of this repeated field.

public bool Contains(T item)

Determines whether this collection contains the given item.

public void CopyTo(T[] array, int arrayIndex)

Copies this collection to the given array.

public bool Equals(RepeatedField<T> other)

Compares this repeated field with another for equality.

Returns an enumerator that iterates through the collection.

public int IndexOf(T item)

Returns the index of the given item within the collection, or -1 if the item is not present.

public void Insert(int index, T item)

Inserts the given item at the specified index.

public bool Remove(T item)

Removes the specified item from the collection

public void RemoveAt(int index)

Removes the item at the given index.

public void WriteTo(CodedOutputStream output, FieldCodec<T> codec)

Writes the contents of this collection to the given CodedOutputStream, encoding each value using the specified codec.

public void WriteTo(ref WriteContext ctx, FieldCodec<T> codec)

Writes the contents of this collection to the given write context, encoding each value using the specified codec.