summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs')
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs
index f27cc95176..3e3324864d 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.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,33 +27,30 @@ namespace System.Runtime.InteropServices.WindowsRuntime
{
private VectorToListAdapter()
{
- Contract.Assert(false, "This class is never instantiated");
+ Debug.Assert(false, "This class is never instantiated");
}
// T this[int index] { get }
- [SecurityCritical]
internal T Indexer_Get<T>(int index)
{
if (index < 0)
- throw new ArgumentOutOfRangeException("index");
+ throw new ArgumentOutOfRangeException(nameof(index));
IVector<T> _this = JitHelpers.UnsafeCast<IVector<T>>(this);
return GetAt(_this, (uint)index);
}
// T this[int index] { set }
- [SecurityCritical]
internal void Indexer_Set<T>(int index, T value)
{
if (index < 0)
- throw new ArgumentOutOfRangeException("index");
+ throw new ArgumentOutOfRangeException(nameof(index));
IVector<T> _this = JitHelpers.UnsafeCast<IVector<T>>(this);
SetAt(_this, (uint)index, value);
}
// int IndexOf(T item)
- [SecurityCritical]
internal int IndexOf<T>(T item)
{
IVector<T> _this = JitHelpers.UnsafeCast<IVector<T>>(this);
@@ -72,22 +70,20 @@ namespace System.Runtime.InteropServices.WindowsRuntime
}
// void Insert(int index, T item)
- [SecurityCritical]
internal void Insert<T>(int index, T item)
{
if (index < 0)
- throw new ArgumentOutOfRangeException("index");
+ throw new ArgumentOutOfRangeException(nameof(index));
IVector<T> _this = JitHelpers.UnsafeCast<IVector<T>>(this);
InsertAtHelper<T>(_this, (uint)index, item);
}
// void RemoveAt(int index)
- [SecurityCritical]
internal void RemoveAt<T>(int index)
{
if (index < 0)
- throw new ArgumentOutOfRangeException("index");
+ throw new ArgumentOutOfRangeException(nameof(index));
IVector<T> _this = JitHelpers.UnsafeCast<IVector<T>>(this);
RemoveAtHelper<T>(_this, (uint)index);
@@ -107,7 +103,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
catch (Exception ex)
{
if (__HResults.E_BOUNDS == ex._HResult)
- throw new ArgumentOutOfRangeException("index");
+ throw new ArgumentOutOfRangeException(nameof(index));
throw;
}
@@ -125,7 +121,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
catch (Exception ex)
{
if (__HResults.E_BOUNDS == ex._HResult)
- throw new ArgumentOutOfRangeException("index");
+ throw new ArgumentOutOfRangeException(nameof(index));
throw;
}
@@ -143,7 +139,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
catch (Exception ex)
{
if (__HResults.E_BOUNDS == ex._HResult)
- throw new ArgumentOutOfRangeException("index");
+ throw new ArgumentOutOfRangeException(nameof(index));
throw;
}
@@ -161,7 +157,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
catch (Exception ex)
{
if (__HResults.E_BOUNDS == ex._HResult)
- throw new ArgumentOutOfRangeException("index");
+ throw new ArgumentOutOfRangeException(nameof(index));
throw;
}