CollectionExtensions.AsReadOnly 메서드

정의

오버로드

AsReadOnly<T>(IList<T>)

지정된 목록에 대한 읽기 전용 ReadOnlyCollection<T> 래퍼를 반환합니다.

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

현재 사전에 대한 읽기 전용 ReadOnlyDictionary<TKey,TValue> 래퍼를 반환합니다.

AsReadOnly<T>(IList<T>)

Source:
CollectionExtensions.cs
Source:
CollectionExtensions.cs
Source:
CollectionExtensions.cs

지정된 목록에 대한 읽기 전용 ReadOnlyCollection<T> 래퍼를 반환합니다.

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)

형식 매개 변수

T

컬렉션에 있는 요소의 형식입니다.

매개 변수

list
IList<T>

래핑할 목록입니다.

반환

현재 IList<T>에 대한 읽기 전용 래퍼 역할을 하는 개체입니다.

예외

list이(가) null인 경우

적용 대상

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

Source:
CollectionExtensions.cs
Source:
CollectionExtensions.cs
Source:
CollectionExtensions.cs

현재 사전에 대한 읽기 전용 ReadOnlyDictionary<TKey,TValue> 래퍼를 반환합니다.

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)

형식 매개 변수

TKey

사전의 키 형식입니다.

TValue

사전의 값 형식입니다.

매개 변수

dictionary
IDictionary<TKey,TValue>

래핑할 사전입니다.

반환

현재 IDictionary<TKey,TValue>에 대한 읽기 전용 래퍼 역할을 하는 개체입니다.

예외

dictionary이(가) null인 경우

적용 대상