diff options
Diffstat (limited to 'src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs')
-rw-r--r-- | src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs index fcc7755d67..083b0ffcb1 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs @@ -11,7 +11,8 @@ using System.Runtime.InteropServices; using System.Runtime.InteropServices.WindowsRuntime; -namespace System.Runtime.InteropServices.WindowsRuntime { +namespace System.Runtime.InteropServices.WindowsRuntime +{ [Serializable] [DebuggerDisplay("Count = {Count}")] internal sealed class DictionaryValueCollection<TKey, TValue> : ICollection<TValue> @@ -33,9 +34,9 @@ namespace System.Runtime.InteropServices.WindowsRuntime { if (index < 0) throw new ArgumentOutOfRangeException(nameof(index)); if (array.Length <= index && this.Count > 0) - throw new ArgumentException(Environment.GetResourceString("Arg_IndexOutOfRangeException")); + throw new ArgumentException(SR.Arg_IndexOutOfRangeException); if (array.Length - index < dictionary.Count) - throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection")); + throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection); int i = index; foreach (KeyValuePair<TKey, TValue> mapping in dictionary) @@ -44,22 +45,24 @@ namespace System.Runtime.InteropServices.WindowsRuntime { } } - public int Count { + public int Count + { get { return dictionary.Count; } } - bool ICollection<TValue>.IsReadOnly { + bool ICollection<TValue>.IsReadOnly + { get { return true; } } void ICollection<TValue>.Add(TValue item) { - throw new NotSupportedException(Environment.GetResourceString("NotSupported_ValueCollectionSet")); + throw new NotSupportedException(SR.NotSupported_ValueCollectionSet); } void ICollection<TValue>.Clear() { - throw new NotSupportedException(Environment.GetResourceString("NotSupported_ValueCollectionSet")); + throw new NotSupportedException(SR.NotSupported_ValueCollectionSet); } public bool Contains(TValue item) @@ -73,7 +76,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { bool ICollection<TValue>.Remove(TValue item) { - throw new NotSupportedException(Environment.GetResourceString("NotSupported_ValueCollectionSet")); + throw new NotSupportedException(SR.NotSupported_ValueCollectionSet); } IEnumerator IEnumerable.GetEnumerator() @@ -100,7 +103,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { throw new ArgumentNullException(nameof(dictionary)); this.dictionary = dictionary; - this.enumeration = dictionary.GetEnumerator(); + enumeration = dictionary.GetEnumerator(); } void IDisposable.Dispose() @@ -113,11 +116,13 @@ namespace System.Runtime.InteropServices.WindowsRuntime { return enumeration.MoveNext(); } - Object IEnumerator.Current { + Object IEnumerator.Current + { get { return ((IEnumerator<TValue>)this).Current; } } - public TValue Current { + public TValue Current + { get { return enumeration.Current.Value; } } |