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.cs29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs
index 3600a3ae70..a7424da3fb 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs
@@ -28,15 +28,14 @@ namespace System.Runtime.InteropServices.WindowsRuntime
{
private IMapViewToIReadOnlyDictionaryAdapter()
{
- Contract.Assert(false, "This class is never instantiated");
+ Debug.Assert(false, "This class is never instantiated");
}
// V this[K key] { get }
- [SecurityCritical]
internal V Indexer_Get<K, V>(K key)
{
if (key == null)
- throw new ArgumentNullException("key");
+ throw new ArgumentNullException(nameof(key));
Contract.EndContractBlock();
IMapView<K, V> _this = JitHelpers.UnsafeCast<IMapView<K, V>>(this);
@@ -44,7 +43,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
}
// IEnumerable<K> Keys { get }
- [SecurityCritical]
internal IEnumerable<K> Keys<K, V>()
{
IMapView<K, V> _this = JitHelpers.UnsafeCast<IMapView<K, V>>(this);
@@ -53,7 +51,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
}
// IEnumerable<V> Values { get }
- [SecurityCritical]
internal IEnumerable<V> Values<K, V>()
{
IMapView<K, V> _this = JitHelpers.UnsafeCast<IMapView<K, V>>(this);
@@ -63,22 +60,20 @@ namespace System.Runtime.InteropServices.WindowsRuntime
// bool ContainsKey(K key)
[Pure]
- [SecurityCritical]
internal bool ContainsKey<K, V>(K key)
{
if (key == null)
- throw new ArgumentNullException("key");
+ throw new ArgumentNullException(nameof(key));
IMapView<K, V> _this = JitHelpers.UnsafeCast<IMapView<K, V>>(this);
return _this.HasKey(key);
}
// bool TryGetValue(TKey key, out TValue value)
- [SecurityCritical]
internal bool TryGetValue<K, V>(K key, out V value)
{
if (key == null)
- throw new ArgumentNullException("key");
+ throw new ArgumentNullException(nameof(key));
IMapView<K, V> _this = JitHelpers.UnsafeCast<IMapView<K, V>>(this);
@@ -137,7 +132,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
public ReadOnlyDictionaryKeyCollection(IReadOnlyDictionary<TKey, TValue> dictionary)
{
if (dictionary == null)
- throw new ArgumentNullException("dictionary");
+ throw new ArgumentNullException(nameof(dictionary));
this.dictionary = dictionary;
}
@@ -146,9 +141,9 @@ namespace System.Runtime.InteropServices.WindowsRuntime
public void CopyTo(TKey[] array, int index)
{
if (array == null)
- throw new ArgumentNullException("array");
+ throw new ArgumentNullException(nameof(array));
if (index < 0)
- throw new ArgumentOutOfRangeException("index");
+ throw new ArgumentOutOfRangeException(nameof(index));
if (array.Length <= index && this.Count > 0)
throw new ArgumentException(Environment.GetResourceString("Arg_IndexOutOfRangeException"));
if (array.Length - index < dictionary.Count)
@@ -192,7 +187,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
public ReadOnlyDictionaryKeyEnumerator(IReadOnlyDictionary<TKey, TValue> dictionary)
{
if (dictionary == null)
- throw new ArgumentNullException("dictionary");
+ throw new ArgumentNullException(nameof(dictionary));
this.dictionary = dictionary;
this.enumeration = dictionary.GetEnumerator();
@@ -232,7 +227,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
public ReadOnlyDictionaryValueCollection(IReadOnlyDictionary<TKey, TValue> dictionary)
{
if (dictionary == null)
- throw new ArgumentNullException("dictionary");
+ throw new ArgumentNullException(nameof(dictionary));
this.dictionary = dictionary;
}
@@ -241,9 +236,9 @@ namespace System.Runtime.InteropServices.WindowsRuntime
public void CopyTo(TValue[] array, int index)
{
if (array == null)
- throw new ArgumentNullException("array");
+ throw new ArgumentNullException(nameof(array));
if (index < 0)
- throw new ArgumentOutOfRangeException("index");
+ throw new ArgumentOutOfRangeException(nameof(index));
if (array.Length <= index && this.Count > 0)
throw new ArgumentException(Environment.GetResourceString("Arg_IndexOutOfRangeException"));
if (array.Length - index < dictionary.Count)
@@ -291,7 +286,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
public ReadOnlyDictionaryValueEnumerator(IReadOnlyDictionary<TKey, TValue> dictionary)
{
if (dictionary == null)
- throw new ArgumentNullException("dictionary");
+ throw new ArgumentNullException(nameof(dictionary));
this.dictionary = dictionary;
this.enumeration = dictionary.GetEnumerator();