ImmutableArray<T>.IImmutableList<T>.Replace Metoda

Definicja

Znajduje pierwszy element w tablicy równy określonej wartości i zastępuje wartość określoną nową wartością.

 virtual System::Collections::Immutable::IImmutableList<T> ^ System.Collections.Immutable.IImmutableList<T>.Replace(T oldValue, T newValue, System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer) = System::Collections::Immutable::IImmutableList<T>::Replace;
System.Collections.Immutable.IImmutableList<T> IImmutableList<T>.Replace (T oldValue, T newValue, System.Collections.Generic.IEqualityComparer<T> equalityComparer);
abstract member System.Collections.Immutable.IImmutableList<T>.Replace : 'T * 'T * System.Collections.Generic.IEqualityComparer<'T> -> System.Collections.Immutable.IImmutableList<'T>
override this.System.Collections.Immutable.IImmutableList<T>.Replace : 'T * 'T * System.Collections.Generic.IEqualityComparer<'T> -> System.Collections.Immutable.IImmutableList<'T>
Function Replace (oldValue As T, newValue As T, equalityComparer As IEqualityComparer(Of T)) As IImmutableList(Of T) Implements IImmutableList(Of T).Replace

Parametry

oldValue
T

Wartość do znalezienia i zastąpienia w tablicy.

newValue
T

Wartość, która ma zastąpić element wartością oldvalue .

equalityComparer
IEqualityComparer<T>

Porównujący równość służącą do porównywania wartości.

Zwraca

Nowa tablica zawierająca newValue nawet wtedy, gdy nowe i stare wartości są takie same.

Implementuje

Wyjątki

oldValue nie można odnaleźć w tablicy.

Uwagi

Ten element jest jawną implementacją członków. Można go używać tylko wtedy, gdy ImmutableArray<T> wystąpienie jest rzutowe do interfejsu IImmutableList<T> .

Dotyczy