diff options
Diffstat (limited to 'src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs')
-rw-r--r-- | src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs index d7897ced9f..981972ca9f 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs @@ -8,6 +8,7 @@ using System; using System.Security; using System.Collections; using System.Collections.Generic; +using System.Diagnostics; using System.Diagnostics.Contracts; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; @@ -26,15 +27,14 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private MapToDictionaryAdapter() { - 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(); @@ -43,11 +43,10 @@ namespace System.Runtime.InteropServices.WindowsRuntime } // V this[K key] { set } - [SecurityCritical] internal void Indexer_Set<K, V>(K key, V value) { if (key == null) - throw new ArgumentNullException("key"); + throw new ArgumentNullException(nameof(key)); Contract.EndContractBlock(); @@ -56,7 +55,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime } // ICollection<K> Keys { get } - [SecurityCritical] internal ICollection<K> Keys<K, V>() { IMap<K, V> _this = JitHelpers.UnsafeCast<IMap<K, V>>(this); @@ -65,7 +63,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime } // ICollection<V> Values { get } - [SecurityCritical] internal ICollection<V> Values<K, V>() { IMap<K, V> _this = JitHelpers.UnsafeCast<IMap<K, V>>(this); @@ -75,22 +72,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)); IMap<K, V> _this = JitHelpers.UnsafeCast<IMap<K, V>>(this); return _this.HasKey(key); } // void Add(K key, V value) - [SecurityCritical] internal void Add<K, V>(K key, V value) { if (key == null) - throw new ArgumentNullException("key"); + throw new ArgumentNullException(nameof(key)); if (ContainsKey<K, V>(key)) throw new ArgumentException(Environment.GetResourceString("Argument_AddingDuplicate")); @@ -102,11 +97,10 @@ namespace System.Runtime.InteropServices.WindowsRuntime } // bool Remove(TKey key) - [SecurityCritical] internal bool Remove<K, V>(K key) { if (key == null) - throw new ArgumentNullException("key"); + throw new ArgumentNullException(nameof(key)); IMap<K, V> _this = JitHelpers.UnsafeCast<IMap<K, V>>(this); if (!_this.HasKey(key)) @@ -128,11 +122,10 @@ namespace System.Runtime.InteropServices.WindowsRuntime } // 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)); IMap<K, V> _this = JitHelpers.UnsafeCast<IMap<K, V>>(this); if (!_this.HasKey(key)) |