C# Класс System.Runtime.CompilerServices.ReadOnlyCollectionBuilder

Builder for read only collections.
Наследование: IList, IList
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
EnsureCapacity void
ICollection void
IEnumerable IEnumerator
IList bool
IList int
IList void
IList void
IsCompatibleObject bool
ValidateNullValue void
this object?IList.System.Collections

Открытые методы

Метод Описание
Add ( item ) : void

Adds an item to the ReadOnlyCollectionBuilder{T}.

Clear ( ) : void

Removes all items from the ReadOnlyCollectionBuilder{T}.

Contains ( item ) : bool

Determines whether the ReadOnlyCollectionBuilder{T} contains a specific value

CopyTo ( Array array, int arrayIndex ) : void

Copies the elements of the ReadOnlyCollectionBuilder{T} to an Array, starting at particular Array index.

GetEnumerator ( ) : IEnumerator

Returns an enumerator that iterates through the collection.

IndexOf ( item ) : int

Returns the index of the first occurrence of a given value in the builder.

Insert ( int index, item ) : void

Inserts an item to the ReadOnlyCollectionBuilder{T} at the specified index.

ReadOnlyCollectionBuilder ( ) : System.Collections

Constructs a ReadOnlyCollectionBuilder{T}.

ReadOnlyCollectionBuilder ( IEnumerable collection ) : System.Collections

Constructs a ReadOnlyCollectionBuilder{T}, copying contents of the given collection.

ReadOnlyCollectionBuilder ( int capacity ) : System.Collections

Constructs a ReadOnlyCollectionBuilder{T} with a given initial capacity. The contents are empty but builder will have reserved room for the given number of elements before any reallocations are required.

Remove ( item ) : bool

Removes the first occurrence of a specific object from the ReadOnlyCollectionBuilder{T}.

RemoveAt ( int index ) : void

Removes the ReadOnlyCollectionBuilder{T} item at the specified index.

Reverse ( ) : void

Reverses the order of the elements in the entire ReadOnlyCollectionBuilder{T}.

Reverse ( int index, int count ) : void

Reverses the order of the elements in the specified range.

ToArray ( ) : T[]

Copies the elements of the ReadOnlyCollectionBuilder{T} to a new array.

ToReadOnlyCollection ( ) : ReadOnlyCollection

Creates a ReadOnlyCollection{T} containing all of the elements of the ReadOnlyCollectionBuilder{T}, avoiding copying the elements to the new array if possible. Resets the ReadOnlyCollectionBuilder{T} after the ReadOnlyCollection{T} has been created.

this ( int index ) : T

Gets or sets the element at the specified index.

Приватные методы

Метод Описание
EnsureCapacity ( int min ) : void
ICollection ( Array array, int index ) : void
IEnumerable ( ) : IEnumerator
IList ( object? value ) : bool
IList ( object? value ) : int
IList ( int index, object? value ) : void
IList ( object? value ) : void
IsCompatibleObject ( object? value ) : bool
ValidateNullValue ( object? value, string argument ) : void
this ( int index ) : object?IList.System.Collections

Описание методов

Add() публичный Метод

Adds an item to the ReadOnlyCollectionBuilder{T}.
public Add ( item ) : void
item The object to add to the .
Результат void

Clear() публичный Метод

Removes all items from the ReadOnlyCollectionBuilder{T}.
public Clear ( ) : void
Результат void

Contains() публичный Метод

Determines whether the ReadOnlyCollectionBuilder{T} contains a specific value
public Contains ( item ) : bool
item the object to locate in the .
Результат bool

CopyTo() публичный Метод

Copies the elements of the ReadOnlyCollectionBuilder{T} to an Array, starting at particular Array index.
public CopyTo ( Array array, int arrayIndex ) : void
array Array The one-dimensional that is the destination of the elements copied from .
arrayIndex int The zero-based index in array at which copying begins.
Результат void

GetEnumerator() публичный Метод

Returns an enumerator that iterates through the collection.
public GetEnumerator ( ) : IEnumerator
Результат IEnumerator

IndexOf() публичный Метод

Returns the index of the first occurrence of a given value in the builder.
public IndexOf ( item ) : int
item An item to search for.
Результат int

Insert() публичный Метод

Inserts an item to the ReadOnlyCollectionBuilder{T} at the specified index.
public Insert ( int index, item ) : void
index int The zero-based index at which item should be inserted.
item The object to insert into the .
Результат void

ReadOnlyCollectionBuilder() публичный Метод

Constructs a ReadOnlyCollectionBuilder{T}.
public ReadOnlyCollectionBuilder ( ) : System.Collections
Результат System.Collections

ReadOnlyCollectionBuilder() публичный Метод

Constructs a ReadOnlyCollectionBuilder{T}, copying contents of the given collection.
public ReadOnlyCollectionBuilder ( IEnumerable collection ) : System.Collections
collection IEnumerable The collection whose elements to copy to the builder.
Результат System.Collections

ReadOnlyCollectionBuilder() публичный Метод

Constructs a ReadOnlyCollectionBuilder{T} with a given initial capacity. The contents are empty but builder will have reserved room for the given number of elements before any reallocations are required.
public ReadOnlyCollectionBuilder ( int capacity ) : System.Collections
capacity int Initial capacity of the builder.
Результат System.Collections

Remove() публичный Метод

Removes the first occurrence of a specific object from the ReadOnlyCollectionBuilder{T}.
public Remove ( item ) : bool
item The object to remove from the .
Результат bool

RemoveAt() публичный Метод

Removes the ReadOnlyCollectionBuilder{T} item at the specified index.
public RemoveAt ( int index ) : void
index int The zero-based index of the item to remove.
Результат void

Reverse() публичный Метод

Reverses the order of the elements in the entire ReadOnlyCollectionBuilder{T}.
public Reverse ( ) : void
Результат void

Reverse() публичный Метод

Reverses the order of the elements in the specified range.
public Reverse ( int index, int count ) : void
index int The zero-based starting index of the range to reverse.
count int The number of elements in the range to reverse.
Результат void

ToArray() публичный Метод

Copies the elements of the ReadOnlyCollectionBuilder{T} to a new array.
public ToArray ( ) : T[]
Результат T[]

ToReadOnlyCollection() публичный Метод

Creates a ReadOnlyCollection{T} containing all of the elements of the ReadOnlyCollectionBuilder{T}, avoiding copying the elements to the new array if possible. Resets the ReadOnlyCollectionBuilder{T} after the ReadOnlyCollection{T} has been created.
public ToReadOnlyCollection ( ) : ReadOnlyCollection
Результат ReadOnlyCollection

this() публичный Метод

Gets or sets the element at the specified index.
public this ( int index ) : T
index int The zero-based index of the element to get or set.
Результат T