ReadOnlyDictionary<TKey,TValue>(IDictionary<TKey,TValue>) 构造函数

定义

初始化 ReadOnlyDictionary<TKey,TValue> 类的新实例,该实例是指定字典周围的包装。Initializes a new instance of the ReadOnlyDictionary<TKey,TValue> class that is a wrapper around the specified dictionary.

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>

要包装的字典。The dictionary to wrap.

例外

dictionarynulldictionary is null.

适用于