ImmutableSortedDictionary.ToImmutableSortedDictionary 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
ToImmutableSortedDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>)
枚舉一連串鍵值對,並產生不可變且排序的詞典。
public:
generic <typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableSortedDictionary<TKey, TValue> ^ ToImmutableSortedDictionary(System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ source);
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TKey,TValue>(this System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> source);
static member ToImmutableSortedDictionary : seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> -> System.Collections.Immutable.ImmutableSortedDictionary<'Key, 'Value>
<Extension()>
Public Function ToImmutableSortedDictionary(Of TKey, TValue) (source As IEnumerable(Of KeyValuePair(Of TKey, TValue))) As ImmutableSortedDictionary(Of TKey, TValue)
類型參數
- TKey
字典中索引鍵的類型。
- TValue
字典中值的型別。
參數
- source
- IEnumerable<KeyValuePair<TKey,TValue>>
要列舉的鍵值對序列。
傳回
一個不可變的排序字典,包含指定序列中的鍵值對。
適用於
ToImmutableSortedDictionary<TKey,TValue>(ImmutableSortedDictionary<TKey,TValue>.Builder)
從建構者字典的當前內容建立一個不可變的排序字典。
public:
generic <typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableSortedDictionary<TKey, TValue> ^ ToImmutableSortedDictionary(System::Collections::Immutable::ImmutableSortedDictionary<TKey, TValue>::Builder ^ builder);
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TKey,TValue>(this System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue>.Builder builder);
static member ToImmutableSortedDictionary : System.Collections.Immutable.ImmutableSortedDictionary<'Key, 'Value>.Builder -> System.Collections.Immutable.ImmutableSortedDictionary<'Key, 'Value>
<Extension()>
Public Function ToImmutableSortedDictionary(Of TKey, TValue) (builder As ImmutableSortedDictionary(Of TKey, TValue).Builder) As ImmutableSortedDictionary(Of TKey, TValue)
類型參數
- TKey
字典中索引鍵的類型。
- TValue
字典中值的型別。
參數
建立者用來建立不可變的排序字典。
傳回
一個不可變的排序字典,包含建構者字典中當前的內容。
適用於
ToImmutableSortedDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>, IComparer<TKey>)
透過指定的鍵比較器,列舉一串鍵值對,並產生不可變的字典。
public:
generic <typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableSortedDictionary<TKey, TValue> ^ ToImmutableSortedDictionary(System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ source, System::Collections::Generic::IComparer<TKey> ^ keyComparer);
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TKey,TValue>(this System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> source, System.Collections.Generic.IComparer<TKey> keyComparer);
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TKey,TValue>(this System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> source, System.Collections.Generic.IComparer<TKey>? keyComparer);
static member ToImmutableSortedDictionary : seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> * System.Collections.Generic.IComparer<'Key> -> System.Collections.Immutable.ImmutableSortedDictionary<'Key, 'Value>
<Extension()>
Public Function ToImmutableSortedDictionary(Of TKey, TValue) (source As IEnumerable(Of KeyValuePair(Of TKey, TValue)), keyComparer As IComparer(Of TKey)) As ImmutableSortedDictionary(Of TKey, TValue)
類型參數
- TKey
字典中索引鍵的類型。
- TValue
字典中值的型別。
參數
- source
- IEnumerable<KeyValuePair<TKey,TValue>>
要列舉的鍵值對序列。
- keyComparer
- IComparer<TKey>
建立不變字典時,最重要的比較工具。
傳回
一個不可變的排序字典,包含指定序列中的鍵值對。
適用於
ToImmutableSortedDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>, IComparer<TKey>, IEqualityComparer<TValue>)
透過指定的鍵值比較器,列舉一連串的鍵值對,並產生不可變的排序字典。
public:
generic <typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableSortedDictionary<TKey, TValue> ^ ToImmutableSortedDictionary(System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ source, System::Collections::Generic::IComparer<TKey> ^ keyComparer, System::Collections::Generic::IEqualityComparer<TValue> ^ valueComparer);
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TKey,TValue>(this System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> source, System.Collections.Generic.IComparer<TKey> keyComparer, System.Collections.Generic.IEqualityComparer<TValue> valueComparer);
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TKey,TValue>(this System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> source, System.Collections.Generic.IComparer<TKey>? keyComparer, System.Collections.Generic.IEqualityComparer<TValue>? valueComparer);
static member ToImmutableSortedDictionary : seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> * System.Collections.Generic.IComparer<'Key> * System.Collections.Generic.IEqualityComparer<'Value> -> System.Collections.Immutable.ImmutableSortedDictionary<'Key, 'Value>
<Extension()>
Public Function ToImmutableSortedDictionary(Of TKey, TValue) (source As IEnumerable(Of KeyValuePair(Of TKey, TValue)), keyComparer As IComparer(Of TKey), valueComparer As IEqualityComparer(Of TValue)) As ImmutableSortedDictionary(Of TKey, TValue)
類型參數
- TKey
字典中索引鍵的類型。
- TValue
字典中值的型別。
參數
- source
- IEnumerable<KeyValuePair<TKey,TValue>>
要列舉的鍵值對序列。
- keyComparer
- IComparer<TKey>
建立不變字典時,最重要的比較工具。
- valueComparer
- IEqualityComparer<TValue>
用於不可變字典的值比較器。
傳回
一個不可變的排序字典,包含指定序列中的鍵值對。
適用於
ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)
列舉和轉換序列,併產生其內容的不可變排序字典。
public:
generic <typename TSource, typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableSortedDictionary<TKey, TValue> ^ ToImmutableSortedDictionary(System::Collections::Generic::IEnumerable<TSource> ^ source, Func<TSource, TKey> ^ keySelector, Func<TSource, TValue> ^ elementSelector);
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TSource,TKey,TValue>(this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TValue> elementSelector);
static member ToImmutableSortedDictionary : seq<'Source> * Func<'Source, 'Key> * Func<'Source, 'Value> -> System.Collections.Immutable.ImmutableSortedDictionary<'Key, 'Value>
<Extension()>
Public Function ToImmutableSortedDictionary(Of TSource, TKey, TValue) (source As IEnumerable(Of TSource), keySelector As Func(Of TSource, TKey), elementSelector As Func(Of TSource, TValue)) As ImmutableSortedDictionary(Of TKey, TValue)
類型參數
- TSource
序列中元素的類型。
- TKey
結果字典中鍵的類型。
- TValue
結果字典中值的型別。
參數
- source
- IEnumerable<TSource>
序列要列舉以產生字典。
- keySelector
- Func<TSource,TKey>
這個函式會從每個序列元素產生字典的鍵。
- elementSelector
- Func<TSource,TValue>
這個函數會從每個序列元素產生字典的值。
傳回
一個不可變的排序字典,包含指定序列中的項目。
適用於
ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>)
列舉和轉換序列,並使用指定的索引鍵比較子產生其內容的不可變排序字典。
public:
generic <typename TSource, typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableSortedDictionary<TKey, TValue> ^ ToImmutableSortedDictionary(System::Collections::Generic::IEnumerable<TSource> ^ source, Func<TSource, TKey> ^ keySelector, Func<TSource, TValue> ^ elementSelector, System::Collections::Generic::IComparer<TKey> ^ keyComparer);
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TSource,TKey,TValue>(this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TValue> elementSelector, System.Collections.Generic.IComparer<TKey> keyComparer);
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TSource,TKey,TValue>(this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TValue> elementSelector, System.Collections.Generic.IComparer<TKey>? keyComparer);
static member ToImmutableSortedDictionary : seq<'Source> * Func<'Source, 'Key> * Func<'Source, 'Value> * System.Collections.Generic.IComparer<'Key> -> System.Collections.Immutable.ImmutableSortedDictionary<'Key, 'Value>
<Extension()>
Public Function ToImmutableSortedDictionary(Of TSource, TKey, TValue) (source As IEnumerable(Of TSource), keySelector As Func(Of TSource, TKey), elementSelector As Func(Of TSource, TValue), keyComparer As IComparer(Of TKey)) As ImmutableSortedDictionary(Of TKey, TValue)
類型參數
- TSource
序列中元素的類型。
- TKey
結果字典中鍵的類型。
- TValue
結果字典中值的型別。
參數
- source
- IEnumerable<TSource>
序列要列舉以產生字典。
- keySelector
- Func<TSource,TKey>
這個函式會從每個序列元素產生字典的鍵。
- elementSelector
- Func<TSource,TValue>
這個函數會從每個序列元素產生字典的值。
- keyComparer
- IComparer<TKey>
字典中的關鍵比較器。
傳回
一個不可變字典,包含指定序列中的項目。
適用於
ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>, IEqualityComparer<TValue>)
列舉和轉換序列,並使用指定的索引鍵和值比較子產生其內容的不可變排序字典。
public:
generic <typename TSource, typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableSortedDictionary<TKey, TValue> ^ ToImmutableSortedDictionary(System::Collections::Generic::IEnumerable<TSource> ^ source, Func<TSource, TKey> ^ keySelector, Func<TSource, TValue> ^ elementSelector, System::Collections::Generic::IComparer<TKey> ^ keyComparer, System::Collections::Generic::IEqualityComparer<TValue> ^ valueComparer);
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TSource,TKey,TValue>(this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TValue> elementSelector, System.Collections.Generic.IComparer<TKey> keyComparer, System.Collections.Generic.IEqualityComparer<TValue> valueComparer);
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TSource,TKey,TValue>(this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TValue> elementSelector, System.Collections.Generic.IComparer<TKey>? keyComparer, System.Collections.Generic.IEqualityComparer<TValue>? valueComparer);
static member ToImmutableSortedDictionary : seq<'Source> * Func<'Source, 'Key> * Func<'Source, 'Value> * System.Collections.Generic.IComparer<'Key> * System.Collections.Generic.IEqualityComparer<'Value> -> System.Collections.Immutable.ImmutableSortedDictionary<'Key, 'Value>
<Extension()>
Public Function ToImmutableSortedDictionary(Of TSource, TKey, TValue) (source As IEnumerable(Of TSource), keySelector As Func(Of TSource, TKey), elementSelector As Func(Of TSource, TValue), keyComparer As IComparer(Of TKey), valueComparer As IEqualityComparer(Of TValue)) As ImmutableSortedDictionary(Of TKey, TValue)
類型參數
- TSource
序列中元素的類型。
- TKey
結果字典中鍵的類型。
- TValue
結果字典中值的型別。
參數
- source
- IEnumerable<TSource>
序列要列舉以產生字典。
- keySelector
- Func<TSource,TKey>
這個函式會從每個序列元素產生字典的鍵。
- elementSelector
- Func<TSource,TValue>
這個函數會從每個序列元素產生字典的值。
- keyComparer
- IComparer<TKey>
字典中的關鍵比較器。
- valueComparer
- IEqualityComparer<TValue>
用於字典的價值比較器。
傳回
一個不可變的排序字典,包含指定序列中的項目。