summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs')
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs
index a7424da3fb..e06364dcae 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs
@@ -114,7 +114,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
catch (Exception ex)
{
if (__HResults.E_BOUNDS == ex._HResult)
- throw new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound"));
+ throw new KeyNotFoundException(SR.Arg_KeyNotFound);
throw;
}
}
@@ -145,9 +145,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)
@@ -190,7 +190,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
throw new ArgumentNullException(nameof(dictionary));
this.dictionary = dictionary;
- this.enumeration = dictionary.GetEnumerator();
+ enumeration = dictionary.GetEnumerator();
}
void IDisposable.Dispose()
@@ -203,11 +203,13 @@ namespace System.Runtime.InteropServices.WindowsRuntime
return enumeration.MoveNext();
}
- Object IEnumerator.Current {
+ Object IEnumerator.Current
+ {
get { return ((IEnumerator<TKey>)this).Current; }
}
- public TKey Current {
+ public TKey Current
+ {
get { return enumeration.Current.Key; }
}
@@ -240,9 +242,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)
@@ -289,7 +291,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
throw new ArgumentNullException(nameof(dictionary));
this.dictionary = dictionary;
- this.enumeration = dictionary.GetEnumerator();
+ enumeration = dictionary.GetEnumerator();
}
void IDisposable.Dispose()
@@ -302,11 +304,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; }
}
@@ -315,5 +319,4 @@ namespace System.Runtime.InteropServices.WindowsRuntime
enumeration = dictionary.GetEnumerator();
}
} // class ReadOnlyDictionaryValueEnumerator<TKey, TValue>
-
}