CollectionExtensions.AsReadOnly Methode

Definitie

Overloads

Name Description
AsReadOnly<T>(IList<T>)

Retourneert een alleen-lezen ReadOnlyCollection<T> wrapper voor de opgegeven lijst.

AsReadOnly<T>(ISet<T>)

Retourneert een alleen-lezen ReadOnlySet<T> wrapper voor de opgegeven set.

AsReadOnly<TKey,TValue>(IDictionary<TKey,TValue>)

Retourneert een alleen-lezen ReadOnlyDictionary<TKey,TValue> wrapper voor de huidige woordenlijst.

AsReadOnly<T>(IList<T>)

Bron:
CollectionExtensions.cs
Bron:
CollectionExtensions.cs
Bron:
CollectionExtensions.cs
Bron:
CollectionExtensions.cs
Bron:
CollectionExtensions.cs

Retourneert een alleen-lezen ReadOnlyCollection<T> wrapper voor de opgegeven lijst.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::ObjectModel::ReadOnlyCollection<T> ^ AsReadOnly(System::Collections::Generic::IList<T> ^ list);
public static System.Collections.ObjectModel.ReadOnlyCollection<T> AsReadOnly<T>(this System.Collections.Generic.IList<T> list);
static member AsReadOnly : System.Collections.Generic.IList<'T> -> System.Collections.ObjectModel.ReadOnlyCollection<'T>
<Extension()>
Public Function AsReadOnly(Of T) (list As IList(Of T)) As ReadOnlyCollection(Of T)

Type parameters

T

Het type elementen in de verzameling.

Parameters

list
IList<T>

De lijst die moet worden verpakt.

Retouren

Een object dat fungeert als een alleen-lezen wrapper rond de huidige IList<T>.

Uitzonderingen

list is null.

Van toepassing op

AsReadOnly<T>(ISet<T>)

Bron:
CollectionExtensions.cs
Bron:
CollectionExtensions.cs

Retourneert een alleen-lezen ReadOnlySet<T> wrapper voor de opgegeven set.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::ObjectModel::ReadOnlySet<T> ^ AsReadOnly(System::Collections::Generic::ISet<T> ^ set);
public static System.Collections.ObjectModel.ReadOnlySet<T> AsReadOnly<T>(this System.Collections.Generic.ISet<T> set);
static member AsReadOnly : System.Collections.Generic.ISet<'T> -> System.Collections.ObjectModel.ReadOnlySet<'T>
<Extension()>
Public Function AsReadOnly(Of T) (set As ISet(Of T)) As ReadOnlySet(Of T)

Type parameters

T

Het type elementen in de set.

Parameters

set
ISet<T>

De set om te verpakken.

Retouren

Een object dat fungeert als een alleen-lezen wrapper rond de huidige ISet<T>.

Uitzonderingen

set is null.

Van toepassing op

AsReadOnly<TKey,TValue>(IDictionary<TKey,TValue>)

Bron:
CollectionExtensions.cs
Bron:
CollectionExtensions.cs
Bron:
CollectionExtensions.cs
Bron:
CollectionExtensions.cs
Bron:
CollectionExtensions.cs

Retourneert een alleen-lezen ReadOnlyDictionary<TKey,TValue> wrapper voor de huidige woordenlijst.

public:
generic <typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::ObjectModel::ReadOnlyDictionary<TKey, TValue> ^ AsReadOnly(System::Collections::Generic::IDictionary<TKey, TValue> ^ dictionary);
public static System.Collections.ObjectModel.ReadOnlyDictionary<TKey,TValue> AsReadOnly<TKey,TValue>(this System.Collections.Generic.IDictionary<TKey,TValue> dictionary);
static member AsReadOnly : System.Collections.Generic.IDictionary<'Key, 'Value> -> System.Collections.ObjectModel.ReadOnlyDictionary<'Key, 'Value>
<Extension()>
Public Function AsReadOnly(Of TKey, TValue) (dictionary As IDictionary(Of TKey, TValue)) As ReadOnlyDictionary(Of TKey, TValue)

Type parameters

TKey

Het type sleutels in de woordenlijst.

TValue

Het type waarden in de woordenlijst.

Parameters

dictionary
IDictionary<TKey,TValue>

De woordenlijst die moet worden verpakt.

Retouren

Een object dat fungeert als een alleen-lezen wrapper rond de huidige IDictionary<TKey,TValue>.

Uitzonderingen

dictionary is null.

Van toepassing op