diff --git a/source/nanoFramework.CoreLibrary/System/AppDomain.cs b/source/nanoFramework.CoreLibrary/System/AppDomain.cs
index ae7d3044..9554545c 100644
--- a/source/nanoFramework.CoreLibrary/System/AppDomain.cs
+++ b/source/nanoFramework.CoreLibrary/System/AppDomain.cs
@@ -31,7 +31,9 @@ public sealed class AppDomain : MarshalByRefObject
private AppDomain()
{
+#pragma warning disable S112 // General exceptions should never be thrown
throw new Exception();
+#pragma warning restore S112 // General exceptions should never be thrown
}
///
@@ -40,7 +42,9 @@ private AppDomain()
/// The friendly name of the domain.
/// The newly created application domain.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern AppDomain CreateDomain(String friendlyName);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Creates a new instance of the specified type. Parameters specify the assembly where the type is defined, and the name of the type.
@@ -106,7 +110,9 @@ public Assembly Load(String assemblyString)
///
/// An array of assemblies in this application domain.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern Assembly[] GetAssemblies();
+#pragma warning restore S4200 // Native methods should be wrapped
[MethodImpl(MethodImplOptions.InternalCall)]
private extern Assembly LoadInternal(String assemblyString, bool fVersion, int maj, int min, int build, int rev);
@@ -116,7 +122,9 @@ public Assembly Load(String assemblyString)
///
/// An application domain to unload.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern void Unload(AppDomain domain);
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
#endif // #if (NANOCLR_APPDOMAINS)
diff --git a/source/nanoFramework.CoreLibrary/System/Array.cs b/source/nanoFramework.CoreLibrary/System/Array.cs
index b18df2cc..2dfbfb63 100644
--- a/source/nanoFramework.CoreLibrary/System/Array.cs
+++ b/source/nanoFramework.CoreLibrary/System/Array.cs
@@ -26,8 +26,11 @@ public abstract class Array : ICloneable, IList
/// Reference-type elements are initialized to nullNothingnullptrunit a null reference(Nothing in Visual Basic). Value-type elements are initialized to zero.
/// This method is an O(n) operation, where n is length.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern Array CreateInstance(Type elementType, int length);
+#pragma warning restore S4200 // Native methods should be wrapped
+#pragma warning disable S4200 // Native methods should be wrapped
///
/// Copies a range of elements from an Array starting at the first element and pastes them into another Array starting at the first element. The length is specified as a 32-bit integer.
///
@@ -35,6 +38,7 @@ public abstract class Array : ICloneable, IList
/// The Array that receives the data.
/// A 32-bit integer that represents the number of elements to copy.
public static void Copy(Array sourceArray, Array destinationArray, int length)
+#pragma warning restore S4200 // Native methods should be wrapped
{
Copy(sourceArray, 0, destinationArray, 0, length);
}
@@ -48,7 +52,9 @@ public static void Copy(Array sourceArray, Array destinationArray, int length)
/// A 32-bit integer that represents the index in the destinationArray at which storing begins.
/// A 32-bit integer that represents the number of elements to copy.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern void Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Sets a range of elements in the Array to zero, to false, or to null reference (Nothing in Visual Basic), depending on the element type.
@@ -57,7 +63,9 @@ public static void Copy(Array sourceArray, Array destinationArray, int length)
/// The starting index of the range of elements to clear.
/// The number of elements to clear.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern void Clear(Array array, int index, int length);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Gets the value at the specified position in the one-dimensional Array. The index is specified as a 32-bit integer.
diff --git a/source/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs b/source/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs
index 332c5b29..65add0bc 100644
--- a/source/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs
+++ b/source/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs
@@ -36,21 +36,25 @@ public AttributeTargets ValidOn
get { return _attributeTarget; }
}
+#pragma warning disable S2292 // Trivial properties should be auto-implemented
///
/// Gets or sets a Boolean value indicating whether more than one instance of the indicated attribute can be specified for a single program element.
///
/// true if more than one instance is allowed to be specified; otherwise, false. The default is false.
public bool AllowMultiple
+#pragma warning restore S2292 // Trivial properties should be auto-implemented
{
get { return _allowMultipleAttributes; }
set { _allowMultipleAttributes = value; }
}
+#pragma warning disable S2292 // Trivial properties should be auto-implemented
///
/// Gets or sets a Boolean value that determines whether the indicated attribute is inherited by derived classes and overriding members.
///
/// true if the attribute can be inherited by derived classes and overriding members; otherwise, false. The default is true.
public bool Inherited
+#pragma warning restore S2292 // Trivial properties should be auto-implemented
{
get { return _iInheritedAttribute; }
set { _iInheritedAttribute = value; }
diff --git a/source/nanoFramework.CoreLibrary/System/BitConverter.cs b/source/nanoFramework.CoreLibrary/System/BitConverter.cs
index 506abfe8..4f25791b 100644
--- a/source/nanoFramework.CoreLibrary/System/BitConverter.cs
+++ b/source/nanoFramework.CoreLibrary/System/BitConverter.cs
@@ -28,7 +28,9 @@ public static extern bool IsLittleEndian
/// The number to convert.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern long DoubleToInt64Bits(double value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns the specified Boolean value as an array of bytes.
@@ -36,7 +38,9 @@ public static extern bool IsLittleEndian
/// A Boolean value.
/// An array of bytes with length 1.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern byte[] GetBytes(bool value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns the specified Unicode character value as an array of bytes.
@@ -44,7 +48,9 @@ public static extern bool IsLittleEndian
/// A character to convert.
/// An array of bytes with length 2.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern byte[] GetBytes(char value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns the specified double-precision floating point value as an array of bytes.
@@ -52,7 +58,9 @@ public static extern bool IsLittleEndian
/// The number to convert.
/// An array of bytes with length 8.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern byte[] GetBytes(double value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns the specified single-precision floating point value as an array of bytes.
@@ -60,7 +68,9 @@ public static extern bool IsLittleEndian
/// The number to convert.
/// An array of bytes with length 4.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern byte[] GetBytes(float value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns the specified 32-bit signed integer value as an array of bytes.
@@ -68,7 +78,9 @@ public static extern bool IsLittleEndian
/// The number to convert.
/// An array of bytes with length 4.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern byte[] GetBytes(int value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns the specified 64-bit signed integer value as an array of bytes.
@@ -76,7 +88,9 @@ public static extern bool IsLittleEndian
/// The number to convert.
/// An array of bytes with length 8.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern byte[] GetBytes(long value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns the specified 16-bit signed integer value as an array of bytes.
@@ -84,7 +98,9 @@ public static extern bool IsLittleEndian
/// The number to convert.
/// An array of bytes with length 2.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern byte[] GetBytes(short value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns the specified 32-bit unsigned integer value as an array of bytes.
@@ -92,7 +108,11 @@ public static extern bool IsLittleEndian
/// The number to convert.
/// An array of bytes with length 4.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable CS3001 // Argument type 'uint' is not CLS-compliant
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern byte[] GetBytes(uint value);
+#pragma warning restore S4200 // Native methods should be wrapped
+#pragma warning restore CS3001 // Argument type 'uint' is not CLS-compliant
///
/// Returns the specified 64-bit unsigned integer value as an array of bytes.
@@ -100,7 +120,11 @@ public static extern bool IsLittleEndian
/// The number to convert.
/// An array of bytes with length 8.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable CS3001 // Argument type 'ulong' is not CLS-compliant
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern byte[] GetBytes(ulong value);
+#pragma warning restore S4200 // Native methods should be wrapped
+#pragma warning restore CS3001 // Argument type 'ulong' is not CLS-compliant
///
/// Returns the specified 16-bit unsigned integer value as an array of bytes.
@@ -108,7 +132,11 @@ public static extern bool IsLittleEndian
/// The number to convert.
/// An array of bytes with length 2.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable CS3001 // Argument type 'ushort' is not CLS-compliant
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern byte[] GetBytes(ushort value);
+#pragma warning restore S4200 // Native methods should be wrapped
+#pragma warning restore CS3001 // Argument type 'ushort' is not CLS-compliant
///
/// Converts the specified 64-bit signed integer to a double-precision floating point number.
@@ -116,7 +144,9 @@ public static extern bool IsLittleEndian
/// The number to convert.
/// A double-precision floating point number whose value is equivalent to value.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern double Int64BitsToDouble(long value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a Boolean value converted from one byte at a specified position in a byte array.
@@ -125,7 +155,9 @@ public static extern bool IsLittleEndian
/// The starting position within value.
/// true if the byte at startIndex in value is nonzero; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern bool ToBoolean(byte[] value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a Unicode character converted from two bytes at a specified position in a byte array.
@@ -134,7 +166,9 @@ public static extern bool IsLittleEndian
/// The starting position within value.
/// A character formed by two bytes beginning at startIndex.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern char ToChar(byte[] value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a double-precision floating point number converted from eight bytes at a specified position in a byte array.
@@ -143,7 +177,9 @@ public static extern bool IsLittleEndian
/// The starting position within value.
/// A double precision floating point number formed by eight bytes beginning at startIndex.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern double ToDouble(byte[] value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array.
@@ -152,7 +188,9 @@ public static extern bool IsLittleEndian
/// The starting position within value.
/// A 16-bit signed integer formed by two bytes beginning at startIndex.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern short ToInt16(byte[] value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array.
@@ -161,7 +199,9 @@ public static extern bool IsLittleEndian
/// The starting position within value.
/// A 32-bit signed integer formed by four bytes beginning at startIndex.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern int ToInt32(byte[] value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array.
@@ -170,7 +210,9 @@ public static extern bool IsLittleEndian
/// The starting position within value.
/// A 64-bit signed integer formed by eight bytes beginning at startIndex.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern long ToInt64(byte[] value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a single-precision floating point number converted from four bytes at a specified position in a byte array.
@@ -179,7 +221,9 @@ public static extern bool IsLittleEndian
/// The starting position within value.
/// A single-precision floating point number formed by four bytes beginning at startIndex.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern float ToSingle(byte[] value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Converts the numeric value of each element of a specified array of bytes to its equivalent hexadecimal string representation.
@@ -187,7 +231,9 @@ public static extern bool IsLittleEndian
/// An array of bytes.
/// A String of hexadecimal pairs separated by hyphens, where each pair represents the corresponding element in value; for example, "7F-2C-4A".
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern string ToString(byte[] value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation.
@@ -196,7 +242,9 @@ public static extern bool IsLittleEndian
/// The starting position within value.
/// A String of hexadecimal pairs separated by hyphens, where each pair represents the corresponding element in a subarray of value; for example, "7F-2C-4A".
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern string ToString(byte[] value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation.
@@ -206,7 +254,9 @@ public static extern bool IsLittleEndian
/// The number of array elements in value to convert.
/// A String of hexadecimal pairs separated by hyphens, where each pair represents the corresponding element in a subarray of value; for example, "7F-2C-4A".
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern string ToString(byte[] value, int startIndex, int length);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.
@@ -216,7 +266,9 @@ public static extern bool IsLittleEndian
/// A 16-bit unsigned integer formed by two bytes beginning at startIndex.
[CLSCompliant(false)]
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern ushort ToUInt16(byte[] value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a 32-bit unsigned integer converted from two bytes at a specified position in a byte array.
@@ -226,7 +278,9 @@ public static extern bool IsLittleEndian
/// A 32-bit unsigned integer formed by two bytes beginning at startIndex.
[CLSCompliant(false)]
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern uint ToUInt32(byte[] value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a 64-bit unsigned integer converted from two bytes at a specified position in a byte array.
@@ -236,6 +290,8 @@ public static extern bool IsLittleEndian
/// A 64-bit unsigned integer formed by two bytes beginning at startIndex.
[CLSCompliant(false)]
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern ulong ToUInt64(byte[] value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Byte.cs b/source/nanoFramework.CoreLibrary/System/Byte.cs
index aff480e8..31d73a1c 100644
--- a/source/nanoFramework.CoreLibrary/System/Byte.cs
+++ b/source/nanoFramework.CoreLibrary/System/Byte.cs
@@ -59,7 +59,9 @@ public static byte Parse(String s)
{
if (s == null)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
return Convert.ToByte(s);
diff --git a/source/nanoFramework.CoreLibrary/System/Collections/ArrayList.cs b/source/nanoFramework.CoreLibrary/System/Collections/ArrayList.cs
index 109b218c..f51a7945 100644
--- a/source/nanoFramework.CoreLibrary/System/Collections/ArrayList.cs
+++ b/source/nanoFramework.CoreLibrary/System/Collections/ArrayList.cs
@@ -123,7 +123,9 @@ public virtual extern Object this[int index]
///
/// The to be added to the end of the . The value can be .
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern int Add(Object value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Searches the entire sorted for an element using the specified comparer and returns the zero-based index of the element.
@@ -142,7 +144,9 @@ public virtual int BinarySearch(Object value, IComparer comparer)
/// Removes all elements from the .
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern void Clear();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Creates a shallow copy of the .
@@ -241,7 +245,9 @@ public virtual int IndexOf(Object value, int startIndex, int count)
/// The zero-based index at which value should be inserted.
/// The to insert. The `value` can be .
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern void Insert(int index, Object value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Removes the first occurrence of a specific object from the .
@@ -261,7 +267,9 @@ public virtual void Remove(Object obj)
///
/// The zero-based index of the element to remove.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern void RemoveAt(int index);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Copies the elements of the to a new array.
diff --git a/source/nanoFramework.CoreLibrary/System/Collections/HashTable.cs b/source/nanoFramework.CoreLibrary/System/Collections/HashTable.cs
index 82c7d654..3ecd8200 100644
--- a/source/nanoFramework.CoreLibrary/System/Collections/HashTable.cs
+++ b/source/nanoFramework.CoreLibrary/System/Collections/HashTable.cs
@@ -60,6 +60,7 @@ private void InitializeHashTable(int capacity, int maxLoadFactor)
_growthFactor = 2;
}
+#pragma warning disable S2292 // Trivial properties should be auto-implemented
///
/// MaxLoadFactor Property is the value used to trigger a rehash.
/// Default value is 2.
@@ -67,16 +68,19 @@ private void InitializeHashTable(int capacity, int maxLoadFactor)
/// While a value of 1 maintains a constant time complexity at the cost of increased memory requirements.
///
public int MaxLoadFactor
+#pragma warning restore S2292 // Trivial properties should be auto-implemented
{
get { return _maxLoadFactor; }
set { _maxLoadFactor = value; }
}
+#pragma warning disable S2292 // Trivial properties should be auto-implemented
///
/// GrowthFactor Property is a multiplier to increase the HashTable size by during a rehash.
/// Default value is 2.
///
public double GrowthFactor
+#pragma warning restore S2292 // Trivial properties should be auto-implemented
{
get { return _growthFactor; }
set { _growthFactor = value; }
@@ -162,7 +166,9 @@ private void CopyToCollection(Array array, int index, EnumeratorType type)
{
if (index < 0 && index > _numberOfBuckets)
{
+#pragma warning disable S112 // General exceptions should never be thrown
throw new IndexOutOfRangeException("index");
+#pragma warning restore S112 // General exceptions should never be thrown
}
for (int i = index; i < _numberOfBuckets; i++)
@@ -258,7 +264,9 @@ public object SyncRoot
public void CopyTo(Array array, int index)
{
if (index < 0 && index > _buckets.Length)
+#pragma warning disable S112 // General exceptions should never be thrown
throw new IndexOutOfRangeException("index");
+#pragma warning restore S112 // General exceptions should never be thrown
for (int i = index; i < _buckets.Length; i++)
{
diff --git a/source/nanoFramework.CoreLibrary/System/Collections/Queue.cs b/source/nanoFramework.CoreLibrary/System/Collections/Queue.cs
index 9f99c72a..241e72ee 100644
--- a/source/nanoFramework.CoreLibrary/System/Collections/Queue.cs
+++ b/source/nanoFramework.CoreLibrary/System/Collections/Queue.cs
@@ -92,7 +92,9 @@ public virtual Object SyncRoot
/// Removes all objects from the Queue.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern void Clear();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Copies the Queue elements to an existing one-dimensional Array, starting at
@@ -101,14 +103,18 @@ public virtual Object SyncRoot
/// The one-dimensional Array that is the destination of the elements copied from Queue.
/// The zero-based index in array at which copying begins.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern void CopyTo(Array array, int index);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Adds an object to the end of the Queue.
///
/// The object to add to the Queue.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern void Enqueue(Object obj);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns an enumerator that iterates through the Queue.
@@ -128,14 +134,18 @@ public virtual IEnumerator GetEnumerator()
///
/// The object that is removed from the beginning of the Queue.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern Object Dequeue();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns the object at the beginning of the Queue without removing it.
///
/// The object at the beginning of the Queue.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern Object Peek();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Determines whether an element is in the Queue.
diff --git a/source/nanoFramework.CoreLibrary/System/Collections/stack.cs b/source/nanoFramework.CoreLibrary/System/Collections/stack.cs
index aa698b2f..0ffd0cce 100644
--- a/source/nanoFramework.CoreLibrary/System/Collections/stack.cs
+++ b/source/nanoFramework.CoreLibrary/System/Collections/stack.cs
@@ -59,7 +59,9 @@ public virtual Object SyncRoot
/// Removes all Objects from the Stack.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern void Clear();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Creates a shallow copy of the Stack.
@@ -118,21 +120,27 @@ public virtual IEnumerator GetEnumerator()
///
/// The Object at the top of the Stack.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern Object Peek();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Removes and returns the object at the top of the Stack.
///
/// The Object removed from the top of the Stack.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern Object Pop();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Inserts an object at the top of the Stack.
///
/// The Object to push onto the Stack.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern void Push(Object obj);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Copies the Stack to a new array, in the same order Pop would return the items.
diff --git a/source/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs b/source/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs
index 38248677..4921cbf9 100644
--- a/source/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs
+++ b/source/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs
@@ -34,7 +34,9 @@ public enum EditorBrowsableState
///////////////////////////////////////////////////////////////////////////////////////////////////////
// GetHashCode() implementation is provided by general native function CLR_RT_HeapBlock::GetHashCode //
///////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma warning disable S1206 // "Equals(Object)" and "GetHashCode()" should be overridden in pairs
public sealed class EditorBrowsableAttribute : Attribute
+#pragma warning restore S1206 // "Equals(Object)" and "GetHashCode()" should be overridden in pairs
#pragma warning restore CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
{
private readonly EditorBrowsableState _browsableState;
diff --git a/source/nanoFramework.CoreLibrary/System/Console.cs b/source/nanoFramework.CoreLibrary/System/Console.cs
index 135b0d25..7843cc3a 100644
--- a/source/nanoFramework.CoreLibrary/System/Console.cs
+++ b/source/nanoFramework.CoreLibrary/System/Console.cs
@@ -12,25 +12,29 @@ namespace System
/// Represents the standard input, output, and error streams for console applications. This class cannot be inherited.
///
[Serializable]
- public class Console
+ public static class Console
{
[MethodImpl(MethodImplOptions.InternalCall)]
extern static private void OutNative(string text, bool addLineFeed);
+#pragma warning disable S4200 // Native methods should be wrapped
///
/// Writes the specified string value to the standard output stream.
///
/// The value to write.
public static void Write(string value)
+#pragma warning restore S4200 // Native methods should be wrapped
{
OutNative(value, false);
}
+#pragma warning disable S4200 // Native methods should be wrapped
///
/// Writes the specified string value, followed by the current line terminator, to the standard output stream.
///
/// The value to write.
public static void WriteLine(string value)
+#pragma warning restore S4200 // Native methods should be wrapped
{
OutNative(value, true);
}
diff --git a/source/nanoFramework.CoreLibrary/System/Convert.cs b/source/nanoFramework.CoreLibrary/System/Convert.cs
index 5451da28..54089150 100644
--- a/source/nanoFramework.CoreLibrary/System/Convert.cs
+++ b/source/nanoFramework.CoreLibrary/System/Convert.cs
@@ -183,17 +183,21 @@ public static long ToInt64(string value, int fromBase = 10)
/// is not 2, 8, 10, or 16.
/// If the platform doesn't have support to convert from non-base 10 values.
[CLSCompliant(false)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static ulong ToUInt64(string value, int fromBase = 10)
+#pragma warning restore S4200 // Native methods should be wrapped
{
return (ulong)NativeToInt64(value, true, 0, 0, fromBase);
}
+#pragma warning disable S4200 // Native methods should be wrapped
///
/// Converts the specified string representation of a number to an equivalent double-precision floating-point number.
///
/// A string that contains the number to convert.
/// A double-precision floating-point number that is equivalent to the number in value, or 0 (zero) if value is .
public static double ToDouble(string value)
+#pragma warning restore S4200 // Native methods should be wrapped
{
return NativeToDouble(value);
}
@@ -205,7 +209,9 @@ public static double ToDouble(string value)
/// The String representation, in base 64, of the contents of .
public static string ToBase64String(byte[] inArray)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (inArray == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
return ToBase64String(inArray, 0, inArray.Length, Base64FormattingOptions.None);
}
@@ -218,7 +224,9 @@ public static string ToBase64String(byte[] inArray)
/// The string representation in base 64 of the elements in .
public static String ToBase64String(byte[] inArray, Base64FormattingOptions options)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (inArray == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
return ToBase64String(inArray, 0, inArray.Length, options);
}
@@ -246,10 +254,18 @@ public static String ToBase64String(byte[] inArray, int offset, int length)
public static string ToBase64String(byte[] inArray, int offset, int length, Base64FormattingOptions options)
{
//Do data verfication
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (inArray == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (length < 0) throw new ArgumentOutOfRangeException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (offset < 0) throw new ArgumentOutOfRangeException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (options < Base64FormattingOptions.None || options > Base64FormattingOptions.InsertLineBreaks) throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
return ToBase64String(inArray, offset, length, options == Base64FormattingOptions.InsertLineBreaks);
}
@@ -268,7 +284,9 @@ public static string ToBase64String(byte[] inArray, int offset, int length, Base
///
public static byte[] FromBase64String(string inString)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (inString == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
var chArray = inString.ToCharArray();
@@ -284,10 +302,18 @@ public static byte[] FromBase64String(string inString)
/// An array of 8-bit unsigned integers equivalent to elements at position in .
public static byte[] FromBase64CharArray(char[] inArray, int offset, int length)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (inArray == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (length < 0) throw new ArgumentOutOfRangeException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (offset < 0) throw new ArgumentOutOfRangeException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (offset > inArray.Length - length) throw new ArgumentOutOfRangeException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
// copy to new array
var destinationArray = new char[length];
diff --git a/source/nanoFramework.CoreLibrary/System/DateTime.cs b/source/nanoFramework.CoreLibrary/System/DateTime.cs
index 7c521c25..c55e2116 100644
--- a/source/nanoFramework.CoreLibrary/System/DateTime.cs
+++ b/source/nanoFramework.CoreLibrary/System/DateTime.cs
@@ -94,7 +94,9 @@ public struct DateTime
/// ticks - Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.
public DateTime(long ticks)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if ((ticks & (long)TickMask) < MinTicks || (ticks & (long)TickMask) > MaxTicks) throw new ArgumentOutOfRangeException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
_ticks = (ulong)ticks;
}
@@ -262,16 +264,18 @@ public int CompareTo(Object val)
/// The number of days in month for the specified year.
/// For example, if month equals 2 for February, the return value is 28 or 29 depending upon whether year is a leap year.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern int DaysInMonth(int year, int month);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a value indicating whether this instance is equal to a specified object.
///
- /// The object to compare to this instance.
+ /// The object to compare to this instance.
/// true if val is an instance of DateTime and equals the value of this instance; otherwise, false.
- public override bool Equals(Object val)
+ public override bool Equals(Object obj)
{
- if (val is DateTime)
+ if (obj is DateTime)
{
// Call compare for proper comparison of 2 DateTime objects
// Since DateTime is optimized value and internally represented by int64
@@ -280,7 +284,7 @@ public override bool Equals(Object val)
object o = this;
var thisTime = (DateTime)o;
- return Compare(thisTime, (DateTime)val) == 0;
+ return Compare(thisTime, (DateTime)obj) == 0;
}
return false;
diff --git a/source/nanoFramework.CoreLibrary/System/Delegate.cs b/source/nanoFramework.CoreLibrary/System/Delegate.cs
index 112f668b..4bda5e79 100644
--- a/source/nanoFramework.CoreLibrary/System/Delegate.cs
+++ b/source/nanoFramework.CoreLibrary/System/Delegate.cs
@@ -16,7 +16,9 @@ namespace System
///////////////////////////////////////////////////////////////////////////////////////////////////////
// GetHashCode() implementation is provided by general native function CLR_RT_HeapBlock::GetHashCode //
///////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma warning disable S1206 // "Equals(Object)" and "GetHashCode()" should be overridden in pairs
public abstract class Delegate
+#pragma warning restore S1206 // "Equals(Object)" and "GetHashCode()" should be overridden in pairs
#pragma warning restore CS0661 // Type defines operator == or operator != but does not override Object.GetHashCode()
#pragma warning restore CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
{
@@ -27,7 +29,9 @@ public abstract class Delegate
/// The object to compare with the current delegate.
/// true if obj and the current delegate have the same targets, methods, and invocation list; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public override extern bool Equals(Object obj);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Concatenates the invocation lists of two delegates.
@@ -36,7 +40,9 @@ public abstract class Delegate
/// The delegate whose invocation list comes last.
/// A new delegate with an invocation list that concatenates the invocation lists of a and b in that order. Returns a if b is null reference (Nothing in Visual Basic), returns b if a is a null reference, and returns a null reference if both a and b are null references.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern Delegate Combine(Delegate a, Delegate b);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Gets the method represented by the delegate.
@@ -69,7 +75,9 @@ public extern Object Target
/// The delegate that supplies the invocation list to remove from the invocation list of source.
/// A new delegate with an invocation list formed by taking the invocation list of source and removing the last occurrence of the invocation list of value, if the invocation list of value is found within the invocation list of source. Returns source if value is null reference (Nothing in Visual Basic) or if the invocation list of value is not found within the invocation list of source. Returns a null reference if the invocation list of value is equal to the invocation list of source or if source is a null reference.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern Delegate Remove(Delegate source, Delegate value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Determines whether the specified delegates are equal.
diff --git a/source/nanoFramework.CoreLibrary/System/Diagnostics/Debugger.cs b/source/nanoFramework.CoreLibrary/System/Diagnostics/Debugger.cs
index 7a414d62..dfd90b0c 100644
--- a/source/nanoFramework.CoreLibrary/System/Diagnostics/Debugger.cs
+++ b/source/nanoFramework.CoreLibrary/System/Diagnostics/Debugger.cs
@@ -27,6 +27,8 @@ public static extern bool IsAttached
/// Signals a breakpoint to an attached debugger.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern void Break();
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs b/source/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs
index 79b85792..5394d62a 100644
--- a/source/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs
+++ b/source/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs
@@ -253,6 +253,7 @@ public Type Target
get { return _target; }
}
+#pragma warning disable S2292 // Trivial properties should be auto-implemented
///
/// Gets or sets the name of the target type.
///
@@ -260,6 +261,7 @@ public Type Target
/// The name of the target type.
///
public string TargetTypeName
+#pragma warning restore S2292 // Trivial properties should be auto-implemented
{
get { return _targetName; }
set { _targetName = value; }
@@ -310,21 +312,25 @@ public string Value
get { return _value; }
}
+#pragma warning disable S2292 // Trivial properties should be auto-implemented
///
/// Gets or sets the name to display in the debugger variable windows.
///
/// The name to display in the debugger variable windows.
public string Name
+#pragma warning restore S2292 // Trivial properties should be auto-implemented
{
get { return _name; }
set { _name = value; }
}
+#pragma warning disable S2292 // Trivial properties should be auto-implemented
///
/// Gets or sets the string to display in the type column of the debugger variable windows.
///
/// The string to display in the type column of the debugger variable windows.
public string Type
+#pragma warning restore S2292 // Trivial properties should be auto-implemented
{
get { return _type; }
set { _type = value; }
@@ -348,11 +354,13 @@ public Type Target
get { return _target; }
}
+#pragma warning disable S2292 // Trivial properties should be auto-implemented
///
/// Gets or sets the type name of the attribute's target.
///
/// The name of the attribute's target type.
public string TargetTypeName
+#pragma warning restore S2292 // Trivial properties should be auto-implemented
{
get { return _targetName; }
set { _targetName = value; }
diff --git a/source/nanoFramework.CoreLibrary/System/Double.cs b/source/nanoFramework.CoreLibrary/System/Double.cs
index 4c9013a5..1e51c443 100644
--- a/source/nanoFramework.CoreLibrary/System/Double.cs
+++ b/source/nanoFramework.CoreLibrary/System/Double.cs
@@ -55,7 +55,9 @@ public struct Double
/// Documentation missing
/// Documentation missing
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern int CompareTo(double d, double value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a value indicating whether the specified number evaluates to negative or positive infinity
@@ -65,7 +67,9 @@ public struct Double
/// true if d evaluates to PositiveInfinity or NegativeInfinity; otherwise, false.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern bool IsInfinity(double d);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a value that indicates whether the specified value is not a number (NaN).
@@ -75,7 +79,9 @@ public struct Double
/// true if d evaluates to NaN; otherwise, false.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern bool IsNaN(double d);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a value indicating whether the specified number evaluates to negative infinity.
@@ -85,7 +91,9 @@ public struct Double
/// true if d evaluates to NegativeInfinity; otherwise, false.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern bool IsNegativeInfinity(double d);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a value indicating whether the specified number evaluates to positive infinity.
@@ -95,7 +103,9 @@ public struct Double
/// true if d evaluates to PositiveInfinity; otherwise, false.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern bool IsPositiveInfinity(double d);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Converts the string representation of a number to its double-precision floating-point number equivalent.
@@ -105,7 +115,9 @@ public struct Double
///
public static double Parse(String s)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (s == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
return Convert.ToDouble(s);
}
diff --git a/source/nanoFramework.CoreLibrary/System/GC.cs b/source/nanoFramework.CoreLibrary/System/GC.cs
index 88c7bdf6..470d46d3 100644
--- a/source/nanoFramework.CoreLibrary/System/GC.cs
+++ b/source/nanoFramework.CoreLibrary/System/GC.cs
@@ -29,14 +29,18 @@ public static void WaitForPendingFinalizers()
///
/// The object that a finalizer must not be called for.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern void SuppressFinalize(Object obj);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Requests that the system call the finalizer for the specified object for which SuppressFinalize has previously been called.
///
/// The object that a finalizer must be called for.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern void ReRegisterForFinalize(Object obj);
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Guid.cs b/source/nanoFramework.CoreLibrary/System/Guid.cs
index c8911ff4..9839a14e 100644
--- a/source/nanoFramework.CoreLibrary/System/Guid.cs
+++ b/source/nanoFramework.CoreLibrary/System/Guid.cs
@@ -97,9 +97,13 @@ public Guid(uint a, ushort b, ushort c, byte d, byte e, byte f, byte g, byte h,
public Guid(byte[] b)
{
if (b == null)
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (b.Length != 16)
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
_a = b[3] << 24 | b[2] << 16 | b[1] << 8 | b[0];
_b = (short)(b[5] << 8 | b[4]);
@@ -127,7 +131,9 @@ public int CompareTo(Object value)
}
if (!(value is Guid))
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
Guid g = (Guid)value;
@@ -278,15 +284,15 @@ public override string ToString()
///
/// Returns a value that indicates whether this instance is equal to a specified object.
///
- /// The object to compare with this instance.
+ /// The object to compare with this instance.
///
- public override bool Equals(Object o)
+ public override bool Equals(Object obj)
{
Guid g;
// Check that o is a Guid first
- if (o == null || !(o is Guid))
+ if (obj == null || !(obj is Guid))
return false;
- else g = (Guid)o;
+ else g = (Guid)obj;
// Now compare each of the elements
if (g._a != _a)
diff --git a/source/nanoFramework.CoreLibrary/System/Int16.cs b/source/nanoFramework.CoreLibrary/System/Int16.cs
index 8c8848e0..62714b9e 100644
--- a/source/nanoFramework.CoreLibrary/System/Int16.cs
+++ b/source/nanoFramework.CoreLibrary/System/Int16.cs
@@ -57,7 +57,9 @@ public String ToString(String format)
///
public static short Parse(String s)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (s == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
return Convert.ToInt16(s);
}
diff --git a/source/nanoFramework.CoreLibrary/System/Int32.cs b/source/nanoFramework.CoreLibrary/System/Int32.cs
index 12db20d2..f15471d1 100644
--- a/source/nanoFramework.CoreLibrary/System/Int32.cs
+++ b/source/nanoFramework.CoreLibrary/System/Int32.cs
@@ -54,7 +54,9 @@ public String ToString(String format)
///
public static int Parse(String s)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (s == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
return Convert.ToInt32(s);
}
diff --git a/source/nanoFramework.CoreLibrary/System/Int64.cs b/source/nanoFramework.CoreLibrary/System/Int64.cs
index 11cbf78e..f12d103b 100644
--- a/source/nanoFramework.CoreLibrary/System/Int64.cs
+++ b/source/nanoFramework.CoreLibrary/System/Int64.cs
@@ -54,7 +54,9 @@ public String ToString(String format)
///
public static long Parse(String s)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (s == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
return Convert.ToInt64(s);
}
diff --git a/source/nanoFramework.CoreLibrary/System/MulticastDelegate.cs b/source/nanoFramework.CoreLibrary/System/MulticastDelegate.cs
index 3cf487f7..4a97de51 100644
--- a/source/nanoFramework.CoreLibrary/System/MulticastDelegate.cs
+++ b/source/nanoFramework.CoreLibrary/System/MulticastDelegate.cs
@@ -17,7 +17,9 @@ namespace System
///////////////////////////////////////////////////////////////////////////////////////////////////////
// GetHashCode() implementation is provided by general native function CLR_RT_HeapBlock::GetHashCode //
///////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma warning disable S1206 // "Equals(Object)" and "GetHashCode()" should be overridden in pairs
public abstract class MulticastDelegate : Delegate
+#pragma warning restore S1206 // "Equals(Object)" and "GetHashCode()" should be overridden in pairs
#pragma warning restore CS0661 // Type defines operator == or operator != but does not override Object.GetHashCode()
#pragma warning restore CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
{
diff --git a/source/nanoFramework.CoreLibrary/System/Number.cs b/source/nanoFramework.CoreLibrary/System/Number.cs
index 4a21cdd5..c786fd86 100644
--- a/source/nanoFramework.CoreLibrary/System/Number.cs
+++ b/source/nanoFramework.CoreLibrary/System/Number.cs
@@ -327,7 +327,9 @@ private static void ValidateFormat(String format, out char formatCh, out int pre
if (formatLen > 4)
{
// Invalid Format
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
for (int i = 1; i < formatLen; i++)
@@ -336,7 +338,9 @@ private static void ValidateFormat(String format, out char formatCh, out int pre
if (digit > 9)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
precision = precision * 10 + digit;
@@ -355,7 +359,9 @@ private static void ValidateFormat(String format, out char formatCh, out int pre
if (formatLen == 1) precision = 2; // if no precision is specified, use the default
break;
default:
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Object.cs b/source/nanoFramework.CoreLibrary/System/Object.cs
index dae63eb8..f45dea13 100644
--- a/source/nanoFramework.CoreLibrary/System/Object.cs
+++ b/source/nanoFramework.CoreLibrary/System/Object.cs
@@ -37,7 +37,9 @@ public virtual String ToString()
/// he object to compare with the current object.
/// true if the specified object is equal to the current object; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern bool Equals(Object obj);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Determines whether the specified object instances are considered equal.
@@ -67,28 +69,36 @@ public static bool Equals(Object objA, Object objB)
/// The second object to compare.
/// true if objA is the same instance as objB or if both are null; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern bool ReferenceEquals(Object objA, Object objB);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Serves as the default hash function.
///
/// A hash code for the current object.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern int GetHashCode();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Gets the Type of the current instance.
///
/// The exact runtime type of the current instance.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern Type GetType();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Creates a shallow copy of the current Object.
///
/// A shallow copy of the current Object.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
protected extern Object MemberwiseClone();
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Random.cs b/source/nanoFramework.CoreLibrary/System/Random.cs
index 8101afd2..6ef24947 100644
--- a/source/nanoFramework.CoreLibrary/System/Random.cs
+++ b/source/nanoFramework.CoreLibrary/System/Random.cs
@@ -48,7 +48,9 @@ public class Random
/// A 32-bit signed integer greater than or equal to zero and
/// less than MaxValue.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern int Next();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a nonnegative random number less than the specified maximum.
@@ -58,7 +60,9 @@ public class Random
/// A 32-bit signed integer greater than or equal to zero, and
/// less than maxValue.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern int Next(int maxValue);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a random number between 0.0 and 1.0.
@@ -66,13 +70,17 @@ public class Random
/// A double-precision floating point number greater than or equal
/// to 0.0, and less than 1.0.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern double NextDouble();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Fills the elements of a specified array of bytes with random numbers.
///
/// An array of bytes to contain random numbers.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern void NextBytes(byte[] buffer);
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Reflection/Assembly.cs b/source/nanoFramework.CoreLibrary/System/Reflection/Assembly.cs
index eab24bc3..274cec0e 100644
--- a/source/nanoFramework.CoreLibrary/System/Reflection/Assembly.cs
+++ b/source/nanoFramework.CoreLibrary/System/Reflection/Assembly.cs
@@ -84,7 +84,9 @@ public virtual extern String FullName
///
/// The assembly that contains the code that is currently executing.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern Assembly GetExecutingAssembly();
+#pragma warning restore S4200 // Native methods should be wrapped
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern void GetVersion(ref int major, ref int minor, ref int build, ref int revision);
@@ -114,7 +116,9 @@ public static Assembly GetAssembly(Type type)
/// The full name of the type.
/// An object that represents the specified class, or null if the class is not found.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern Type GetType(String name);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Gets the Type object with the specified name in the assembly instance and optionally throws an exception if the type is not found.
@@ -127,7 +131,9 @@ public virtual Type GetType(String name, bool throwOnError)
{
var type = GetType(name);
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if ( (type == null) && (throwOnError) ) throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
return type;
}
@@ -137,7 +143,9 @@ public virtual Type GetType(String name, bool throwOnError)
///
/// An array that contains all the types that are defined in this assembly.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern Type[] GetTypes();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Gets the satellite assembly for the specified culture.
@@ -165,7 +173,9 @@ public Assembly GetSatelliteAssembly(CultureInfo culture)
if (assm == null)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
// FIXME -- throw new FileNotFoundException();
}
@@ -232,12 +242,16 @@ internal static string ParseAssemblyName(String assemblyString, ref bool fVersio
}
else
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
}
else
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
}
else
@@ -260,7 +274,9 @@ internal static Assembly Load(String assemblyString, bool fThrowOnError)
if (fThrowOnError)
{
// FIXME -- should be FileNotFoundException, per spec.
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
}
@@ -276,7 +292,9 @@ internal static Assembly Load(String assemblyString, bool fThrowOnError)
/// A byte array that is a COFF-based image containing an emitted assembly.
/// The loaded assembly.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern Assembly Load(byte[] rawAssembly);
+#pragma warning restore S4200 // Native methods should be wrapped
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern String[] GetManifestResourceNames();
diff --git a/source/nanoFramework.CoreLibrary/System/Reflection/ConstructorInfo.cs b/source/nanoFramework.CoreLibrary/System/Reflection/ConstructorInfo.cs
index ecc28ffd..dff6bd7f 100644
--- a/source/nanoFramework.CoreLibrary/System/Reflection/ConstructorInfo.cs
+++ b/source/nanoFramework.CoreLibrary/System/Reflection/ConstructorInfo.cs
@@ -37,7 +37,9 @@ public override MemberTypes MemberType
[Diagnostics.DebuggerStepThrough]
[Diagnostics.DebuggerHidden]
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern Object Invoke(Object[] parameters);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// When overridden in a derived class, returns an array of all custom attributes applied to this member.
@@ -47,6 +49,8 @@ public override MemberTypes MemberType
/// This method is not implemented in nanoFramework.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern override object[] GetCustomAttributes(bool inherit);
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Reflection/FieldInfo.cs b/source/nanoFramework.CoreLibrary/System/Reflection/FieldInfo.cs
index 1668b6cb..32c81d9b 100644
--- a/source/nanoFramework.CoreLibrary/System/Reflection/FieldInfo.cs
+++ b/source/nanoFramework.CoreLibrary/System/Reflection/FieldInfo.cs
@@ -58,7 +58,9 @@ public abstract Type FieldType
[Diagnostics.DebuggerStepThrough]
[Diagnostics.DebuggerHidden]
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern void SetValue(Object obj, Object value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// When overridden in a derived class, returns an array of all custom attributes applied to this member.
@@ -69,7 +71,9 @@ public abstract Type FieldType
/// This method is not implemente.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern override object[] GetCustomAttributes(bool inherit);
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Reflection/MethodBase.cs b/source/nanoFramework.CoreLibrary/System/Reflection/MethodBase.cs
index c0f74dd2..b96011c0 100644
--- a/source/nanoFramework.CoreLibrary/System/Reflection/MethodBase.cs
+++ b/source/nanoFramework.CoreLibrary/System/Reflection/MethodBase.cs
@@ -86,7 +86,9 @@ public extern bool IsAbstract
[Diagnostics.DebuggerStepThrough]
[Diagnostics.DebuggerHidden]
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern Object Invoke(Object obj, Object[] parameters);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Gets the name of the current member.
diff --git a/source/nanoFramework.CoreLibrary/System/Reflection/PropertyInfo.cs b/source/nanoFramework.CoreLibrary/System/Reflection/PropertyInfo.cs
index 00b8c745..0257fec7 100644
--- a/source/nanoFramework.CoreLibrary/System/Reflection/PropertyInfo.cs
+++ b/source/nanoFramework.CoreLibrary/System/Reflection/PropertyInfo.cs
@@ -35,7 +35,9 @@ public abstract Type PropertyType
[Diagnostics.DebuggerStepThrough]
[Diagnostics.DebuggerHidden]
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern Object GetValue(Object obj, Object[] index);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Sets the property value of a specified object with optional index values for index properties.
@@ -46,6 +48,8 @@ public abstract Type PropertyType
[Diagnostics.DebuggerStepThrough]
[Diagnostics.DebuggerHidden]
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern void SetValue(Object obj, Object value, Object[] index);
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Resources/ResourceManager.cs b/source/nanoFramework.CoreLibrary/System/Resources/ResourceManager.cs
index 1b4ad7c5..3b492644 100644
--- a/source/nanoFramework.CoreLibrary/System/Resources/ResourceManager.cs
+++ b/source/nanoFramework.CoreLibrary/System/Resources/ResourceManager.cs
@@ -51,7 +51,9 @@ internal ResourceManager(string baseName, Assembly assembly, string cultureName,
{
if (fThrowOnFailure)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
}
}
@@ -203,7 +205,9 @@ private object GetObjectFromId(short id)
rm = rm._rmFallback;
}
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
private object GetObjectChunkFromId(short id, int offset, int length)
@@ -232,7 +236,9 @@ private object GetObjectChunkFromId(short id, int offset, int length)
rm = rm._rmFallback;
}
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
[MethodImpl(MethodImplOptions.InternalCall)]
diff --git a/source/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeHelpers.cs b/source/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeHelpers.cs
index 7d0045ae..86ef51c3 100644
--- a/source/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeHelpers.cs
+++ b/source/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeHelpers.cs
@@ -18,7 +18,9 @@ public static class RuntimeHelpers
/// The array to be initialized.
/// A field handle that specifies the location of the data used to initialize the array.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern void InitializeArray(Array array, RuntimeFieldHandle fldHandle);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Boxes a value type.
@@ -26,14 +28,18 @@ public static class RuntimeHelpers
/// The value type to be boxed.
/// A boxed copy of obj if it is a value class; otherwise, obj itself.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern Object GetObjectValue(Object obj);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Runs a specified class constructor method.
///
/// A type handle that specifies the class constructor method to run.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern void RunClassConstructor(RuntimeTypeHandle type);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Gets the offset, in bytes, to the data in the given string.
diff --git a/source/nanoFramework.CoreLibrary/System/Runtime/Remoting/RemotingServices.cs b/source/nanoFramework.CoreLibrary/System/Runtime/Remoting/RemotingServices.cs
index 6395bfb3..211a41f3 100644
--- a/source/nanoFramework.CoreLibrary/System/Runtime/Remoting/RemotingServices.cs
+++ b/source/nanoFramework.CoreLibrary/System/Runtime/Remoting/RemotingServices.cs
@@ -13,6 +13,8 @@ public static class RemotingServices
/// The reference to the object to check.
/// A Boolean value that indicates whether the object specified in the proxy parameter is a transparent proxy or a real object.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern bool IsTransparentProxy(Object proxy);
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/SByte.cs b/source/nanoFramework.CoreLibrary/System/SByte.cs
index f717e12d..8c7e4c6a 100644
--- a/source/nanoFramework.CoreLibrary/System/SByte.cs
+++ b/source/nanoFramework.CoreLibrary/System/SByte.cs
@@ -59,7 +59,9 @@ public String ToString(String format)
[CLSCompliant(false)]
public static sbyte Parse(String s)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (s == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
return Convert.ToSByte(s);
}
diff --git a/source/nanoFramework.CoreLibrary/System/String.cs b/source/nanoFramework.CoreLibrary/System/String.cs
index ab5579ec..5751fc99 100644
--- a/source/nanoFramework.CoreLibrary/System/String.cs
+++ b/source/nanoFramework.CoreLibrary/System/String.cs
@@ -16,7 +16,9 @@ namespace System
///////////////////////////////////////////////////////////////////////////////////////////////////////
// GetHashCode() implementation is provided by general native function CLR_RT_HeapBlock::GetHashCode //
///////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma warning disable S1206 // "Equals(Object)" and "GetHashCode()" should be overridden in pairs
public sealed class String : IComparable
+#pragma warning restore S1206 // "Equals(Object)" and "GetHashCode()" should be overridden in pairs
#pragma warning restore CS0661 // Type defines operator == or operator != but does not override Object.GetHashCode()
#pragma warning restore CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
{
@@ -42,7 +44,9 @@ public override bool Equals(object obj)
/// The second string to compare, or null.
/// true if the value of a is the same as the value of b; otherwise, false. If both a and b are null, the method returns true.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern bool Equals(String a, String b);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Determines whether two specified strings have the same value.
@@ -79,7 +83,9 @@ public extern char this[int index]
///
/// A Unicode character array whose elements are the individual characters of this instance. If this instance is an empty string, the returned array is empty and has a zero length.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern char[] ToCharArray();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Copies the characters in a specified substring in this instance to a Unicode character array.
@@ -88,7 +94,9 @@ public extern char this[int index]
/// The length of the substring in this instance.
/// A Unicode character array whose elements are the length number of characters in this instance starting from character position startIndex.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern char[] ToCharArray(int startIndex, int length);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Gets the number of characters in the current String object.
@@ -108,7 +116,9 @@ public extern int Length
/// A character array that delimits the substrings in this string, an empty array that contains no delimiters, or null.
/// An array whose elements contain the substrings from this instance that are delimited by one or more characters in separator. For more information, see the Remarks section.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern String[] Split(params char[] separator);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Splits a string into a maximum number of substrings based on the characters in an array. You also specify the maximum number of substrings to return.
@@ -117,7 +127,9 @@ public extern int Length
/// The maximum number of substrings to return.
/// An array whose elements contain the substrings in this instance that are delimited by one or more characters in separator. For more information, see the Remarks section.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern String[] Split(char[] separator, int count);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Retrieves a substring from this instance. The substring starts at a specified character position and continues to the end of the string.
@@ -125,7 +137,9 @@ public extern int Length
/// The zero-based starting character position of a substring in this instance.
/// A string that is equivalent to the substring that begins at startIndex in this instance, or Empty if startIndex is equal to the length of this instance.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern String Substring(int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.
@@ -134,7 +148,9 @@ public extern int Length
/// The number of characters in the substring.
/// A string that is equivalent to the substring of length length that begins at startIndex in this instance, or Empty if startIndex is equal to the length of this instance and length is zero.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern String Substring(int startIndex, int length);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Removes all leading and trailing occurrences of a set of characters specified in an array from the current String object.
@@ -144,7 +160,9 @@ public extern int Length
/// If trimChars is null or an empty array, white-space characters are removed instead. If no characters can be trimmed from the current instance,
/// the method returns the current instance unchanged.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern String Trim(params char[] trimChars);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Removes all leading occurrences of a set of characters specified in an array from the current String object.
@@ -152,7 +170,9 @@ public extern int Length
/// An array of Unicode characters to remove, or null.
/// The string that remains after all occurrences of characters in the trimChars parameter are removed from the start of the current string. If trimChars is null or an empty array, white-space characters are removed instead.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern String TrimStart(params char[] trimChars);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Removes all trailing occurrences of a set of characters specified in an array from the current String object.
@@ -160,7 +180,9 @@ public extern int Length
/// An array of Unicode characters to remove, or null.
/// The string that remains after all occurrences of the characters in the trimChars parameter are removed from the end of the current string. If trimChars is null or an empty array, Unicode white-space characters are removed instead. If no characters can be trimmed from the current instance, the method returns the current instance unchanged.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern String TrimEnd(params char[] trimChars);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Initializes a new instance of the String class to the value indicated by an array of Unicode characters, a starting character position within that array, and a length.
@@ -193,7 +215,9 @@ public extern int Length
/// The second string to compare.
/// A 32-bit signed integer that indicates the lexical relationship between the two comparands.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern int Compare(String strA, String strB);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Compares this instance with a specified Object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified Object.
@@ -201,7 +225,9 @@ public extern int Length
/// An object that evaluates to a String.
/// A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int CompareTo(Object value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Compares this instance with a specified String object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified string.
@@ -209,7 +235,9 @@ public extern int Length
/// The string to compare with this instance.
/// A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the strB parameter.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int CompareTo(String strB);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index of the first occurrence of the specified Unicode character in this string.
@@ -217,7 +245,9 @@ public extern int Length
/// A Unicode character to seek.
/// The zero-based index position of value if that character is found, or -1 if it is not.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int IndexOf(char value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index of the first occurrence of the specified Unicode character in this string. The search starts at a specified character position.
@@ -226,7 +256,9 @@ public extern int Length
/// The search starting position.
/// The zero-based index position of value from the start of the string if that character is found, or -1 if it is not.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int IndexOf(char value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index of the first occurrence of the specified character in this instance. The search starts at a specified character position and examines a specified number of character positions.
@@ -236,7 +268,9 @@ public extern int Length
/// The number of character positions to examine.
/// The zero-based index position of value if that character is found, or -1 if it is not.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int IndexOf(char value, int startIndex, int count);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters.
@@ -244,7 +278,9 @@ public extern int Length
/// A Unicode character array containing one or more characters to seek.
/// The zero-based index position of the first occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int IndexOfAny(char[] anyOf);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters. The search starts at a specified character position.
@@ -253,7 +289,9 @@ public extern int Length
/// The search starting position.
/// The zero-based index position of the first occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int IndexOfAny(char[] anyOf, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters. The search starts at a specified character position and examines a specified number of character positions.
@@ -263,7 +301,9 @@ public extern int Length
/// The number of character positions to examine.
/// The zero-based index position of the first occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int IndexOfAny(char[] anyOf, int startIndex, int count);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index of the first occurrence of the specified string in this instance.
@@ -271,7 +311,9 @@ public extern int Length
/// The string to seek.
/// The zero-based index position of value if that string is found, or -1 if it is not. If value is String.Empty, the return value is 0.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int IndexOf(String value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position.
@@ -280,7 +322,9 @@ public extern int Length
/// The search starting position.
/// The zero-based index position of value from the start of the current instance if that string is found, or -1 if it is not. If value is String.Empty, the return value is startIndex.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int IndexOf(String value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position and examines a specified number of character positions.
@@ -290,7 +334,9 @@ public extern int Length
/// The number of character positions to examine.
/// The zero-based index position of value from the start of the current instance if that string is found, or -1 if it is not. If value is String.Empty, the return value is startIndex.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int IndexOf(String value, int startIndex, int count);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance.
@@ -298,7 +344,9 @@ public extern int Length
/// The Unicode character to seek.
/// The zero-based index position of value if that character is found, or -1 if it is not.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int LastIndexOf(char value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string.
@@ -307,7 +355,9 @@ public extern int Length
/// The starting position of the search. The search proceeds from startIndex toward the beginning of this instance.
/// The zero-based index position of value if that character is found, or -1 if it is not found or if the current instance equals String.Empty.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int LastIndexOf(char value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index position of the last occurrence of the specified Unicode character in a substring within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string for a specified number of character positions.
@@ -317,7 +367,9 @@ public extern int Length
/// The number of character positions to examine.
/// The zero-based index position of value if that character is found, or -1 if it is not found or if the current instance equals String.Empty.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int LastIndexOf(char value, int startIndex, int count);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array.
@@ -325,7 +377,9 @@ public extern int Length
/// A Unicode character array containing one or more characters to seek.
/// The index position of the last occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int LastIndexOfAny(char[] anyOf);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array. The search starts at a specified character position and proceeds backward toward the beginning of the string.
@@ -334,7 +388,9 @@ public extern int Length
/// The search starting position. The search proceeds from startIndex toward the beginning of this instance.
/// The index position of the last occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found or if the current instance equals String.Empty.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int LastIndexOfAny(char[] anyOf, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array. The search starts at a specified character position and proceeds backward toward the beginning of the string for a specified number of character positions.
@@ -344,7 +400,9 @@ public extern int Length
/// The number of character positions to examine.
/// The index position of the last occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found or if the current instance equals String.Empty.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int LastIndexOfAny(char[] anyOf, int startIndex, int count);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index position of the last occurrence of a specified string within this instance.
@@ -352,7 +410,9 @@ public extern int Length
/// The string to seek.
/// The zero-based starting index position of value if that string is found, or -1 if it is not. If value is String.Empty, the return value is the last index position in this instance.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int LastIndexOf(String value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index position of the last occurrence of a specified string within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string.
@@ -361,7 +421,9 @@ public extern int Length
/// The search starting position. The search proceeds from startIndex toward the beginning of this instance.
/// The zero-based starting index position of value if that string is found, or -1 if it is not found or if the current instance equals String.Empty. If value is String.Empty, the return value is the smaller of startIndex and the last index position in this instance.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int LastIndexOf(String value, int startIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Reports the zero-based index position of the last occurrence of a specified string within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string for a specified number of character positions.
@@ -371,21 +433,27 @@ public extern int Length
/// The number of character positions to examine.
/// The zero-based starting index position of value if that string is found, or -1 if it is not found or if the current instance equals String.Empty. If value is Empty, the return value is the smaller of startIndex and the last index position in this instance.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int LastIndexOf(String value, int startIndex, int count);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a copy of this string converted to lowercase.
///
/// A string in lowercase.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern String ToLower();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a copy of this string converted to uppercase.
///
/// The uppercase equivalent of the current string.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern String ToUpper();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns this instance of String; no actual conversion is performed.
@@ -401,7 +469,9 @@ public override String ToString()
///
/// The string that remains after all white-space characters are removed from the start and end of the current string. If no characters can be trimmed from the current instance, the method returns the current instance unchanged.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern String Trim();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Creates the string representation of a specified object.
///
@@ -488,7 +558,9 @@ public static String Concat(params Object[] args)
/// The second string to concatenate.
/// The concatenation of str0 and str1.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern String Concat(String str0, String str1);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Concatenates three specified instances of String.
@@ -498,7 +570,9 @@ public static String Concat(params Object[] args)
/// The third string to concatenate.
/// The concatenation of str0, str1 and str2.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern String Concat(String str0, String str1, String str2);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Concatenates four specified instances of String.
@@ -509,7 +583,9 @@ public static String Concat(params Object[] args)
/// The fourth string to concatenate.
/// The concatenation of str0, str1, str2 and str3.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern String Concat(String str0, String str1, String str2, String str3);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Concatenates the elements of a specified String array.
@@ -517,7 +593,9 @@ public static String Concat(params Object[] args)
/// An array of string instances.
/// The concatenated elements of values.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern String Concat(params String[] values);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Retrieves the system's reference to the specified String.
@@ -744,7 +822,9 @@ public String PadLeft(int totalWidth, char paddingChar = ' ')
{
if (totalWidth < 0)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentOutOfRangeException("totalWidth can't be less than 0");
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
if (Length >= totalWidth)
@@ -767,7 +847,9 @@ public String PadRight(int totalWidth, char paddingChar = ' ')
{
if (totalWidth < 0)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentOutOfRangeException("totalWidth can't be less than 0");
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
if (Length >= totalWidth)
diff --git a/source/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs b/source/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs
index 42ed69ca..86200ccd 100644
--- a/source/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs
+++ b/source/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs
@@ -22,7 +22,9 @@ public sealed class TargetFrameworkAttribute : Attribute
///
public TargetFrameworkAttribute(String frameworkName)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (frameworkName == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
_frameworkName = frameworkName;
}
@@ -37,6 +39,7 @@ public String FrameworkName
get { return _frameworkName; }
}
+#pragma warning disable S2292 // Trivial properties should be auto-implemented
///
/// Gets the display name of the .NET Framework version against which an assembly was built.
///
@@ -44,6 +47,7 @@ public String FrameworkName
/// The display name of the .NET Framework version.
///
public String FrameworkDisplayName
+#pragma warning restore S2292 // Trivial properties should be auto-implemented
{
get { return _frameworkDisplayName; }
set { _frameworkDisplayName = value; }
diff --git a/source/nanoFramework.CoreLibrary/System/Text/StringBuilder.cs b/source/nanoFramework.CoreLibrary/System/Text/StringBuilder.cs
index ae4adb71..3e1e7387 100644
--- a/source/nanoFramework.CoreLibrary/System/Text/StringBuilder.cs
+++ b/source/nanoFramework.CoreLibrary/System/Text/StringBuilder.cs
@@ -53,14 +53,18 @@ public char this[int index]
{
if (num >= chunkPrevious._chunkLength)
{
+#pragma warning disable S112 // General exceptions should never be thrown
throw new IndexOutOfRangeException();
+#pragma warning restore S112 // General exceptions should never be thrown
}
return chunkPrevious._chunkChars[num];
}
chunkPrevious = chunkPrevious._chunkPrevious;
if (chunkPrevious == null)
{
+#pragma warning disable S112 // General exceptions should never be thrown
throw new IndexOutOfRangeException();
+#pragma warning restore S112 // General exceptions should never be thrown
}
}
}
@@ -402,12 +406,14 @@ public StringBuilder Append(string value)
return this;
}
+#pragma warning disable CS3001 // Argument type 'sbyte' is not CLS-compliant
///
/// Appends the string representation of a specified 8-bit signed integer to this instance.
///
/// The value to append.
/// A reference to this instance after the append operation has completed.
public StringBuilder Append(sbyte value)
+#pragma warning restore CS3001 // Argument type 'sbyte' is not CLS-compliant
{
return Append(value.ToString());
}
@@ -422,32 +428,38 @@ public StringBuilder Append(float value)
return Append(value.ToString());
}
+#pragma warning disable CS3001 // Argument type 'ushort' is not CLS-compliant
///
/// Appends the string representation of a specified 16-bit unsigned integer to this instance.
///
/// The value to append.
/// A reference to this instance after the append operation has completed.
public StringBuilder Append(ushort value)
+#pragma warning restore CS3001 // Argument type 'ushort' is not CLS-compliant
{
return Append(value.ToString());
}
+#pragma warning disable CS3001 // Argument type 'uint' is not CLS-compliant
///
/// Appends the string representation of a specified 32-bit unsigned integer to this instance.
///
/// The value to append.
/// A reference to this instance after the append operation has completed.
public StringBuilder Append(uint value)
+#pragma warning restore CS3001 // Argument type 'uint' is not CLS-compliant
{
return Append(value.ToString());
}
+#pragma warning disable CS3001 // Argument type 'ulong' is not CLS-compliant
///
/// Appends the string representation of a specified 64-bit unsigned integer to this instance.
///
/// The value to append.
/// A reference to this instance after the append operation has completed.
public StringBuilder Append(ulong value)
+#pragma warning restore CS3001 // Argument type 'ulong' is not CLS-compliant
{
return Append(value.ToString());
}
@@ -486,13 +498,17 @@ public StringBuilder Append(string value, int startIndex, int count)
public StringBuilder Append(char[] value, int startIndex, int charCount)
{
if (startIndex < 0) throw new ArgumentOutOfRangeException("startIndex");
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (charCount < 0) throw new ArgumentOutOfRangeException("count");
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (value == null)
{
if (startIndex != 0 || charCount != 0) throw new ArgumentNullException("value");
return this;
}
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (charCount > value.Length - startIndex) throw new ArgumentOutOfRangeException("count");
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (charCount != 0)
{
for (var i = startIndex; i < startIndex + charCount; ++i)
@@ -544,7 +560,9 @@ public StringBuilder Remove(int startIndex, int length)
{
if (length < 0) throw new ArgumentOutOfRangeException("length");
if (startIndex < 0) throw new ArgumentOutOfRangeException("startIndex");
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (length > Length - startIndex) throw new ArgumentOutOfRangeException("index");
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (Length == length && startIndex == 0)
{
Length = 0;
@@ -623,7 +641,9 @@ public string ToString(int startIndex, int length)
var chunkChars = chunkPrevious._chunkChars;
if (charCount + num3 > length || charCount + index > chunkChars.Length)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentOutOfRangeException("chunkCount");
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
Array.Copy(chunkChars, index, result, 0, charCount);
}
@@ -651,7 +671,9 @@ public StringBuilder Insert(int index, string value, int count)
StringBuilder builder;
int num3;
long num2 = value.Length * count;
+#pragma warning disable S112 // General exceptions should never be thrown
if (num2 > MaxCapacity - Length) throw new OutOfMemoryException();
+#pragma warning restore S112 // General exceptions should never be thrown
MakeRoom(index, (int)num2, out builder, out num3, false);
var chars = value.ToCharArray();
var charLength = chars.Length;
@@ -683,7 +705,9 @@ public StringBuilder Insert(int index, char[] value, int startIndex, int charCou
return this;
}
if (startIndex < 0) throw new ArgumentOutOfRangeException("startIndex");
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (charCount < 0) throw new ArgumentOutOfRangeException("count");
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (startIndex > value.Length - charCount) throw new ArgumentOutOfRangeException("startIndex");
if (charCount > 0) Insert(index, new string(value, startIndex, charCount), 1);
@@ -957,7 +981,9 @@ private void ReplaceInPlaceAtChunk(ref StringBuilder chunk, ref int indexInChunk
internal void MakeRoom(int index, int count, out StringBuilder chunk, out int indexInChunk, bool doneMoveFollowingChars)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (count + Length > _maxCapacity) throw new ArgumentOutOfRangeException("requiredLength");
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
chunk = this;
while (chunk._chunkOffset > index)
{
@@ -1015,7 +1041,9 @@ internal void AppendHelper(ref string value)
internal void ExpandByABlock(int minBlockCharCount)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (minBlockCharCount + Length > _maxCapacity) throw new ArgumentOutOfRangeException("requiredLength");
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
var num = MathInternal.Max(minBlockCharCount, MathInternal.Min(Length, 0x1f40));
_chunkPrevious = new StringBuilder(this);
_chunkOffset += _chunkLength;
@@ -1024,7 +1052,9 @@ internal void ExpandByABlock(int minBlockCharCount)
if (_chunkOffset + num < num)
{
_chunkChars = null;
+#pragma warning disable S112 // General exceptions should never be thrown
throw new OutOfMemoryException();
+#pragma warning restore S112 // General exceptions should never be thrown
}
_chunkChars = new char[num];
}
diff --git a/source/nanoFramework.CoreLibrary/System/Text/UTF8Encoding.cs b/source/nanoFramework.CoreLibrary/System/Text/UTF8Encoding.cs
index 0aa4ba80..7688f469 100644
--- a/source/nanoFramework.CoreLibrary/System/Text/UTF8Encoding.cs
+++ b/source/nanoFramework.CoreLibrary/System/Text/UTF8Encoding.cs
@@ -62,7 +62,9 @@ public UTF8Encoding()
///
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public override extern byte[] GetBytes(String s);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Encodes a set of characters from the specified into the specified byte array.
@@ -74,7 +76,9 @@ public UTF8Encoding()
/// The index at which to start writing the resulting sequence of bytes.
/// The actual number of bytes written into .
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public override extern int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
@@ -82,7 +86,9 @@ public UTF8Encoding()
/// The byte array containing the sequence of bytes to decode.
/// The actual number of characters returned.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public override extern char[] GetChars(byte[] bytes);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Decodes a sequence of bytes from the specified byte array into a set of characters.
@@ -92,7 +98,9 @@ public UTF8Encoding()
/// The number of bytes to decode.
/// The actual number of characters returned.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public override extern char[] GetChars(byte[] bytes, int byteIndex, int byteCount);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Obtains a decoder that converts a UTF-8 encoded sequence of bytes into a sequence of Unicode characters.
diff --git a/source/nanoFramework.CoreLibrary/System/Threading/AutoResetEvent.cs b/source/nanoFramework.CoreLibrary/System/Threading/AutoResetEvent.cs
index 26ff8954..13ac7b17 100644
--- a/source/nanoFramework.CoreLibrary/System/Threading/AutoResetEvent.cs
+++ b/source/nanoFramework.CoreLibrary/System/Threading/AutoResetEvent.cs
@@ -24,13 +24,17 @@ public sealed class AutoResetEvent : WaitHandle
///
/// true if the operation succeeds; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern bool Reset();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Sets the state of the event to signaled, allowing one or more waiting threads to proceed.
///
/// true if the operation succeeds; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern bool Set();
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Threading/Interlocked.cs b/source/nanoFramework.CoreLibrary/System/Threading/Interlocked.cs
index 5742a780..99a199fe 100644
--- a/source/nanoFramework.CoreLibrary/System/Threading/Interlocked.cs
+++ b/source/nanoFramework.CoreLibrary/System/Threading/Interlocked.cs
@@ -23,7 +23,9 @@ public static class Interlocked
/// The variable whose value is to be incremented.
/// The incremented value.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern int Increment(ref int location);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Decrements a specified variable and stores the result, as an atomic operation.
@@ -31,7 +33,9 @@ public static class Interlocked
/// The variable whose value is to be decremented.
/// The decremented value.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern int Decrement(ref int location);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Sets a 32-bit signed integer to a specified value and returns the original value, as an atomic operation.
@@ -40,7 +44,9 @@ public static class Interlocked
/// The value to which the location1 parameter is set.
/// The original value of location1.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern int Exchange(ref int location1, int value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value.
@@ -50,6 +56,8 @@ public static class Interlocked
/// The value that is compared to the value at location1.
/// The original value in location1.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern int CompareExchange(ref int location1, int value, int comparand);
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Threading/ManualResetEvent.cs b/source/nanoFramework.CoreLibrary/System/Threading/ManualResetEvent.cs
index 6c6f2b3e..441fd992 100644
--- a/source/nanoFramework.CoreLibrary/System/Threading/ManualResetEvent.cs
+++ b/source/nanoFramework.CoreLibrary/System/Threading/ManualResetEvent.cs
@@ -24,13 +24,17 @@ public sealed class ManualResetEvent : WaitHandle
///
/// true if the operation succeeds; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern bool Reset();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Sets the state of the event to signaled, allowing one or more waiting threads to proceed.
///
/// true if the operation succeeds; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern bool Set();
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Threading/Monitor.cs b/source/nanoFramework.CoreLibrary/System/Threading/Monitor.cs
index 2bd6e959..fe8f4ffb 100644
--- a/source/nanoFramework.CoreLibrary/System/Threading/Monitor.cs
+++ b/source/nanoFramework.CoreLibrary/System/Threading/Monitor.cs
@@ -19,13 +19,17 @@ public static class Monitor
///
/// The object on which to acquire the monitor lock.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern void Enter(Object obj);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Releases an exclusive lock on the specified object.
///
/// The object on which to release the lock.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern void Exit(Object obj);
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Threading/Thread.cs b/source/nanoFramework.CoreLibrary/System/Threading/Thread.cs
index ff694313..d8a7a901 100644
--- a/source/nanoFramework.CoreLibrary/System/Threading/Thread.cs
+++ b/source/nanoFramework.CoreLibrary/System/Threading/Thread.cs
@@ -36,25 +36,33 @@ public sealed class Thread
/// Causes the operating system to change the state of the current instance to ThreadState.Running.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern void Start();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Raises a ThreadAbortException in the thread on which it is invoked, to begin the process of terminating the thread. Calling this method usually terminates the thread.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern void Abort();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Either suspends the thread, or if the thread is already suspended, has no effect.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern void Suspend();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Obsolete : Resumes a thread that has been suspended.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern void Resume();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Gets or sets a value indicating the scheduling priority of a thread.
@@ -93,7 +101,9 @@ public extern bool IsAlive
/// Blocks the calling thread until the thread represented by this instance terminates, while continuing to perform standard COM and SendMessage pumping.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern void Join();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Blocks the calling thread until the thread represented by this instance terminates or the specified time elapses, while continuing to perform standard COM and SendMessage pumping.
@@ -101,7 +111,9 @@ public extern bool IsAlive
/// The number of milliseconds to wait for the thread to terminate.
/// true if the thread has terminated; false if the thread has not terminated after the amount of time specified by the millisecondsTimeout parameter has elapsed.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern bool Join(int millisecondsTimeout);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Blocks the calling thread until the thread represented by this instance terminates or the specified time elapses, while continuing to perform standard COM and SendMessage pumping.
@@ -109,7 +121,9 @@ public extern bool IsAlive
/// A TimeSpan set to the amount of time to wait for the thread to terminate.
/// true if the thread terminated; false if the thread has not terminated after the amount of time specified by the timeout parameter has elapsed.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern bool Join(TimeSpan timeout);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Suspends the current thread for the specified number of milliseconds.
@@ -124,7 +138,9 @@ public extern bool IsAlive
/// The system clock ticks at a specific rate called the clock resolution. The actual timeout might not be exactly the specified timeout, because the specified timeout will be adjusted to coincide with clock ticks.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern void Sleep(int millisecondsTimeout);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Suspends the current thread for the specified amount of time.
@@ -143,7 +159,9 @@ public static void Sleep(TimeSpan timeout)
long tm = timeout.Ticks / TimeSpan.TicksPerMillisecond;
if (tm < -1 || tm > Int32.MaxValue)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
throw new ArgumentOutOfRangeException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
}
Sleep((int)tm);
}
@@ -175,7 +193,9 @@ public extern ThreadState ThreadState
///
/// An AppDomain representing the current application domain of the running thread.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern AppDomain GetDomain();
+#pragma warning restore S4200 // Native methods should be wrapped
#endif // #if (NANOCLR_APPDOMAINS)
diff --git a/source/nanoFramework.CoreLibrary/System/Threading/Timer.cs b/source/nanoFramework.CoreLibrary/System/Threading/Timer.cs
index d8b18f5b..317681e9 100644
--- a/source/nanoFramework.CoreLibrary/System/Threading/Timer.cs
+++ b/source/nanoFramework.CoreLibrary/System/Threading/Timer.cs
@@ -57,7 +57,9 @@ public sealed class Timer : MarshalByRefObject, IDisposable
/// Specify Timeout.Infinite to disable periodic signaling.
/// true if the timer was successfully updated; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern bool Change(int dueTime, int period);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Changes the start time and the interval between method invocations for a timer, using TimeSpan values to measure time intervals.
@@ -67,13 +69,17 @@ public sealed class Timer : MarshalByRefObject, IDisposable
/// The time interval between invocations of the callback method specified when the Timer was constructed. Specify negative one (-1) milliseconds to disable periodic signaling.
/// true if the timer was successfully updated; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern bool Change(TimeSpan dueTime, TimeSpan period);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Releases all resources used by the current instance of Timer.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern void Dispose();
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Threading/WaitHandle.cs b/source/nanoFramework.CoreLibrary/System/Threading/WaitHandle.cs
index 96d38415..d54134f5 100644
--- a/source/nanoFramework.CoreLibrary/System/Threading/WaitHandle.cs
+++ b/source/nanoFramework.CoreLibrary/System/Threading/WaitHandle.cs
@@ -26,7 +26,9 @@ public abstract class WaitHandle : MarshalByRefObject
/// true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.
/// true if the current instance receives a signal; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern bool WaitOne(int millisecondsTimeout, bool exitContext);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Blocks the current thread until the current WaitHandle receives a signal.
@@ -40,6 +42,7 @@ public virtual bool WaitOne()
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int WaitMultiple(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext, bool waitAll);
+#pragma warning disable S4200 // Native methods should be wrapped
///
/// Waits for all the elements in the specified array to receive a signal, using an Int32 value to specify the time interval and specifying whether to exit the synchronization domain before the wait.
///
@@ -48,6 +51,7 @@ public virtual bool WaitOne()
/// true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.
/// true when every element in waitHandles has received a signal; otherwise, false.
public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
+#pragma warning restore S4200 // Native methods should be wrapped
{
return WaitMultiple(waitHandles, millisecondsTimeout, exitContext, true /* waitall*/ ) != WaitTimeout;
}
@@ -62,6 +66,7 @@ public static bool WaitAll(WaitHandle[] waitHandles)
return WaitAll(waitHandles, Timeout.Infinite, true);
}
+#pragma warning disable S4200 // Native methods should be wrapped
///
/// Waits for any of the elements in the specified array to receive a signal, using a 32-bit signed integer to specify the time interval, and specifying whether to exit the synchronization domain before the wait.
///
@@ -70,6 +75,7 @@ public static bool WaitAll(WaitHandle[] waitHandles)
/// true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.
/// The array index of the object that satisfied the wait, or WaitTimeout if no object satisfied the wait and a time interval equivalent to millisecondsTimeout has passed.
public static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
+#pragma warning restore S4200 // Native methods should be wrapped
{
return WaitMultiple(waitHandles, millisecondsTimeout, exitContext, false /* waitany*/ );
}
diff --git a/source/nanoFramework.CoreLibrary/System/TimeSpan.cs b/source/nanoFramework.CoreLibrary/System/TimeSpan.cs
index 4ce1c464..df3b673b 100644
--- a/source/nanoFramework.CoreLibrary/System/TimeSpan.cs
+++ b/source/nanoFramework.CoreLibrary/System/TimeSpan.cs
@@ -202,7 +202,9 @@ public double TotalMilliseconds
/// 1 if t1 is longer than t2.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern int Compare(TimeSpan t1, TimeSpan t2);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Compares this instance to a specified object and returns an integer that indicates whether this instance is shorter than, equal to, or longer than the specified object.
@@ -214,7 +216,9 @@ public double TotalMilliseconds
/// 1 if This instance is longer than value or value is null.
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern int CompareTo(Object value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a new object whose value is the absolute value of the current object.
@@ -228,7 +232,9 @@ public double TotalMilliseconds
/// An object to compare with this instance.
/// true if value is a object that represents the same time interval as the current structure; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public override extern bool Equals(Object value);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a value that indicates whether two specified instances of are equal.
@@ -237,7 +243,9 @@ public double TotalMilliseconds
/// The second time interval to compare.
/// true if the values of t1 and t2 are equal; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern bool Equals(TimeSpan t1, TimeSpan t2);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a new object whose value is the negated value of this instance.
@@ -300,7 +308,9 @@ public double TotalMilliseconds
/// The string representation of the current value.
/// The returned string is formatted with the "c" format specifier and has the following format: [-][d.]hh:mm:ss[.fffffff]
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public override extern String ToString();
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a whose value is the negated value of the specified instance.
diff --git a/source/nanoFramework.CoreLibrary/System/Type.cs b/source/nanoFramework.CoreLibrary/System/Type.cs
index 2a7dfdc1..19f900d2 100644
--- a/source/nanoFramework.CoreLibrary/System/Type.cs
+++ b/source/nanoFramework.CoreLibrary/System/Type.cs
@@ -74,7 +74,9 @@ public static Type GetType(String typeName)
[Diagnostics.DebuggerStepThrough]
[Diagnostics.DebuggerHidden]
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern Object InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Gets the Assembly in which the type is declared. For generic types, gets the Assembly in which the generic type is defined.
@@ -94,7 +96,9 @@ public abstract Assembly Assembly
/// The object that refers to the type.
/// The type referenced by the specified RuntimeTypeHandle, or null if the Value property of handle is null.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public static extern Type GetTypeFromHandle(RuntimeTypeHandle handle);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Gets the fully qualified name of the type, including its namespace but not its assembly.
@@ -140,7 +144,9 @@ public abstract Type BaseType
///
/// An object representing the public instance constructor whose parameters match the types in the parameter type array, if found; otherwise, null.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern ConstructorInfo GetConstructor(Type[] types);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Searches for the specified public method whose parameters match the specified argument types.
@@ -152,7 +158,9 @@ public abstract Type BaseType
///
/// An object representing the public method whose parameters match the specified argument types, if found; otherwise, null.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern MethodInfo GetMethod(String name, Type[] types);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Searches for the specified method, using the specified binding constraints.
@@ -161,7 +169,9 @@ public abstract Type BaseType
/// A bitmask comprised of one or more BindingFlags that specify how the search is conducted or Zero, to return null.
/// An object representing the method that matches the specified requirements, if found; otherwise, null.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern MethodInfo GetMethod(String name, BindingFlags bindingAttr);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Searches for the public method with the specified name.
@@ -169,7 +179,9 @@ public abstract Type BaseType
/// The string containing the name of the public method to get.
/// An object that represents the public method with the specified name, if found; otherwise, null.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public extern MethodInfo GetMethod(String name);
+#pragma warning restore S4200 // Native methods should be wrapped
// GetMethods
// This routine will return all the methods implemented by the class
@@ -379,7 +391,9 @@ public virtual bool IsSubclassOf(Type c)
/// false if neither of these conditions is the case, if o is null, or if the current Type is an open generic type (that is, ContainsGenericParameters returns true).
///
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public virtual extern bool IsInstanceOfType(Object o);
+#pragma warning restore S4200 // Native methods should be wrapped
///
/// Returns a String representing the name of the current Type.
@@ -411,7 +425,9 @@ private static string ParseTypeName(String typeName, ref String assemblyString)
name = typeName.Substring(0, commaIdx);
// after the comma we need ONE (1) space only and then the assembly name
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (typeName.Length <= commaIdx + 2) throw new ArgumentException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
// now we can grab the assemblyName
// at this point there could be also the Version appended to it
diff --git a/source/nanoFramework.CoreLibrary/System/UInt16.cs b/source/nanoFramework.CoreLibrary/System/UInt16.cs
index b6dacaa3..a49e1dec 100644
--- a/source/nanoFramework.CoreLibrary/System/UInt16.cs
+++ b/source/nanoFramework.CoreLibrary/System/UInt16.cs
@@ -58,7 +58,9 @@ public String ToString(String format)
[CLSCompliant(false)]
public static ushort Parse(String s)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (s == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
return Convert.ToUInt16(s);
}
diff --git a/source/nanoFramework.CoreLibrary/System/UInt32.cs b/source/nanoFramework.CoreLibrary/System/UInt32.cs
index d6077516..34a2cca3 100644
--- a/source/nanoFramework.CoreLibrary/System/UInt32.cs
+++ b/source/nanoFramework.CoreLibrary/System/UInt32.cs
@@ -58,7 +58,9 @@ public String ToString(String format)
[CLSCompliant(false)]
public static uint Parse(String s)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (s == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
return Convert.ToUInt32(s);
}
diff --git a/source/nanoFramework.CoreLibrary/System/UInt64.cs b/source/nanoFramework.CoreLibrary/System/UInt64.cs
index c5fca44c..8152dbaf 100644
--- a/source/nanoFramework.CoreLibrary/System/UInt64.cs
+++ b/source/nanoFramework.CoreLibrary/System/UInt64.cs
@@ -55,7 +55,9 @@ public String ToString(String format)
[CLSCompliant(false)]
public static ulong Parse(String s)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (s == null) throw new ArgumentNullException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
return Convert.ToUInt64(s);
}
diff --git a/source/nanoFramework.CoreLibrary/System/ValueType.cs b/source/nanoFramework.CoreLibrary/System/ValueType.cs
index f78995c3..d27900ee 100644
--- a/source/nanoFramework.CoreLibrary/System/ValueType.cs
+++ b/source/nanoFramework.CoreLibrary/System/ValueType.cs
@@ -16,7 +16,9 @@ namespace System
///////////////////////////////////////////////////////////////////////////////////////////////////////
// GetHashCode() implementation is provided by general native function CLR_RT_HeapBlock::GetHashCode //
///////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma warning disable S1206 // "Equals(Object)" and "GetHashCode()" should be overridden in pairs
public abstract class ValueType
+#pragma warning restore S1206 // "Equals(Object)" and "GetHashCode()" should be overridden in pairs
#pragma warning restore CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
{
@@ -26,6 +28,8 @@ public abstract class ValueType
/// The object to compare with the current instance.
/// true if obj and this instance are the same type and represent the same value; otherwise, false.
[MethodImpl(MethodImplOptions.InternalCall)]
+#pragma warning disable S4200 // Native methods should be wrapped
public override extern bool Equals(Object obj);
+#pragma warning restore S4200 // Native methods should be wrapped
}
}
diff --git a/source/nanoFramework.CoreLibrary/System/Version.cs b/source/nanoFramework.CoreLibrary/System/Version.cs
index 3fb9d1ec..b6744ea8 100644
--- a/source/nanoFramework.CoreLibrary/System/Version.cs
+++ b/source/nanoFramework.CoreLibrary/System/Version.cs
@@ -27,7 +27,9 @@ public sealed class Version // : ICloneable, IComparable, IComparable,
///
public Version(int major, int minor, int build, int revision)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (major < 0 || minor < 0 || revision < 0 || build < 0) throw new ArgumentOutOfRangeException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
_Major = major;
_Minor = minor;
@@ -43,8 +45,12 @@ public Version(int major, int minor, int build, int revision)
///
public Version(int major, int minor)
{
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (major < 0) throw new ArgumentOutOfRangeException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
+#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one
if (minor < 0) throw new ArgumentOutOfRangeException();
+#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one
_Major = major;
_Minor = minor;