Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several fixes throughout the code base #74

Merged
merged 1 commit into from
Jun 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/nanoFramework.CoreLibrary/System/AppDomain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/// <summary>
Expand All @@ -40,7 +42,9 @@ private AppDomain()
/// <param name="friendlyName">The friendly name of the domain.</param>
/// <returns>The newly created application domain.</returns>
[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

/// <summary>
/// Creates a new instance of the specified type. Parameters specify the assembly where the type is defined, and the name of the type.
Expand Down Expand Up @@ -106,7 +110,9 @@ public Assembly Load(String assemblyString)
/// </summary>
/// <returns>An array of assemblies in this application domain.</returns>
[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);
Expand All @@ -116,7 +122,9 @@ public Assembly Load(String assemblyString)
/// </summary>
/// <param name="domain">An application domain to unload.</param>
[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)
8 changes: 8 additions & 0 deletions source/nanoFramework.CoreLibrary/System/Array.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,19 @@ public abstract class Array : ICloneable, IList
/// <para>Reference-type elements are initialized to nullNothingnullptrunit a null reference(Nothing in Visual Basic). Value-type elements are initialized to zero.</para>
/// <para>This method is an O(n) operation, where n is length.</para></remarks>
[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
/// <summary>
/// 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.
/// </summary>
/// <param name="sourceArray">The Array that contains the data to copy.</param>
/// <param name="destinationArray">The Array that receives the data.</param>
/// <param name="length">A 32-bit integer that represents the number of elements to copy.</param>
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);
}
Expand All @@ -48,7 +52,9 @@ public static void Copy(Array sourceArray, Array destinationArray, int length)
/// <param name="destinationIndex">A 32-bit integer that represents the index in the destinationArray at which storing begins.</param>
/// <param name="length">A 32-bit integer that represents the number of elements to copy.</param>
[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

/// <summary>
/// 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.
Expand All @@ -57,7 +63,9 @@ public static void Copy(Array sourceArray, Array destinationArray, int length)
/// <param name="index">The starting index of the range of elements to clear.</param>
/// <param name="length">The number of elements to clear.</param>
[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

/// <summary>
/// Gets the value at the specified position in the one-dimensional Array. The index is specified as a 32-bit integer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,25 @@ public AttributeTargets ValidOn
get { return _attributeTarget; }
}

#pragma warning disable S2292 // Trivial properties should be auto-implemented
/// <summary>
/// Gets or sets a Boolean value indicating whether more than one instance of the indicated attribute can be specified for a single program element.
/// </summary>
/// <value>true if more than one instance is allowed to be specified; otherwise, false. The default is false.</value>
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
/// <summary>
/// Gets or sets a Boolean value that determines whether the indicated attribute is inherited by derived classes and overriding members.
/// </summary>
/// <value>true if the attribute can be inherited by derived classes and overriding members; otherwise, false. The default is true.</value>
public bool Inherited
#pragma warning restore S2292 // Trivial properties should be auto-implemented
{
get { return _iInheritedAttribute; }
set { _iInheritedAttribute = value; }
Expand Down
Loading