Dictionary<TKey,TValue>.KeyCollection Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the Dictionary<TKey,TValue>.KeyCollection class that reflects the keys in the specified Dictionary<TKey,TValue>.
public:
KeyCollection(System::Collections::Generic::Dictionary<TKey, TValue> ^ dictionary);
public KeyCollection (System.Collections.Generic.Dictionary<TKey,TValue> dictionary);
new System.Collections.Generic.Dictionary<'Key, 'Value>.KeyCollection : System.Collections.Generic.Dictionary<'Key, 'Value> -> System.Collections.Generic.Dictionary<'Key, 'Value>.KeyCollection
Public Sub New (dictionary As Dictionary(Of TKey, TValue))
Parameters
- dictionary
- Dictionary<TKey,TValue>
The Dictionary<TKey,TValue> whose keys are reflected in the new Dictionary<TKey,TValue>.KeyCollection.
Exceptions
dictionary
is null
.
Remarks
The Dictionary<TKey,TValue>.KeyCollection is not a static copy; instead, the Dictionary<TKey,TValue>.KeyCollection refers back to the keys in the original Dictionary<TKey,TValue>. Therefore, changes to the Dictionary<TKey,TValue> continue to be reflected in the Dictionary<TKey,TValue>.KeyCollection.
This constructor is an O(1) operation.
Applies to
คำติชม
https://aka.ms/ContentUserFeedback
เร็วๆ นี้: ตลอดปี 2024 เราจะขจัดปัญหา GitHub เพื่อเป็นกลไกคำติชมสำหรับเนื้อหา และแทนที่ด้วยระบบคำติชมใหม่ สำหรับข้อมูลเพิ่มเติม ให้ดู:ส่งและดูข้อคิดเห็นสำหรับ