diff options
Diffstat (limited to 'src/mscorlib/src/System/Collections/Generic/KeyValuePair.cs')
-rw-r--r-- | src/mscorlib/src/System/Collections/Generic/KeyValuePair.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mscorlib/src/System/Collections/Generic/KeyValuePair.cs b/src/mscorlib/src/System/Collections/Generic/KeyValuePair.cs index 17e1c531f1..ad9f7472aa 100644 --- a/src/mscorlib/src/System/Collections/Generic/KeyValuePair.cs +++ b/src/mscorlib/src/System/Collections/Generic/KeyValuePair.cs @@ -18,6 +18,16 @@ namespace System.Collections.Generic { using System; using System.Text; + // Provides the Create factory method for KeyValuePair<TKey, TValue>. + public static class KeyValuePair + { + // Creates a new KeyValuePair<TKey, TValue> from the given values. + public static KeyValuePair<TKey, TValue> Create<TKey, TValue>(TKey key, TValue value) + { + return new KeyValuePair<TKey, TValue>(key, value); + } + } + // A KeyValuePair holds a key and a value from a dictionary. // It is used by the IEnumerable<T> implementation for both IDictionary<TKey, TValue> // and IReadOnlyDictionary<TKey, TValue>. @@ -52,5 +62,12 @@ namespace System.Collections.Generic { s.Append(']'); return StringBuilderCache.GetStringAndRelease(s); } + + // BLOCKED (do not add now): [EditorBrowsable(EditorBrowsableState.Never)] + public void Deconstruct(out TKey key, out TValue value) + { + key = Key; + value = Value; + } } } |