語言

ReadOnlyDictionary<TKey,TValue>(IDictionary<TKey,TValue>) 建構函式

定義

初始化一個新的類別實例 ReadOnlyDictionary<TKey,TValue> ,該類別是指定字典的包裝器。

public:
 ReadOnlyDictionary(System::Collections::Generic::IDictionary<TKey, TValue> ^ dictionary);
public ReadOnlyDictionary(System.Collections.Generic.IDictionary<TKey,TValue> dictionary);
new System.Collections.ObjectModel.ReadOnlyDictionary<'Key, 'Value> : System.Collections.Generic.IDictionary<'Key, 'Value> -> System.Collections.ObjectModel.ReadOnlyDictionary<'Key, 'Value>
Public Sub New (dictionary As IDictionary(Of TKey, TValue))

參數

dictionary
IDictionary<TKey,TValue>

字典要包起來。

例外狀況

dictionary 是 null。

適用於