Wintellect.PowerCollections Namespace
Algorithms Class
Algorithms Methods
GhostDoc Pro Sample Help File

Algorithms..::..ReadOnly<(Of <(<'TKey, TValue>)>)> Method (IDictionary<(Of <(<'TKey, TValue>)>)>)

Returns a read-only view onto a dictionary. The returned IDictionary<TKey,TValue> interface only allows operations that do not change the dictionary. The IsReadOnly property returns true, indicating that the dictionary is read-only. All other methods on the interface throw a NotSupportedException.

Namespace:  Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax


public static IDictionary<TKey, TValue> ReadOnly<TKey, TValue>(
	IDictionary<TKey, TValue> dictionary
)
Public Shared Function ReadOnly(Of TKey, TValue) ( _
	dictionary As IDictionary(Of TKey, TValue) _
) As IDictionary(Of TKey, TValue)
public:
generic<typename TKey, typename TValue>
static IDictionary<TKey, TValue>^ ReadOnly(
	IDictionary<TKey, TValue>^ dictionary
)

Type Parameters

TKey
TValue

Parameters

dictionary
Type: IDictionary<(Of <(<'TKey, TValue>)>)>
The dictionary to wrap.

Return Value

A read-only view onto dictionary. Returns null if dictionary is null. If dictionary is already read-only, returns dictionary.

Remarks


The data in the underlying dictionary is not copied. If the underlying dictionary is changed, then the read-only view also changes accordingly.