C# Class System.Runtime.CompilerServices.ReadOnlyCollectionBuilder

Builder for read only collections.
Inheritance: IList, IList
Afficher le fichier Open project: mikedn/runtime Class Usage Examples

Private Properties

Свойство Type Description
EnsureCapacity void
ICollection void
IEnumerable IEnumerator
IList bool
IList int
IList void
IList void
IsCompatibleObject bool
ValidateNullValue void
this object?IList.System.Collections

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

Add() public méthode

Adds an item to the ReadOnlyCollectionBuilder{T}.
public Add ( item ) : void
item The object to add to the .
Résultat void

Clear() public méthode

Removes all items from the ReadOnlyCollectionBuilder{T}.
public Clear ( ) : void
Résultat void

Contains() public méthode

Determines whether the ReadOnlyCollectionBuilder{T} contains a specific value
public Contains ( item ) : bool
item the object to locate in the .
Résultat bool

CopyTo() public méthode

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.
Résultat void

GetEnumerator() public méthode

Returns an enumerator that iterates through the collection.
public GetEnumerator ( ) : IEnumerator
Résultat IEnumerator

IndexOf() public méthode

Returns the index of the first occurrence of a given value in the builder.
public IndexOf ( item ) : int
item An item to search for.
Résultat int

Insert() public méthode

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 .
Résultat void

ReadOnlyCollectionBuilder() public méthode

Constructs a ReadOnlyCollectionBuilder{T}.
public ReadOnlyCollectionBuilder ( ) : System.Collections
Résultat System.Collections

ReadOnlyCollectionBuilder() public méthode

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.
Résultat System.Collections

ReadOnlyCollectionBuilder() public méthode

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.
Résultat System.Collections

Remove() public méthode

Removes the first occurrence of a specific object from the ReadOnlyCollectionBuilder{T}.
public Remove ( item ) : bool
item The object to remove from the .
Résultat bool

RemoveAt() public méthode

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.
Résultat void

Reverse() public méthode

Reverses the order of the elements in the entire ReadOnlyCollectionBuilder{T}.
public Reverse ( ) : void
Résultat void

Reverse() public méthode

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.
Résultat void

ToArray() public méthode

Copies the elements of the ReadOnlyCollectionBuilder{T} to a new array.
public ToArray ( ) : T[]
Résultat T[]

ToReadOnlyCollection() public méthode

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
Résultat ReadOnlyCollection

this() public méthode

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.
Résultat T