=========================================================================*/
public BitArray(int length, bool defaultValue) {
if (length < 0) {
- throw new ArgumentOutOfRangeException("length", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
}
Contract.EndContractBlock();
=========================================================================*/
public BitArray(byte[] bytes) {
if (bytes == null) {
- throw new ArgumentNullException("bytes");
+ throw new ArgumentNullException(nameof(bytes));
}
Contract.EndContractBlock();
// this value is chosen to prevent overflow when computing m_length.
// m_length is of type int32 and is exposed as a property, so
// type of m_length can't be changed to accommodate.
if (bytes.Length > Int32.MaxValue / BitsPerByte) {
- throw new ArgumentException(Environment.GetResourceString("Argument_ArrayTooLarge", BitsPerByte), "bytes");
+ throw new ArgumentException(Environment.GetResourceString("Argument_ArrayTooLarge", BitsPerByte), nameof(bytes));
}
m_array = new int[GetArrayLength(bytes.Length, BytesPerInt32)];
public BitArray(bool[] values) {
if (values == null) {
- throw new ArgumentNullException("values");
+ throw new ArgumentNullException(nameof(values));
}
Contract.EndContractBlock();
=========================================================================*/
public BitArray(int[] values) {
if (values == null) {
- throw new ArgumentNullException("values");
+ throw new ArgumentNullException(nameof(values));
}
Contract.EndContractBlock();
// this value is chosen to prevent overflow when computing m_length
if (values.Length > Int32.MaxValue / BitsPerInt32) {
- throw new ArgumentException(Environment.GetResourceString("Argument_ArrayTooLarge", BitsPerInt32), "values");
+ throw new ArgumentException(Environment.GetResourceString("Argument_ArrayTooLarge", BitsPerInt32), nameof(values));
}
m_array = new int[values.Length];
=========================================================================*/
public BitArray(BitArray bits) {
if (bits == null) {
- throw new ArgumentNullException("bits");
+ throw new ArgumentNullException(nameof(bits));
}
Contract.EndContractBlock();
=========================================================================*/
public bool Get(int index) {
if (index < 0 || index >= Length) {
- throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
}
Contract.EndContractBlock();
=========================================================================*/
public void Set(int index, bool value) {
if (index < 0 || index >= Length) {
- throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
}
Contract.EndContractBlock();
=========================================================================*/
public BitArray And(BitArray value) {
if (value==null)
- throw new ArgumentNullException("value");
+ throw new ArgumentNullException(nameof(value));
if (Length != value.Length)
throw new ArgumentException(Environment.GetResourceString("Arg_ArrayLengthsDiffer"));
Contract.EndContractBlock();
=========================================================================*/
public BitArray Or(BitArray value) {
if (value==null)
- throw new ArgumentNullException("value");
+ throw new ArgumentNullException(nameof(value));
if (Length != value.Length)
throw new ArgumentException(Environment.GetResourceString("Arg_ArrayLengthsDiffer"));
Contract.EndContractBlock();
=========================================================================*/
public BitArray Xor(BitArray value) {
if (value==null)
- throw new ArgumentNullException("value");
+ throw new ArgumentNullException(nameof(value));
if (Length != value.Length)
throw new ArgumentException(Environment.GetResourceString("Arg_ArrayLengthsDiffer"));
Contract.EndContractBlock();
}
set {
if (value < 0) {
- throw new ArgumentOutOfRangeException("value", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
}
Contract.EndContractBlock();
public void CopyTo(Array array, int index)
{
if (array == null)
- throw new ArgumentNullException("array");
+ throw new ArgumentNullException(nameof(array));
if (index < 0)
- throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
if (array.Rank != 1)
throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));