├── .editorconfig ├── .gitattributes ├── .github ├── .changelog-config.json └── workflows │ └── generate-changelog.yml ├── .gitignore ├── .gitmodules ├── .runsettings ├── CHANGELOG.md ├── LICENSE.md ├── NuGet.Config ├── README.md ├── Tests ├── NFUnitTestArithmetic │ ├── NFUnitTestArithmetic.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UnitTestArithmeticTest1.cs │ ├── UnitTestArithmeticTest2.cs │ ├── UnitTestExpressionTests.cs │ ├── UnitTestFormat.cs │ └── UnitTestOtherArithmeticTests.cs ├── NFUnitTestArray │ ├── NFUnitTestArray.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UnitTestOtherTests.cs │ └── UnitTestSimpleTests.cs ├── NFUnitTestAttributes │ ├── ConstructorTests.cs │ ├── Diagnostics │ │ └── CodeAnalysis │ │ │ └── NullableAttributesTests.cs │ ├── NFUnitTestAttributes.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Runtime │ │ └── CompilerServices │ │ │ ├── CallerArgumentExpressionAttributeTests.cs │ │ │ └── CallerMemberNameAttributeTests.cs │ └── UnitTestAttributesTest1.cs ├── NFUnitTestBasicConcepts │ ├── NFUnitTestBasicConcepts.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── UnitTestBasicConceptsTests.cs ├── NFUnitTestBitConverter │ ├── BitConverter.cs │ ├── Helpers.cs │ ├── NFUnitTestBitConverter.nfproj │ └── Properties │ │ └── AssemblyInfo.cs ├── NFUnitTestClasses │ ├── NFUnitTestClasses.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UnitTestConstructorTest.cs │ ├── UnitTestConstsTests.cs │ ├── UnitTestDeclarationTests.cs │ ├── UnitTestDestructorTests.cs │ ├── UnitTestEventTests.cs │ ├── UnitTestFieldTests.cs │ ├── UnitTestHashCodeTests.cs │ ├── UnitTestIndexerTests.cs │ ├── UnitTestMembersTests.cs │ ├── UnitTestMethodsTests.cs │ ├── UnitTestOperatorTests.cs │ ├── UnitTestPropertiesTests.cs │ └── UnitTestStaticTests.cs ├── NFUnitTestConversions │ ├── NFUnitTestConversions.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UnitTestBoxingTests.cs │ ├── UnitTestConvertTests.cs │ └── UnitTestExprefTests.cs ├── NFUnitTestDelegates │ ├── NFUnitTestDelegates.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── UnitTestDelegatesTests.cs ├── NFUnitTestEnum │ ├── NFUnitTestEnum.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── UnitTestEnumTests.cs ├── NFUnitTestException │ ├── ArgumentExceptionTests.cs │ ├── ArgumentNullExceptionTests.cs │ ├── NFUnitTestException.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── UnitTestExceptionTests.cs ├── NFUnitTestGC │ ├── NFUnitTestGC.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── TestGC.cs │ ├── TestGCWithByteArrays.cs │ ├── TestGCWithDateTimeArrays.cs │ ├── TestGCWithObjectArrays.cs │ ├── TestGCWithStringArrays.cs │ └── TestGCWithTimeSpanArrays.cs ├── NFUnitTestInterface │ ├── NFUnitTestInterface.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── UnitTestInterfaceTests.cs ├── NFUnitTestLexical │ ├── NFUnitTestLexical.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UnitTestLExicalTest1.cs │ └── UnitTestLexicalTest2.cs ├── NFUnitTestNamespace │ ├── NFUnitTestNamespace.nfproj │ ├── NS_attribute_01.cs │ ├── NS_attribute_02.cs │ ├── NS_compunit_01A.cs │ ├── NS_compunit_01B.cs │ ├── NS_compunit_03A.cs │ ├── NS_compunit_03B.cs │ ├── NS_compunit_04A.cs │ ├── NS_compunit_04B.cs │ ├── NS_decl_14.cs │ ├── NS_decl_15.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── UnitTestNamespaceTests.cs ├── NFUnitTestRecords │ ├── NFUnitTestRecords.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── UnitTestRecords.cs ├── NFUnitTestStatementsTests │ ├── NFUnitTestStatements.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── UnitTestStatementTests.cs ├── NFUnitTestStruct │ ├── NFUnitTestStruct.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── UnitTestStructs.cs ├── NFUnitTestSystemLib │ ├── NFUnitTestSystemLib.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UnitTestBoolean.cs │ ├── UnitTestByte.cs │ ├── UnitTestChar.cs │ ├── UnitTestDateTime.cs │ ├── UnitTestDouble.cs │ ├── UnitTestGCTest.cs │ ├── UnitTestGuid.cs │ ├── UnitTestInitLocalTests.cs │ ├── UnitTestInt16.cs │ ├── UnitTestInt32.cs │ ├── UnitTestInt64.cs │ ├── UnitTestParseTests.cs │ ├── UnitTestReflectionAssemblyTest.cs │ ├── UnitTestReflectionMemberTest.cs │ ├── UnitTestReflectionTypeTest.cs │ ├── UnitTestSByte.cs │ ├── UnitTestSingle.cs │ ├── UnitTestStringTests.cs │ ├── UnitTestTimeSpan.cs │ ├── UnitTestTypeTests.cs │ ├── UnitTestUInt16.cs │ ├── UnitTestUInt32.cs │ ├── UnitTestUInt64.cs │ └── UnitTestWeakReferenceTests.cs ├── NFUnitTestThread │ ├── NFUnitTestThread.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UnitTestAutoResetEvents.cs │ ├── UnitTestInterlocTests.cs │ ├── UnitTestMonitorTests.cs │ ├── UnitTestThreadTest.cs │ ├── UnitTestTimeTests.cs │ ├── UnitTestTimeoutTests.cs │ └── UnitTestWaitHandleTests.cs ├── NFUnitTestTypes │ ├── NFUnitTestTypes.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UnitTestObjectTypeTests.cs │ ├── UnitTestSubTypeTests.cs │ ├── UnitTestTypes.cs │ ├── UnitTestValueArrayTypess.cs │ ├── UnitTestValueDefultConstTests.cs │ ├── UnitTestValueFloatTests.cs │ ├── UnitTestValueIntegralTests.cs │ ├── UnitTestValueSimpleTests.cs │ ├── UnitTestValueTests.cs │ └── UnitTestsSpanByte.cs ├── NFUnitTestVariables │ ├── CategoryTests.cs │ ├── NFUnitTestVariables.nfproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── VariableTests.cs ├── TestFramework │ ├── Properties │ │ └── AssemblyInfo.cs │ └── TestFramework.nfproj └── UnitTestLauncher │ ├── Properties │ └── AssemblyInfo.cs │ └── UnitTestLauncher.nfproj ├── assets ├── nf-logo.png └── readme.txt ├── azure-pipelines.yml ├── azure-pipelines └── update-vs-extension.ps1 ├── nanoFramework.CoreLibrary.NoReflection.nuspec ├── nanoFramework.CoreLibrary.NoReflection ├── CoreLibrary.NoReflection.nfproj ├── Directory.Build.props ├── System │ ├── .gitkeep │ ├── Collections │ │ └── .gitkeep │ ├── CompilerServices │ │ └── .gitkeep │ ├── ComponentModel │ │ └── .gitkeep │ ├── Diagnostics │ │ ├── .gitkeep │ │ └── CodeAnalysis │ │ │ └── .gitkeep │ ├── Globalization │ │ └── .gitkeep │ ├── IO │ │ └── .gitkeep │ ├── InteropServices │ │ └── .gitkeep │ ├── Reflection │ │ └── .gitkeep │ ├── Remoting │ │ └── .gitkeep │ ├── Runtime │ │ ├── .gitkeep │ │ └── CompilerServices │ │ │ └── .gitkeep │ └── Threading │ │ └── .gitkeep ├── coreAssembly.rsp ├── packages.config └── packages.lock.json ├── nanoFramework.CoreLibrary.nuspec ├── nanoFramework.CoreLibrary.sln ├── nanoFramework.CoreLibrary.vssettings ├── nanoFramework.CoreLibrary ├── CoreLibrary.nfproj ├── Directory.Build.props ├── Friends.cs ├── System │ ├── Action.cs │ ├── AppDomain.cs │ ├── AppDomainUnloadedException.cs │ ├── ApplicationException.cs │ ├── ArgumentException.cs │ ├── ArgumentNullException.cs │ ├── ArgumentOutOfRangeException.cs │ ├── Array.cs │ ├── AssemblyInfo.cs │ ├── AsyncCallback.cs │ ├── Attribute.cs │ ├── AttributeTargets.cs │ ├── AttributeUsageAttribute.cs │ ├── BitConverter.cs │ ├── Boolean.cs │ ├── Byte.cs │ ├── CLSCompliantAttribute.cs │ ├── Char.cs │ ├── Collections │ │ ├── ArrayList.cs │ │ ├── ICollection.cs │ │ ├── IComparer.cs │ │ ├── IEnumerable.cs │ │ ├── IEnumerator.cs │ │ ├── IEqualityComparer.cs │ │ └── IList.cs │ ├── ComponentModel │ │ └── EditorBrowsableAttribute.cs │ ├── Console.cs │ ├── Convert.cs │ ├── DBNull.cs │ ├── DateTime.cs │ ├── DayOfWeek.cs │ ├── Decimal.cs │ ├── Delegate.cs │ ├── Diagnostics │ │ ├── CodeAnalysis │ │ │ └── NullableAttributes.cs │ │ ├── ConditionalAttribute.cs │ │ ├── Debug.cs │ │ ├── Debugger.cs │ │ ├── DebuggerAttributes.cs │ │ └── NativeProfiledAttribute.cs │ ├── Double.cs │ ├── Enum.cs │ ├── EventArgs.cs │ ├── EventHandler.cs │ ├── Exception.cs │ ├── FlagsAttribute.cs │ ├── FormatException.cs │ ├── GC.cs │ ├── Globalization │ │ ├── CultureInfo.cs │ │ ├── DateTimeFormat.cs │ │ ├── DateTimeFormatInfo.cs │ │ └── NumberFormatInfo.cs │ ├── Guid.cs │ ├── IAsyncResult.cs │ ├── ICloneable.cs │ ├── IComparable.cs │ ├── ICustomFormatter.cs │ ├── IDisposable.cs │ ├── IFormatProvider.cs │ ├── IFormattable.cs │ ├── IO │ │ └── IOException.cs │ ├── IndexOutOfRangeException.cs │ ├── Int16.cs │ ├── Int32.cs │ ├── Int64.cs │ ├── IntPtr.cs │ ├── InvalidCastException.cs │ ├── InvalidOperationException.cs │ ├── MarshalByRefObject.cs │ ├── Math.cs │ ├── MulticastDelegate.cs │ ├── NonSerializedAttribute.cs │ ├── NotImplementedException.cs │ ├── NotSupportedException.cs │ ├── NullReferenceException.cs │ ├── Number.cs │ ├── Object.cs │ ├── ObjectDisposedException.cs │ ├── ObsoleteAttribute.cs │ ├── OutOfMemoryException.cs │ ├── ParamArrayAttribute.cs │ ├── PlatformNotSupportedException.cs │ ├── Random.cs │ ├── Reflection │ │ ├── Assembly.cs │ │ ├── AssemblyAttributes.cs │ │ ├── AssemblyNameFlags.cs │ │ ├── AssemblyReflectionAttributes.cs │ │ ├── Binder.cs │ │ ├── BindingFlags.cs │ │ ├── ConstructorInfo.cs │ │ ├── CustomAttributesHelpers.cs │ │ ├── DefaultMemberAttribute.cs │ │ ├── FieldInfo.cs │ │ ├── FieldReflectionAttributes.cs │ │ ├── IReflect.cs │ │ ├── MemberInfo.cs │ │ ├── MemberTypes.cs │ │ ├── MethodBase.cs │ │ ├── MethodImplAttributes.cs │ │ ├── MethodInfo.cs │ │ ├── ParameterInfo.cs │ │ ├── ParameterModifier.cs │ │ ├── PropertyInfo.cs │ │ ├── RuntimeConstructorInfo.cs │ │ ├── RuntimeFieldInfo.cs │ │ └── RuntimeMethodInfo.cs │ ├── Runtime │ │ ├── CompilerServices │ │ │ ├── AccessedThroughPropertyAttribute.cs │ │ │ ├── AssemblyAttributesGoHere.cs │ │ │ ├── CallerArgumentExpressionAttribute.cs │ │ │ ├── CallerMemberNameAttribute.cs │ │ │ ├── CallingConvention.cs │ │ │ ├── CompilationRelaxations.cs │ │ │ ├── CompilerGlobalScopeAttribute.cs │ │ │ ├── CustomConstantAttribute.cs │ │ │ ├── DateTimeConstantAttribute.cs │ │ │ ├── DecimalConstantAttribute.cs │ │ │ ├── DiscardableAttribute.cs │ │ │ ├── ExcludeTypeAttribute.cs │ │ │ ├── ExtensionAttribute.cs │ │ │ ├── IDispatchConstantAttribute.cs │ │ │ ├── IUnknownConstantAttribute.cs │ │ │ ├── IndexerNameAttribute.cs │ │ │ ├── InternalsVisibleToAttribute.cs │ │ │ ├── IsExternalInit.cs │ │ │ ├── IsVolatile.cs │ │ │ ├── MethodImplAttribute.cs │ │ │ ├── RequiredAttributeAttribute.cs │ │ │ ├── RuntimeFeature.cs │ │ │ └── RuntimeHelpers.cs │ │ ├── InteropServices │ │ │ ├── Attributes.cs │ │ │ ├── CharSet.cs │ │ │ └── LayoutKind.cs │ │ └── Remoting │ │ │ ├── RemotingServices.cs │ │ │ └── __TransparentProxy.cs │ ├── RuntimeArgumentHandle.cs │ ├── RuntimeFieldHandle.cs │ ├── RuntimeMethodHandle.cs │ ├── RuntimeType.cs │ ├── RuntimeTypeHandle.cs │ ├── SByte.cs │ ├── SerializableAttribute.cs │ ├── Single.cs │ ├── SpanByte.cs │ ├── String.cs │ ├── SystemException.cs │ ├── TargetFrameworkAttribute.cs │ ├── ThreadAttributes.cs │ ├── Threading │ │ ├── AutoResetEvent.cs │ │ ├── Interlocked.cs │ │ ├── ManualResetEvent.cs │ │ ├── Monitor.cs │ │ ├── SpinWait.cs │ │ ├── Thread.cs │ │ ├── ThreadAbortException.cs │ │ ├── ThreadPriority.cs │ │ ├── ThreadStart.cs │ │ ├── ThreadState.cs │ │ ├── Timeout.cs │ │ ├── Timer.cs │ │ └── WaitHandle.cs │ ├── TimeSpan.cs │ ├── TimeoutException.cs │ ├── Type.cs │ ├── TypeCode.cs │ ├── TypedReference.cs │ ├── UInt16.cs │ ├── UInt32.cs │ ├── UInt64.cs │ ├── UIntPtr.cs │ ├── ValueType.cs │ ├── Version.cs │ ├── Void.cs │ └── WeakReference.cs ├── coreAssembly.rsp ├── key.snk ├── packages.config └── packages.lock.json ├── spelling_exclusion.dic └── version.json /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=crlf 2 | -------------------------------------------------------------------------------- /.github/.changelog-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "categories": [ 3 | { 4 | "title": "## New Features and enhancements", 5 | "labels": [ 6 | "Type: enhancement" 7 | ], 8 | "exhaustive": true 9 | }, 10 | { 11 | "title": "## Bug Fixes", 12 | "labels": [ 13 | "Type: bug" 14 | ], 15 | "exhaustive": true 16 | }, 17 | { 18 | "title": "## Documentation", 19 | "labels": [ 20 | "Type: documentation" 21 | ], 22 | "exhaustive": true 23 | }, 24 | { 25 | "title": "## ⚠️ Breaking Changes", 26 | "labels": [ 27 | "Breaking-Change" 28 | ], 29 | "exhaustive": true 30 | }, 31 | { 32 | "title": "## Updated dependencies", 33 | "labels": [ 34 | "Type: dependencies" 35 | ], 36 | "exhaustive": true 37 | } 38 | ], 39 | "sort": "ASC", 40 | "template": "${{CHANGELOG}}\n\n**Full Changelog:** ${{RELEASE_DIFF}}\n\nThe following NuGet packages are available from this release:\n\n:package: [Base Class Library](https://www.nuget.org/packages/nanoFramework.CoreLibrary/)\n:package: [Base Class Library w/o reflection](https://www.nuget.org/packages/nanoFramework.CoreLibrary.NoReflection/)", 41 | "pr_template": "* ${{TITLE}} by @${{AUTHOR}} in #${{NUMBER}}", 42 | "empty_template": "- no changes", 43 | "max_tags_to_fetch": 200, 44 | "max_pull_requests": 200 45 | } 46 | -------------------------------------------------------------------------------- /.github/workflows/generate-changelog.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) .NET Foundation and Contributors 2 | # See LICENSE file in the project root for full license information. 3 | 4 | name: Generate Changelog 5 | run-name: Generate changelog 6 | 7 | on: 8 | push: 9 | tags: 10 | - '*' 11 | 12 | jobs: 13 | compose_changelog: 14 | name: nanoFramework 15 | uses: nanoframework/nf-tools/.github/workflows/generate-changelog.yml@main 16 | secrets: inherit 17 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "nanoFramework.TestFramework"] 2 | path = nanoFramework.TestFramework 3 | url = https://github.com/nanoframework/nanoFramework.TestFramework 4 | -------------------------------------------------------------------------------- /.runsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 1 6 | .\TestResults 7 | 1200000 8 | net48 9 | x64 10 | 11 | 12 | Verbose 13 | False 14 | --forcegc 15 | 16 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) .NET Foundation and Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Tests/NFUnitTestArithmetic/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestArray/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestAttributes/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestAttributes/Runtime/CompilerServices/CallerMemberNameAttributeTests.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | using nanoFramework.TestFramework; 6 | 7 | namespace NFUnitTestAttributes.Runtime.CompilerServices 8 | { 9 | [TestClass] 10 | public class CallerMemberNameAttributeTests 11 | { 12 | [TestMethod] 13 | public void CallerMemberNameAttributeGetsCallerMemberName() 14 | { 15 | const string expect = nameof(CallerMemberNameAttributeGetsCallerMemberName); 16 | var actual = TestCallerMemberName(); 17 | 18 | Assert.AreEqual(expect, actual); 19 | } 20 | 21 | // ReSharper disable once EntityNameCapturedOnly.Local 22 | #pragma warning disable IDE0060 23 | private static string TestCallerMemberName([CallerMemberName] string memberName = null) => memberName; 24 | #pragma warning restore IDE0060 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Tests/NFUnitTestBasicConcepts/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestBitConverter/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestClasses/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestClasses/UnitTestEventTests.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System; 5 | using nanoFramework.TestFramework; 6 | 7 | namespace NFUnitTestClasses 8 | { 9 | [TestClass] 10 | class UnitTestEventTests 11 | { 12 | [TestMethod] 13 | public void Events1_Test() 14 | { 15 | // This is testing an obsolete event structure, but should pass. 16 | Assert.IsTrue(EventsTestClass1.testMethod()); 17 | } 18 | 19 | 20 | public delegate void EventsTestClass1_EventHandler1(); 21 | 22 | public class EventsTestClass1_Event1 23 | { 24 | 25 | [Obsolete("This is Obsolete")] 26 | public event EventsTestClass1_EventHandler1 CMyEvent; 27 | 28 | public void Fire() 29 | { 30 | if (CMyEvent != null) CMyEvent(); 31 | } 32 | } 33 | 34 | public class EventsTestClass1_Sub1 35 | { 36 | 37 | 38 | public static void MyMeth() { } 39 | 40 | public static void Main_old() 41 | { 42 | EventsTestClass1_Event1 mc = new EventsTestClass1_Event1(); 43 | mc.CMyEvent += new EventsTestClass1_EventHandler1(MyMeth); 44 | mc.Fire(); 45 | } 46 | } 47 | 48 | class EventsTestClass1 49 | { 50 | public static bool testMethod() 51 | { 52 | try 53 | { 54 | EventsTestClass1_Sub1.Main_old(); 55 | } 56 | catch 57 | { 58 | return false; 59 | } 60 | return true; 61 | 62 | } 63 | } 64 | 65 | 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Tests/NFUnitTestConversions/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestDelegates/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestEnum/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestException/ArgumentNullExceptionTests.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System; 5 | using nanoFramework.TestFramework; 6 | 7 | #nullable enable 8 | namespace NFUnitTestException 9 | { 10 | [TestClass] 11 | public class ArgumentNullExceptionTests 12 | { 13 | [TestMethod] 14 | public void ctor_sets_correct_message_with_parameter() 15 | { 16 | const string parameter = nameof(ctor_sets_correct_message_with_parameter); 17 | const string expected = $"Value cannot be null. (Parameter '{parameter}')"; 18 | 19 | var ex1 = new ArgumentNullException(parameter); 20 | var ex2 = new ArgumentNullException(parameter, (string?)null); 21 | 22 | Assert.AreEqual(expected, ex1.Message); 23 | Assert.AreEqual(expected, ex2.Message); 24 | } 25 | 26 | [TestMethod] 27 | public void ctor_sets_correct_message_without_parameter() 28 | { 29 | const string expected = "Value cannot be null."; 30 | 31 | var ex1 = new ArgumentNullException(); 32 | var ex2 = new ArgumentNullException(null); 33 | var ex3 = new ArgumentNullException(null, (Exception?)null); 34 | var ex4 = new ArgumentNullException((string?)null, (string?)null); 35 | 36 | Assert.AreEqual(expected, ex1.Message); 37 | Assert.AreEqual(expected, ex2.Message); 38 | Assert.AreEqual(expected, ex3.Message); 39 | Assert.AreEqual(expected, ex4.Message); 40 | } 41 | 42 | [TestMethod] 43 | public void ThrowIfNullOrEmpty_throws_ArgumentNullException_if_null() 44 | { 45 | Assert.ThrowsException(typeof(ArgumentNullException), () => ArgumentNullException.ThrowIfNull(null)); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Tests/NFUnitTestException/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestGC/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyCopyright("Copyright (c) 2021 nanoFramework contributors")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Version information for an assembly consists of the following four values: 23 | // 24 | // Major Version 25 | // Minor Version 26 | // Build Number 27 | // Revision 28 | // 29 | // You can specify all the values or you can default the Build and Revision Numbers 30 | // by using the '*' as shown below: 31 | // [assembly: AssemblyVersion("1.0.*")] 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /Tests/NFUnitTestGC/TestGC.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | 5 | using nanoFramework.TestFramework; 6 | 7 | namespace NFUnitTestGC 8 | { 9 | [TestClass] 10 | public class TestGC 11 | { 12 | [TestMethod] 13 | public void TestGCStress() 14 | { 15 | int maxArraySize = 1024 * 32; 16 | object[] arrays = new object[600]; 17 | 18 | // Starting TestGCStress 19 | 20 | for (int loop = 0; loop < 100; loop++) 21 | { 22 | OutputHelper.WriteLine($"Running iteration {loop}"); 23 | 24 | for (int i = 0; i < arrays.Length - 1;) 25 | { 26 | OutputHelper.WriteLine($"Alloc array of {maxArraySize} bytes @ pos {i}"); 27 | arrays[i++] = new byte[maxArraySize]; ; 28 | 29 | OutputHelper.WriteLine($"Alloc array of 64 bytes @ pos {i}"); 30 | arrays[i++] = new byte[64]; 31 | } 32 | 33 | arrays[0] = new byte[maxArraySize]; 34 | 35 | for (int i = 0; i < arrays.Length; i++) 36 | { 37 | arrays[i] = null; 38 | } 39 | } 40 | 41 | // Completed TestGCStress 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Tests/NFUnitTestInterface/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestLexical/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestNamespace/NS_attribute_01.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System; 5 | using nanoFramework.TestFramework; 6 | 7 | [assembly: CLSCompliant(true)] 8 | 9 | class NS_TestClass_attribute_01 10 | { 11 | public void printClassName() 12 | { 13 | OutputHelper.WriteLine("Class A"); 14 | } 15 | 16 | static void Main_old() { } 17 | 18 | public static bool testMethod() 19 | { 20 | Main_old(); 21 | return true; 22 | } 23 | } -------------------------------------------------------------------------------- /Tests/NFUnitTestNamespace/NS_attribute_02.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System; 5 | using nanoFramework.TestFramework; 6 | 7 | [module: CLSCompliant(true)] 8 | 9 | class NS_TestClass_attribute_02 10 | { 11 | public void printClassName() 12 | { 13 | OutputHelper.WriteLine("Class A"); 14 | } 15 | 16 | static void Main_old() { } 17 | 18 | public static bool testMethod() 19 | { 20 | Main_old(); 21 | return true; 22 | } 23 | } -------------------------------------------------------------------------------- /Tests/NFUnitTestNamespace/NS_compunit_01A.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using nanoFramework.TestFramework; 5 | 6 | class NS_TestClass_compunit_01A 7 | { 8 | public void printClassName() 9 | { 10 | OutputHelper.WriteLine("Class A"); 11 | } 12 | } -------------------------------------------------------------------------------- /Tests/NFUnitTestNamespace/NS_compunit_01B.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using nanoFramework.TestFramework; 5 | 6 | class NS_TestClass_compunit_01B 7 | { 8 | public void printClassName() 9 | { 10 | OutputHelper.WriteLine("Class B"); 11 | } 12 | } -------------------------------------------------------------------------------- /Tests/NFUnitTestNamespace/NS_compunit_03A.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using nanoFramework.TestFramework; 5 | 6 | class NS_TestClass_compunit_03A 7 | { 8 | public void printClassName() 9 | { 10 | NS_TestClass_compunit_03B cB = new NS_TestClass_compunit_03B(); 11 | cB.showName(); 12 | } 13 | 14 | public void showName() 15 | { 16 | OutputHelper.WriteLine("Class A"); 17 | } 18 | } -------------------------------------------------------------------------------- /Tests/NFUnitTestNamespace/NS_compunit_03B.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using nanoFramework.TestFramework; 5 | 6 | class NS_TestClass_compunit_03B 7 | { 8 | public void printClassName() 9 | { 10 | NS_TestClass_compunit_03 cC = new NS_TestClass_compunit_03(); 11 | cC.showName(); 12 | } 13 | 14 | public void showName() 15 | { 16 | OutputHelper.WriteLine("Class B"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Tests/NFUnitTestNamespace/NS_compunit_04A.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace NS_TestClass_compunit_04_first 5 | { 6 | using nanoFramework.TestFramework; 7 | 8 | class NS_TestClass_compunit_04A 9 | { 10 | public void printClassName() 11 | { 12 | OutputHelper.WriteLine("Class A"); 13 | } 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /Tests/NFUnitTestNamespace/NS_compunit_04B.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace NS_TestClass_compunit_04_second 5 | { 6 | using nanoFramework.TestFramework; 7 | 8 | class NS_TestClass_compunit_04A 9 | { 10 | public void printClassName() 11 | { 12 | OutputHelper.WriteLine("Class B"); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Tests/NFUnitTestNamespace/NS_decl_14.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace NS_TestClass_decl_14_one.NS_TestClass_decl_14_two.NS_TestClass_decl_14_three 5 | { 6 | class C 7 | { 8 | public int j; 9 | } 10 | } -------------------------------------------------------------------------------- /Tests/NFUnitTestNamespace/NS_decl_15.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace NS_TestClass_decl_15_one.NS_TestClass_decl_15_two.NS_TestClass_decl_15_three 5 | { 6 | class C 7 | { 8 | public int j; 9 | } 10 | } -------------------------------------------------------------------------------- /Tests/NFUnitTestNamespace/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestRecords/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyCopyright("Copyright (c) 2021 nanoFramework contributors")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Version information for an assembly consists of the following four values: 23 | // 24 | // Major Version 25 | // Minor Version 26 | // Build Number 27 | // Revision 28 | // 29 | // You can specify all the values or you can default the Build and Revision Numbers 30 | // by using the '*' as shown below: 31 | // [assembly: AssemblyVersion("1.0.*")] 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /Tests/NFUnitTestRecords/UnitTestRecords.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace NFUnitTestRecords 5 | { 6 | //[TestClass] 7 | //public class UnitTestRecords 8 | //{ 9 | // [TestMethod] 10 | // public void Records_Test00() 11 | // { 12 | // var firstName = "Test"; 13 | // var lastName = "Person"; 14 | // var dob = new DateTime(1998, 1, 31); 15 | // var id = Guid.NewGuid(); 16 | // var emptyGuid = Guid.Empty; 17 | 18 | // var newPerson = new Person(firstName, lastName, dob) 19 | // { 20 | // Id = emptyGuid, 21 | // }; 22 | 23 | // var expectedPerson = new Person(firstName, lastName, dob) 24 | // { 25 | // Id = id, 26 | // }; 27 | // } 28 | //} 29 | 30 | //public record Person 31 | //{ 32 | // public Person(string firstName, string lastName, DateTime 33 | // dateOfBirth) 34 | // { 35 | // FirstName = firstName; 36 | // LastName = lastName; 37 | // DateOfBirth = dateOfBirth; 38 | // } 39 | 40 | // public Guid Id { get; set; } 41 | // public string FirstName { get; } 42 | // public string LastName { get; } 43 | // public DateTime DateOfBirth { get; } 44 | //} 45 | } 46 | -------------------------------------------------------------------------------- /Tests/NFUnitTestStatementsTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestStruct/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestSystemLib/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestSystemLib/UnitTestBoolean.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using nanoFramework.TestFramework; 5 | 6 | namespace NFUnitTestSystemLib 7 | { 8 | [TestClass] 9 | class BooleanTests 10 | { 11 | [TestMethod] 12 | public void TrueString_Get_ReturnsTrue() 13 | { 14 | Assert.AreEqual("True", bool.TrueString); 15 | } 16 | 17 | [TestMethod] 18 | public void FalseString_Get_ReturnsFalse() 19 | { 20 | Assert.AreEqual("False", bool.FalseString); 21 | } 22 | 23 | [TestMethod] 24 | public void GetHashCode_Invoke_ReturnsExpected() 25 | { 26 | bool _true = true; 27 | bool _false = false; 28 | 29 | Assert.AreEqual(_true.GetHashCode(), 1); 30 | Assert.AreEqual(_false.GetHashCode(), 0); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Tests/NFUnitTestSystemLib/UnitTestChar.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using nanoFramework.TestFramework; 5 | 6 | namespace NFUnitTestSystemLib 7 | { 8 | [TestClass] 9 | class CharTests 10 | { 11 | [TestMethod] 12 | public void Equals() 13 | { 14 | CharTestData[] testData = new CharTestData[] 15 | { 16 | new CharTestData((char)'a', (char)'a', true), 17 | new CharTestData((char)'a', (char)'A', false), 18 | new CharTestData((char)'a', (char)'b', false), 19 | new CharTestData((char)'a', (int)'a', false), 20 | new CharTestData((char)'a', "a", false), 21 | new CharTestData((char)'a', null, false) 22 | }; 23 | 24 | foreach (var test in testData) 25 | { 26 | if (test.Obj is char) 27 | { 28 | Assert.AreEqual(test.Expected, test.C.Equals((char)test.Obj)); 29 | Assert.AreEqual(test.Expected, test.C.GetHashCode().Equals(test.Obj.GetHashCode())); 30 | } 31 | 32 | Assert.AreEqual(test.Expected, test.C.Equals(test.Obj)); 33 | } 34 | } 35 | 36 | private sealed class CharTestData 37 | { 38 | public object C { get; } 39 | public object Obj { get; } 40 | public bool Expected { get; } 41 | 42 | public CharTestData(object c, object obj, bool expected) 43 | { 44 | C = c; 45 | Obj = obj; 46 | Expected = expected; 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Tests/NFUnitTestThread/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestTypes/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/NFUnitTestTypes/UnitTestSubTypeTests.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System; 5 | using nanoFramework.TestFramework; 6 | 7 | namespace NFUnitTestTypes 8 | { 9 | [TestClass] 10 | class UnitTestSubTypeTests 11 | { 12 | // Class1 and SubClass1 used for testing type def of inherited classes 13 | class Class1 14 | { 15 | public class SubClass1 16 | { 17 | void Method1() 18 | { 19 | 20 | } 21 | } 22 | 23 | public SubClass1 Sc1ClassRef = new SubClass1(); 24 | 25 | } 26 | [TestMethod] 27 | // Test sub-class in the string for GetType(string). a "+" is used for sub-classes within a class. 28 | public void SubClassGetTypeValid() 29 | { 30 | const string subClass1FullName = "NFUnitTestTypes.UnitTestSubTypeTests+Class1+SubClass1"; 31 | Class1 c1 = new Class1(); 32 | string className = c1.Sc1ClassRef.GetType().FullName; 33 | Assert.AreEqual(className, subClass1FullName, "The object FullName was not correct"); 34 | Type testType = Type.GetType(subClass1FullName); 35 | Assert.IsNotNull(testType, $"The Type for {subClass1FullName} could not be parsed"); 36 | Assert.AreEqual(testType.Name, "SubClass1"); 37 | Assert.AreEqual(testType.FullName, subClass1FullName); 38 | 39 | } 40 | [TestMethod] 41 | // Test sub-class in the string for GetType(string). a "+" is used for sub-classes within a class. 42 | public void SubClassGetTypeInvalid() 43 | { 44 | Class1 c1 = new Class1(); 45 | Type testType = Type.GetType("UnitTestSubTypeTests+Class1+SubClass1"); // test without the namespace. This should NOT work 46 | Assert.IsNull(testType, "The Type for UnitTestSubTypeTests+Class1+SubClass1 should not parse"); 47 | 48 | } 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Tests/NFUnitTestTypes/UnitTestValueTests.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using nanoFramework.TestFramework; 5 | 6 | namespace NFUnitTestTypes 7 | { 8 | [TestClass] 9 | class UnitTestValueTests 10 | { 11 | [TestMethod] 12 | public void Value7_Test() 13 | { 14 | ValueTestClass7.testMethod(); 15 | } 16 | 17 | [TestMethod] 18 | public void Value8_Test() 19 | { 20 | ValueTestClass8.testMethod(); 21 | } 22 | 23 | [TestMethod] 24 | public void Value9_Test() 25 | { 26 | ValueTestClass9.testMethod(); 27 | } 28 | 29 | //Compiled Test Cases 30 | public struct ValueTestClass7_Struct 31 | { 32 | public int MyInt; 33 | } 34 | 35 | public class ValueTestClass7 36 | { 37 | public static void testMethod() 38 | { 39 | ValueTestClass7_Struct MS = new ValueTestClass7_Struct(); 40 | ValueTestClass7_Struct MS2; 41 | 42 | MS.MyInt = 3; 43 | MS2 = MS; 44 | MS.MyInt = 4; 45 | 46 | Assert.AreEqual(MS2.MyInt, 3); 47 | } 48 | } 49 | 50 | public class ValueTestClass8 51 | { 52 | public static void testMethod() 53 | { 54 | int MyInt; 55 | int MyInt2; 56 | 57 | MyInt = 3; 58 | MyInt2 = MyInt; 59 | MyInt = 4; 60 | Assert.AreEqual(MyInt2, 3); 61 | } 62 | } 63 | 64 | enum ValueTestClass9_Enum { a = 1, b = 2 } 65 | 66 | public class ValueTestClass9 67 | { 68 | public static void testMethod() 69 | { 70 | ValueTestClass9_Enum Enum1; 71 | ValueTestClass9_Enum Enum2; 72 | Enum1 = ValueTestClass9_Enum.a; 73 | Enum2 = Enum1; 74 | Enum1 = ValueTestClass9_Enum.b; 75 | Assert.AreEqual((int)Enum2, (int)ValueTestClass9_Enum.a); 76 | } 77 | } 78 | 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Tests/NFUnitTestVariables/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.TestApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.TestApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Tests/TestFramework/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.BlankApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.BlankApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | 37 | ///////////////////////////////////////////////////////////////// 38 | // This attribute is mandatory when building Interop libraries // 39 | // update this whenever the native assembly signature changes // 40 | [assembly: AssemblyNativeVersion("1.0.0.0")] 41 | ///////////////////////////////////////////////////////////////// 42 | -------------------------------------------------------------------------------- /Tests/UnitTestLauncher/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CSharp.BlankApplication")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CSharp.BlankApplication")] 15 | [assembly: AssemblyCopyright("Copyright © ")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /assets/nf-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/assets/nf-logo.png -------------------------------------------------------------------------------- /assets/readme.txt: -------------------------------------------------------------------------------- 1 | _____ _ 2 | _ __ __ _ _ __ ___ | ___| __ __ _ _ __ ___ _____ _____ _ __| | __ 3 | | '_ \ / _` | '_ \ / _ \| |_ | '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / 4 | | | | | (_| | | | | (_) | _|| | | (_| | | | | | | __/\ V V / (_) | | | < 5 | |_| |_|\__,_|_| |_|\___/|_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ 6 | 7 | =================================================================================== 8 | 9 | API docs: https://docs.nanoframework.net/api 10 | 11 | Browse our samples repository: https://github.com/nanoframework/samples 12 | 13 | Check our documentation online: https://docs.nanoframework.net 14 | 15 | Join our lively Discord community: https://discord.gg/gCyBu8T 16 | 17 | Report issues: https://github.com/nanoframework/Home/issues 18 | 19 | Follow us on Twitter: https://twitter.com/nanoframework 20 | 21 | Follow our YouTube channel: https://www.youtube.com/c/nanoFramework 22 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | nanoFramework.CoreLibrary.NoReflection 5 | $version$ 6 | nanoFramework.CoreLibrary.NoReflection 7 | nanoframework 8 | false 9 | LICENSE.md 10 | 11 | docs\README.md 12 | false 13 | https://github.com/nanoframework/CoreLibrary 14 | images\nf-logo.png 15 | 16 | Copyright (c) .NET Foundation and Contributors 17 | This package includes the CoreLibrary assembly for .NET nanoFramework C# projects **WITHOUT** the System.Reflection API. This package requires a target with mscorlib v$nativeVersion$ (checksum $checksum$). There is another version that includes the System.Reflection API. 18 | nanoFramework C# csharp netmf netnf nanoFramework.CoreLibrary 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/Collections/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/Collections/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/CompilerServices/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/CompilerServices/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/ComponentModel/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/ComponentModel/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/Diagnostics/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/Diagnostics/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/Diagnostics/CodeAnalysis/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/Diagnostics/CodeAnalysis/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/Globalization/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/Globalization/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/IO/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/IO/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/InteropServices/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/InteropServices/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/Reflection/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/Reflection/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/Remoting/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/Remoting/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/Runtime/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/Runtime/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/Runtime/CompilerServices/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/Runtime/CompilerServices/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/System/Threading/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary.NoReflection/System/Threading/.gitkeep -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/coreAssembly.rsp: -------------------------------------------------------------------------------- 1 | # CSC requires the runtimemetadataversion flag when building a core assembly (containing System.Object) 2 | /runtimemetadataversion:v4.0.30319 3 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.NoReflection/packages.lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dependencies": { 4 | ".NETnanoFramework,Version=v1.0": { 5 | "Microsoft.Build.Tasks.Git": { 6 | "type": "Direct", 7 | "requested": "[1.1.1, 1.1.1]", 8 | "resolved": "1.1.1", 9 | "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" 10 | }, 11 | "Microsoft.SourceLink.Common": { 12 | "type": "Direct", 13 | "requested": "[1.1.1, 1.1.1]", 14 | "resolved": "1.1.1", 15 | "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" 16 | }, 17 | "Microsoft.SourceLink.GitHub": { 18 | "type": "Direct", 19 | "requested": "[1.1.1, 1.1.1]", 20 | "resolved": "1.1.1", 21 | "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==" 22 | }, 23 | "Nerdbank.GitVersioning": { 24 | "type": "Direct", 25 | "requested": "[3.7.115, 3.7.115]", 26 | "resolved": "3.7.115", 27 | "contentHash": "EpXamaAdRfG/BMxGgvZlTM0npRnkmXUjAj8OdNKd17t4oN+2nvjdv/KnFmzOOMDqvlwB49UCwtOHJrAQTfUBtQ==" 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | nanoFramework.CoreLibrary 5 | $version$ 6 | nanoFramework.CoreLibrary 7 | nanoframework 8 | false 9 | LICENSE.md 10 | 11 | docs\README.md 12 | false 13 | https://github.com/nanoframework/CoreLibrary 14 | images\nf-logo.png 15 | 16 | Copyright (c) .NET Foundation and Contributors 17 | This package includes the CoreLibrary assembly for .NET nanoFramework C# projects. This package requires a target with mscorlib v$nativeVersion$ (checksum $checksum$). In case you don't need the System.Reflection API there is another NuGet package without this API. 18 | nanoFramework C# csharp netmf netnf nanoFramework.CoreLibrary 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/AppDomainUnloadedException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown when an attempt is made to access an unloaded application domain. 8 | /// 9 | [Serializable] 10 | public class AppDomainUnloadedException : SystemException 11 | { 12 | /// 13 | /// Initializes a new instance of the AppDomainUnloadedException class. 14 | /// 15 | public AppDomainUnloadedException() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the AppDomainUnloadedException class with a specified error message. 21 | /// 22 | /// The message that describes the error. 23 | public AppDomainUnloadedException(String message) 24 | : base(message) 25 | { 26 | } 27 | 28 | /// 29 | /// Initializes a new instance of the AppDomainUnloadedException class with a specified error message and a reference to the inner exception that is the cause of this exception. 30 | /// 31 | /// The message that describes the error. 32 | /// The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. 33 | public AppDomainUnloadedException(String message, Exception innerException) 34 | : base(message, innerException) 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/ApplicationException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Serves as the base class for application-defined exceptions. 8 | /// 9 | [Serializable] 10 | public class ApplicationException : Exception 11 | { 12 | /// 13 | /// Initializes a new instance of the ApplicationException class. 14 | /// 15 | public ApplicationException() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the ApplicationException class with a specified error message. 21 | /// 22 | /// A message that describes the error. 23 | public ApplicationException(String message) 24 | : base(message) 25 | { 26 | } 27 | 28 | /// 29 | /// Initializes a new instance of the ApplicationException class with a specified error message and a reference to the inner exception that is the cause of this exception. 30 | /// 31 | /// The error message that explains the reason for the exception. 32 | /// The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. 33 | public ApplicationException(String message, Exception innerException) 34 | : base(message, innerException) 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/ArgumentOutOfRangeException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. 8 | /// 9 | [Serializable] 10 | public class ArgumentOutOfRangeException : ArgumentException 11 | { 12 | /// 13 | /// Initializes a new instance of the ArgumentOutOfRangeException class. 14 | /// 15 | public ArgumentOutOfRangeException() 16 | : this(null) 17 | { 18 | } 19 | 20 | /// 21 | /// Initializes a new instance of the ArgumentOutOfRangeException class with the name of the parameter that causes this exception. 22 | /// 23 | /// The name of the parameter that causes this exception. 24 | public ArgumentOutOfRangeException(String paramName) 25 | : base(null, paramName) 26 | { 27 | } 28 | 29 | /// 30 | /// Initializes a new instance of the ArgumentOutOfRangeException class with the name of the parameter that causes this exception and a specified error message. 31 | /// 32 | /// The name of the parameter that caused the exception. 33 | /// The message that describes the error. 34 | public ArgumentOutOfRangeException(String paramName, String message) 35 | : base(message, paramName) 36 | { 37 | } 38 | 39 | // We will not use this in the classlibs, but we'll provide it for 40 | // anyone that's really interested so they don't have to stick a bunch 41 | // of printf's in their code. 42 | 43 | // Gets the value of the argument that caused the exception. 44 | // Note - we don't set this anywhere in the class libraries in 45 | // version 1, but it might come in handy for other developers who 46 | // want to avoid sticking printf's in their code. 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System; 5 | using System.Reflection; 6 | 7 | [assembly: CLSCompliant(true)] 8 | [assembly: AssemblyTitle("mscorlib")] 9 | [assembly: AssemblyCompany(".NET nanoFramework Contributors")] 10 | [assembly: AssemblyProduct(".NET nanoFramework mscorlib")] 11 | [assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")] 12 | 13 | [assembly: AssemblyNativeVersion("100.5.0.24")] 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/AsyncCallback.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// References a method to be called when a corresponding asynchronous operation completes. 8 | /// 9 | /// The result of the asynchronous operation. 10 | [Serializable] 11 | public delegate void AsyncCallback(IAsyncResult ar); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Attribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Represents the base class for custom attributes. 8 | /// 9 | [Serializable, AttributeUsage(AttributeTargets.All)] // Base class for all attributes 10 | public abstract class Attribute 11 | { 12 | /// 13 | /// Initializes a new instance of the Attribute class. 14 | /// 15 | protected Attribute() { } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Boolean.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Represents a Boolean value. 8 | /// 9 | [Serializable] 10 | public struct Boolean 11 | { 12 | /// 13 | /// Represents the Boolean value false as a string. This field is read-only. 14 | /// 15 | public static readonly string FalseString = "False"; 16 | /// 17 | /// Represents the Boolean value true as a string. This field is read-only. 18 | /// 19 | public static readonly string TrueString = "True"; 20 | 21 | // this field is required in the native end 22 | #pragma warning disable 0649 23 | // Do not rename (binary serialization) 24 | private bool m_value; 25 | #pragma warning restore 0649 26 | 27 | /// 28 | /// Converts the value of this instance to its equivalent string representation (either "True" or "False"). 29 | /// 30 | /// TrueString if the value of this instance is true, or FalseString if the value of this instance is false. 31 | public override String ToString() 32 | { 33 | return m_value ? TrueString : FalseString; 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System 7 | { 8 | /// 9 | /// Indicates whether a program element is compliant with the Common Language Specification (CLS). This class cannot be inherited. 10 | /// 11 | [AttributeUsage(AttributeTargets.All)] 12 | [ExcludeType] 13 | [Serializable] 14 | public sealed class CLSCompliantAttribute : Attribute 15 | { 16 | private bool _compliant; 17 | 18 | /// 19 | /// Initializes an instance of the CLSCompliantAttribute class with a Boolean value indicating whether the indicated program element is CLS-compliant. 20 | /// 21 | /// true if CLS-compliant; otherwise, false. 22 | public CLSCompliantAttribute(bool isCompliant) 23 | { 24 | _compliant = isCompliant; 25 | } 26 | 27 | /// 28 | /// GGets the Boolean value indicating whether the indicated program element is CLS-compliant. 29 | /// 30 | /// true if the program element is CLS-compliant; otherwise, false. 31 | public bool IsCompliant 32 | { 33 | get { return _compliant; } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Char.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Represents a character as a UTF-16 code unit. 8 | /// 9 | [Serializable] 10 | public struct Char 11 | { 12 | // this field is required in the native end 13 | #pragma warning disable 0649 14 | // Do not rename (binary serialization) 15 | private char m_value; 16 | #pragma warning restore 0649 17 | 18 | /// 19 | /// Represents the largest possible value of a Char. This field is constant. 20 | /// 21 | public const char MaxValue = (char)0xFFFF; 22 | /// 23 | /// Represents the smallest possible value of a Char. This field is constant. 24 | /// 25 | public const char MinValue = (char)0x00; 26 | 27 | /// 28 | /// Converts the value of this instance to its equivalent string representation. 29 | /// 30 | /// The string representation of the value of this instance. 31 | public override String ToString() 32 | { 33 | return new String(m_value, 1); 34 | } 35 | 36 | /// 37 | /// Returns the lower case character. 38 | /// 39 | /// The lower case character. 40 | public char ToLower() 41 | { 42 | if ('A' <= m_value && m_value <= 'Z') 43 | { 44 | return (char)(m_value - ('A' - 'a')); 45 | } 46 | 47 | return m_value; 48 | } 49 | 50 | /// 51 | /// Returns the upper case character. 52 | /// 53 | /// The upper case character. 54 | public char ToUpper() 55 | { 56 | if ('a' <= m_value && m_value <= 'z') 57 | { 58 | return (char)(m_value + ('A' - 'a')); 59 | } 60 | 61 | return m_value; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Collections/ICollection.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Collections 5 | { 6 | using System; 7 | 8 | /// 9 | /// Defines size, enumerators, and synchronization methods for all nongeneric collections. 10 | /// 11 | public interface ICollection : IEnumerable 12 | { 13 | /// 14 | /// Copies the elements of the ICollection to an Array, starting at a particular Array index. 15 | /// 16 | /// The one-dimensional Array that is the destination of the elements copied from ICollection. The Array must have zero-based indexing. 17 | /// The zero-based index in array at which copying begins. 18 | void CopyTo(Array array, int index); 19 | 20 | /// 21 | /// Gets the number of elements contained in the ICollection. 22 | /// 23 | /// 24 | /// The number of elements contained in the ICollection. 25 | /// 26 | int Count 27 | { 28 | get; 29 | } 30 | 31 | /// 32 | /// Gets an object that can be used to synchronize access to the ICollection. 33 | /// 34 | /// 35 | /// An object that can be used to synchronize access to the ICollection. 36 | /// 37 | Object SyncRoot 38 | { 39 | get; 40 | } 41 | 42 | /// 43 | /// Gets a value indicating whether access to the ICollection is synchronized (thread safe). 44 | /// 45 | /// 46 | /// true if access to the ICollection is synchronized (thread safe); otherwise, false. 47 | /// 48 | bool IsSynchronized 49 | { 50 | get; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Collections/IComparer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Collections 5 | { 6 | using System; 7 | 8 | /// 9 | /// Exposes a method that compares two objects. 10 | /// 11 | public interface IComparer 12 | { 13 | /// 14 | /// Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. 15 | /// 16 | /// The first object to compare. 17 | /// The second object to compare. 18 | /// A signed integer that indicates the relative values of x and y, as shown in the following table. 19 | /// Less than zero : x is less than y. 20 | /// Zero : x equals y. 21 | /// Greater than zero : x is greater than y. 22 | /// 23 | int Compare(Object x, Object y); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Collections/IEnumerable.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Collections 5 | { 6 | /// 7 | /// Exposes an enumerator, which supports a simple iteration over a non-generic collection. 8 | /// 9 | public interface IEnumerable 10 | { 11 | /// 12 | /// Returns an enumerator that iterates through a collection. 13 | /// 14 | /// An IEnumerator object that can be used to iterate through the collection. 15 | IEnumerator GetEnumerator(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Collections/IEnumerator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Collections 5 | { 6 | using System; 7 | 8 | /// 9 | /// Supports a simple iteration over a non-generic collection. 10 | /// 11 | public interface IEnumerator 12 | { 13 | /// 14 | /// Advances the enumerator to the next element of the collection. 15 | /// 16 | /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. 17 | bool MoveNext(); 18 | 19 | /// 20 | /// Gets the element in the collection at the current position of the enumerator. 21 | /// 22 | /// 23 | /// The element in the collection at the current position of the enumerator. 24 | /// 25 | Object Current 26 | { 27 | get; 28 | } 29 | 30 | /// 31 | /// Sets the enumerator to its initial position, which is before the first element in the collection. 32 | /// 33 | void Reset(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Collections/IEqualityComparer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Collections 5 | { 6 | using System; 7 | /// 8 | /// Defines methods to support the comparison of objects for equality. 9 | /// 10 | public interface IEqualityComparer 11 | { 12 | /// 13 | /// Determines whether the specified objects are equal. 14 | /// 15 | /// The first object to compare. 16 | /// The second object to compare. 17 | /// true if the specified objects are equal; otherwise, false. 18 | bool Equals(Object x, Object y); 19 | 20 | /// 21 | /// Returns a hash code for the specified object. 22 | /// 23 | /// The Object for which a hash code is to be returned. 24 | /// A hash code for the specified object. 25 | int GetHashCode(Object obj); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Console.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Writes the specified data, followed by the current line terminator, to the standard output stream. 8 | /// 9 | /// 10 | /// The default line terminator is a string whose value is a carriage return followed by a line feed ("\r\n" in C#, or vbCrLf in Visual Basic). 11 | /// In .NET nanoFramework this will write to Visual Studio Output window. 12 | /// 13 | public static class Console 14 | { 15 | /// 16 | /// Writes the specified string value to the standard output stream. 17 | /// 18 | /// The value to write. 19 | /// 20 | /// In .NET nanoFramework this will write to Visual Studio Output window. 21 | /// 22 | public static void Write(string value) => Diagnostics.Debug.WriteLineNative(value, false); 23 | 24 | /// 25 | /// Writes the current line terminator to the standard output stream. 26 | /// 27 | /// 28 | /// In .NET nanoFramework this will write to Visual Studio Output window. 29 | /// 30 | public static void WriteLine() => Diagnostics.Debug.WriteLineNative(string.Empty, true); 31 | 32 | /// 33 | /// Writes the specified string value, followed by the current line terminator, to the standard output stream. 34 | /// 35 | /// The value to write. 36 | /// 37 | /// In .NET nanoFramework this will write to Visual Studio Output window. 38 | /// 39 | public static void WriteLine(string value) => Diagnostics.Debug.WriteLineNative(value, true); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/DBNull.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.ComponentModel; 5 | using System.Runtime.CompilerServices; 6 | 7 | namespace System 8 | { 9 | /// 10 | /// Represents a nonexistent value. This class cannot be inherited. 11 | /// 12 | [EditorBrowsable(EditorBrowsableState.Never)] 13 | [ExcludeType] 14 | public sealed class DBNull 15 | { 16 | 17 | /// 18 | /// Represents the sole instance of the DBNull class. 19 | /// 20 | /// DBNull is a singleton class, which means only this instance of this class can exist. 21 | public static readonly DBNull Value = new DBNull(); 22 | 23 | private DBNull() { } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/DayOfWeek.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System 7 | { 8 | /// 9 | /// Specifies the day of the week. 10 | /// 11 | [Serializable] 12 | public enum DayOfWeek 13 | { 14 | /// 15 | /// Indicates Sunday 16 | /// 17 | Sunday = 0, 18 | /// 19 | /// Indicates Monday 20 | /// 21 | Monday = 1, 22 | /// 23 | /// Indicates Tuesday 24 | /// 25 | Tuesday = 2, 26 | /// 27 | /// Indicates Wednesday 28 | /// 29 | Wednesday = 3, 30 | /// 31 | /// Indicates Thursday 32 | /// 33 | Thursday = 4, 34 | /// 35 | /// Indicates Friday 36 | /// 37 | Friday = 5, 38 | /// 39 | /// Indicates Saturday 40 | /// 41 | Saturday = 6, 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System.Diagnostics 7 | { 8 | /// 9 | /// Indicates to compilers that a method call or attribute should be ignored unless a specified conditional compilation symbol is defined. 10 | /// 11 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] 12 | [ExcludeType] 13 | [Serializable] 14 | public sealed class ConditionalAttribute : Attribute 15 | { 16 | private readonly String _conditionString; 17 | 18 | /// 19 | /// Initializes a new instance of the ConditionalAttribute class. 20 | /// 21 | /// A string that specifies the case-sensitive conditional compilation symbol that is associated with the attribute. 22 | public ConditionalAttribute(String conditionString) 23 | { 24 | _conditionString = conditionString; 25 | } 26 | 27 | /// 28 | /// Gets the conditional compilation symbol that is associated with the ConditionalAttribute attribute. 29 | /// 30 | /// A string that specifies the case-sensitive conditional compilation symbol that is associated with the ConditionalAttribute attribute. 31 | public String ConditionString 32 | { 33 | get 34 | { 35 | return _conditionString; 36 | } 37 | } 38 | 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Diagnostics/Debugger.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System.Diagnostics 7 | { 8 | /// 9 | /// Enables communication with a debugger. This class cannot be inherited. 10 | /// 11 | public static class Debugger 12 | { 13 | /// 14 | /// Gets a value that indicates whether a debugger is attached to the process. 15 | /// 16 | /// true if a debugger is attached; otherwise, false. 17 | public static extern bool IsAttached 18 | { 19 | [MethodImpl(MethodImplOptions.InternalCall)] 20 | get; 21 | } 22 | 23 | /// 24 | /// Signals a breakpoint to an attached debugger. 25 | /// 26 | [MethodImpl(MethodImplOptions.InternalCall)] 27 | public static extern void Break(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Diagnostics/NativeProfiledAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System.Diagnostics 7 | { 8 | /// 9 | /// Indicates that a method will profiled by the runtime, providing it has profiling capabilities enabled. 10 | /// 11 | /// 12 | /// This attribute is exclusive to the .NET nanoFramework runtime and has no effect on other runtimes. 13 | /// 14 | [ExcludeType] 15 | [DebuggerNonUserCode] 16 | [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] 17 | public sealed class NativeProfiledAttribute : Attribute 18 | { } 19 | } 20 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Enum.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System 7 | { 8 | /// 9 | /// Provides the base class for enumerations. 10 | /// 11 | [Serializable] 12 | public abstract class Enum : ValueType 13 | { 14 | /// 15 | /// Determines whether one or more bit fields are set in the current instance. 16 | /// 17 | /// An enumeration value. 18 | /// if the bit field or bit fields that are set in flag are also set in the current instance; otherwise, . 19 | /// is a different type than the current instance. 20 | [MethodImpl(MethodImplOptions.InternalCall)] 21 | public extern bool HasFlag(Enum flag); 22 | 23 | /// 24 | /// Converts the value of this instance to its equivalent string representation. 25 | /// 26 | /// The string representation of the value of this instance. 27 | /// Available only in mscorlib build with support for System.Reflection. 28 | public override String ToString() 29 | { 30 | #if NANOCLR_REFLECTION 31 | var type = GetType(); 32 | var field = type.GetField("value__"); 33 | var value = field.GetValue(this); 34 | 35 | return value.ToString(); 36 | #else 37 | throw new NotImplementedException(); 38 | #endif // NANOCLR_REFLECTION 39 | } 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/EventArgs.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Represents the base class for classes that contain event data, and provides a value to use for events that do not include event data. 8 | /// 9 | public class EventArgs 10 | { 11 | /// 12 | /// Provides a value to use with events that do not have event data. 13 | /// 14 | public static readonly EventArgs Empty = new EventArgs(); 15 | 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | public EventArgs() 20 | { 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/EventHandler.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Represents the method that will handle an event that has no event data. 8 | /// 9 | /// The source of the event. 10 | /// An object that contains no event data. 11 | public delegate void EventHandler(object sender, EventArgs e); 12 | 13 | /// 14 | /// Represents the method that will handle an event when the event provides data. 15 | /// 16 | /// The type of the event data generated by the event. 17 | /// The source of the event. 18 | /// An object that contains the event data. 19 | #pragma warning disable S3246 // This is nanoFramework implementation of the EventHandler. It's meant to be this way. 20 | public delegate void EventHandler(object sender, TEventArgs e); 21 | #pragma warning restore S3246 // Generic type parameters should be co/contravariant when possible 22 | } 23 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/FlagsAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System 7 | { 8 | /// 9 | /// Indicates that an enumeration can be treated as a bit field; that is, a set of flags. 10 | /// 11 | [AttributeUsage(AttributeTargets.Enum)] 12 | [ExcludeType] 13 | [Serializable] 14 | public class FlagsAttribute : Attribute 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/FormatException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown for invalid casting or explicit conversion. 8 | /// 9 | [Serializable] 10 | public class FormatException : SystemException 11 | { 12 | /// 13 | /// Initializes a new instance of the FormatException class. 14 | /// 15 | public FormatException() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the FormatException class with a specified error message. 21 | /// 22 | /// The message that describes the error. 23 | public FormatException(String message) 24 | : base(message) 25 | { 26 | } 27 | 28 | /// 29 | /// Initializes a new instance of the FormatException class with a specified error message and a reference to the inner exception that is the cause of this exception. 30 | /// 31 | /// The error message that explains the reason for the exception. 32 | /// The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. 33 | public FormatException(String message, Exception innerException) 34 | : base(message, innerException) 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/GC.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | using Runtime.CompilerServices; 7 | 8 | /// 9 | /// Controls the system garbage collector, a service that automatically reclaims unused memory. 10 | /// 11 | public static class GC 12 | { 13 | [MethodImpl(MethodImplOptions.InternalCall)] 14 | private static extern bool AnyPendingFinalizers(); 15 | 16 | /// 17 | /// Suspends the current thread until the thread that is processing the queue of finalizers has emptied that queue. 18 | /// 19 | public static void WaitForPendingFinalizers() 20 | { 21 | while (AnyPendingFinalizers()) Threading.Thread.Sleep(10); 22 | } 23 | 24 | /// 25 | /// Requests that the system not call the finalizer for the specified object. 26 | /// 27 | /// The object that a finalizer must not be called for. 28 | [MethodImpl(MethodImplOptions.InternalCall)] 29 | public static extern void SuppressFinalize(Object obj); 30 | 31 | /// 32 | /// Requests that the system call the finalizer for the specified object for which SuppressFinalize has previously been called. 33 | /// 34 | /// The object that a finalizer must be called for. 35 | [MethodImpl(MethodImplOptions.InternalCall)] 36 | public static extern void ReRegisterForFinalize(Object obj); 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/IAsyncResult.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Represents the status of an asynchronous operation. 8 | /// 9 | public interface IAsyncResult 10 | { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/ICloneable.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Defines an interface indicating that an object may be cloned. 8 | /// 9 | public interface ICloneable 10 | { 11 | /// 12 | /// Make a new object which is a copy of the object instanced. 13 | /// 14 | /// A new object that represents a clone of the object. 15 | Object Clone(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/IComparable.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Defines a generalized type-specific comparison method that a value type or class implements to order or sort its instances. 8 | /// 9 | public interface IComparable 10 | { 11 | /// 12 | /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. 13 | /// 14 | /// An object to compare with this instance. 15 | /// A value that indicates the relative order of the objects being compared. 16 | /// Less than zero : This instance precedes obj in the sort order. 17 | /// Zero : This instance occurs in the same position in the sort order as obj. 18 | /// Greater than zero : This instance follows obj in the sort order. 19 | /// 20 | int CompareTo(Object obj); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/ICustomFormatter.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #if NANOCLR_REFLECTION 5 | 6 | namespace System 7 | { 8 | /// 9 | /// Defines a method that supports custom formatting of the value of an object. 10 | /// 11 | /// Available only in mscorlib build with support for System.Reflection. 12 | public interface ICustomFormatter 13 | { 14 | /// 15 | /// Converts the value of a specified object to an equivalent string representation using specified format and culture-specific formatting information. 16 | /// 17 | /// A format string containing formatting specifications. 18 | /// An object to format. 19 | /// An object that supplies format information about the current instance. 20 | /// The string representation of the value of arg, formatted as specified by format and formatProvider. 21 | String Format(String format, Object arg, IFormatProvider formatProvider); 22 | 23 | } 24 | } 25 | 26 | #endif //NANOCLR_REFLECTION 27 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/IFormatProvider.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #if NANOCLR_REFLECTION 5 | 6 | namespace System 7 | { 8 | /// 9 | /// Provides a mechanism for retrieving an object to control formatting. 10 | /// 11 | /// Available only in mscorlib build with support for System.Reflection. 12 | public interface IFormatProvider 13 | { 14 | /// 15 | /// Returns an object that provides formatting services for the specified type. 16 | /// 17 | /// An object that specifies the type of format object to return. 18 | /// An instance of the object specified by formatType, if the IFormatProvider implementation can supply that type of object; otherwise, null reference (Nothing in Visual Basic). 19 | Object GetFormat(Type formatType); 20 | } 21 | } 22 | 23 | #endif // NANOCLR_REFLECTION 24 | 25 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/IFormattable.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #if NANOCLR_REFLECTION 5 | 6 | namespace System 7 | { 8 | /// 9 | /// Provides functionality to format the value of an object into a string representation. 10 | /// 11 | /// Available only in mscorlib build with support for System.Reflection. 12 | public interface IFormattable 13 | { 14 | /// 15 | /// Formats the value of the current instance using the specified format. 16 | /// 17 | /// The format to use -or- A null reference(Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation. 18 | /// The provider to use to format the value -or- A null reference(Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system. 19 | /// The value of the current instance in the specified format. 20 | String ToString(String format, IFormatProvider formatProvider); 21 | } 22 | } 23 | 24 | #endif // NANOCLR_REFLECTION 25 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/IndexOutOfRangeException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown when an attempt is made to access an element of an array with an index that is outside the bounds of the array. This class cannot be inherited. 8 | /// 9 | [Serializable] 10 | public class IndexOutOfRangeException : SystemException 11 | { 12 | /// 13 | /// Initializes a new instance of the IndexOutOfRangeException class. 14 | /// 15 | public IndexOutOfRangeException() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the IndexOutOfRangeException class with a specified error message. 21 | /// 22 | /// The message that describes the error. 23 | public IndexOutOfRangeException(String message) 24 | : base(message) 25 | { 26 | } 27 | 28 | /// 29 | /// Initializes a new instance of the IndexOutOfRangeException class with a specified error message and a reference to the inner exception that is the cause of this exception. 30 | /// 31 | /// The error message that explains the reason for the exception. 32 | /// The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. 33 | public IndexOutOfRangeException(String message, Exception innerException) 34 | : base(message, innerException) 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/IntPtr.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// A platform-specific type that is used to represent a pointer or a handle. 8 | /// 9 | [Serializable] 10 | public struct IntPtr 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/InvalidCastException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown for invalid casting or explicit conversion. 8 | /// 9 | [Serializable] 10 | public class InvalidCastException : SystemException 11 | { 12 | /// 13 | /// Initializes a new instance of the InvalidCastException class. 14 | /// 15 | public InvalidCastException() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the InvalidCastException class with a specified error message. 21 | /// 22 | /// The message that describes the error. 23 | public InvalidCastException(String message) 24 | : base(message) 25 | { 26 | } 27 | 28 | /// 29 | /// Initializes a new instance of the InvalidCastException class with a specified error message and a reference to the inner exception that is the cause of this exception. 30 | /// 31 | /// The error message that explains the reason for the exception. 32 | /// The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. 33 | public InvalidCastException(String message, Exception innerException) 34 | : base(message, innerException) 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/InvalidOperationException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown when a method call is invalid for the object's current state. 8 | /// 9 | [Serializable] 10 | public class InvalidOperationException : SystemException 11 | { 12 | /// 13 | /// Initializes a new instance of the InvalidOperationException class. 14 | /// 15 | public InvalidOperationException() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the InvalidOperationException class with a specified error message. 21 | /// 22 | /// The message that describes the error. 23 | public InvalidOperationException(String message) 24 | : base(message) 25 | { 26 | } 27 | 28 | /// 29 | /// Initializes a new instance of the InvalidOperationException class with a specified error message and a reference to the inner exception that is the cause of this exception. 30 | /// 31 | /// The error message that explains the reason for the exception. 32 | /// The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. 33 | public InvalidOperationException(String message, Exception innerException) 34 | : base(message, innerException) 35 | { 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/MarshalByRefObject.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Enables access to objects across application domain boundaries in applications that support remoting. 8 | /// 9 | [Serializable] 10 | public abstract class MarshalByRefObject 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Math.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | using Runtime.CompilerServices; 7 | 8 | internal static class MathInternal 9 | { 10 | [MethodImpl(MethodImplOptions.InternalCall)] 11 | internal static extern int Abs(int val); 12 | 13 | /// 14 | /// Returns the larger of two 32-bit signed integers. 15 | /// 16 | /// The first of two 32-bit signed integers to compare. 17 | /// The second of two 32-bit signed integers to compare. 18 | /// Parameter or , whichever is larger. 19 | internal static int Max(int val1, int val2) 20 | { 21 | return (val1 >= val2) ? val1 : val2; 22 | } 23 | 24 | /// 25 | /// Returns the smaller of two 32-bit signed integers. 26 | /// 27 | /// The first of two 32-bit signed integers to compare. 28 | /// The second of two 32-bit signed integers to compare. 29 | /// Parameter or , whichever is smaller. 30 | internal static int Min(int val1, int val2) 31 | { 32 | return (val2 >= val1) ? val1 : val2; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System 7 | { 8 | 9 | /// 10 | /// Indicates that a field of a serializable class should not be serialized. This class cannot be inherited. 11 | /// 12 | [AttributeUsage(AttributeTargets.Field)] 13 | [ExcludeType] 14 | public sealed class NonSerializedAttribute : Attribute 15 | { 16 | 17 | /// 18 | /// Initializes a new instance of the NonSerializedAttribute class. 19 | /// 20 | public NonSerializedAttribute() 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/NotImplementedException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown when a requested method or operation is not implemented. 8 | /// 9 | [Serializable] 10 | public class NotImplementedException : SystemException 11 | { 12 | /// 13 | /// Initializes a new instance of the NotImplementedException class with default properties. 14 | /// 15 | public NotImplementedException() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the NotImplementedException class with a specified error message. 21 | /// 22 | /// The error message that explains the reason for the exception. 23 | public NotImplementedException(String message) 24 | : base(message) 25 | { 26 | } 27 | 28 | /// 29 | /// Initializes a new instance of the NotImplementedException class with a specified error message and a reference to the inner exception that is the cause of this exception. 30 | /// 31 | /// The error message that explains the reason for the exception. 32 | /// The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. 33 | public NotImplementedException(String message, Exception innerException) 34 | : base(message, innerException) 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/NotSupportedException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality. 8 | /// 9 | [Serializable] 10 | public class NotSupportedException : SystemException 11 | { 12 | /// 13 | /// Initializes a new instance of the NotSupportedException class, setting the Message property of the new instance to a system-supplied message that describes the error. This message takes into account the current system culture. 14 | /// 15 | public NotSupportedException() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the NotSupportedException class with a specified error message. 21 | /// 22 | /// A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. 23 | public NotSupportedException(String message) 24 | : base(message) 25 | { 26 | } 27 | 28 | /// 29 | /// Initializes a new instance of the NotSupportedException class with a specified error message and a reference to the inner exception that is the cause of this exception. 30 | /// 31 | /// The error message that explains the reason for the exception. 32 | /// The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. 33 | public NotSupportedException(String message, Exception innerException) 34 | : base(message, innerException) 35 | { 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/NullReferenceException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown when there is an attempt to dereference a null object reference. 8 | /// 9 | [Serializable] 10 | public class NullReferenceException : SystemException 11 | { 12 | /// 13 | /// Initializes a new instance of the NullReferenceException class, setting the Message property of the new instance to a system-supplied message that describes the error, such as "The value 'null' was found where an instance of an object was required." This message takes into account the current system culture. 14 | /// 15 | public NullReferenceException() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the NullReferenceException class with a specified error message. 21 | /// 22 | /// A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. 23 | public NullReferenceException(String message) 24 | : base(message) 25 | { 26 | } 27 | 28 | /// 29 | /// Initializes a new instance of the NullReferenceException class with a specified error message and a reference to the inner exception that is the cause of this exception. 30 | /// 31 | /// The error message that explains the reason for the exception. 32 | /// The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. 33 | public NullReferenceException(String message, Exception innerException) 34 | : base(message, innerException) 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/ObjectDisposedException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown when an operation is performed on a disposed object. 8 | /// 9 | [Serializable] 10 | public class ObjectDisposedException : SystemException 11 | { 12 | /// 13 | /// Initializes a new instance of the ObjectDisposedException class. 14 | /// 15 | public ObjectDisposedException() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the ObjectDisposedException class with a string containing the name of the disposed object. 21 | /// 22 | /// A string containing the name of the disposed object. 23 | public ObjectDisposedException(String message) 24 | : base(message) 25 | { 26 | } 27 | 28 | /// 29 | /// Initializes a new instance of the ObjectDisposedException class with a specified error message and a reference to the inner exception that is the cause of this exception. 30 | /// 31 | /// The error message that explains the reason for the exception. 32 | /// The exception that is the cause of the current exception. If innerException is not null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. 33 | public ObjectDisposedException(String message, Exception innerException) 34 | : base(message, innerException) 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/OutOfMemoryException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown when there is not enough memory to continue the execution of a program. 8 | /// 9 | [Serializable] 10 | public class OutOfMemoryException : SystemException 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | public OutOfMemoryException() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the OutOfMemoryException class with a specified error message. 21 | /// 22 | /// The message that describes the error. 23 | public OutOfMemoryException(String message) 24 | : base(message) 25 | { 26 | } 27 | 28 | /// 29 | /// Initializes a new instance of the OutOfMemoryException class with a specified error message and a reference to the inner exception that is the cause of this exception. 30 | /// 31 | /// The error message that explains the reason for the exception. 32 | /// The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. 33 | public OutOfMemoryException(String message, Exception innerException) 34 | : base(message, innerException) 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System 7 | { 8 | /// 9 | /// Indicates that a method will allow a variable number of arguments in its invocation. This class cannot be inherited. 10 | /// 11 | [AttributeUsage(AttributeTargets.Parameter)] 12 | [ExcludeType] 13 | public sealed class ParamArrayAttribute : Attribute 14 | { 15 | /// 16 | /// Initializes a new instance of the ParamArrayAttribute class with default properties. 17 | /// 18 | public ParamArrayAttribute() { } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/PlatformNotSupportedException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown when a feature does not run on a particular platform. 8 | /// 9 | [Serializable] 10 | public class PlatformNotSupportedException : NotSupportedException 11 | { 12 | /// 13 | /// Initializes a new instance of the ArgumentNullException class. 14 | /// 15 | public PlatformNotSupportedException() 16 | { } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Reflection/Binder.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #if NANOCLR_REFLECTION 5 | 6 | namespace System.Reflection 7 | { 8 | using System; 9 | 10 | /// 11 | /// Selects a member from a list of candidates, and performs type conversion from actual argument type to formal argument type. 12 | /// 13 | /// Available only in mscorlib build with support for System.Reflection. 14 | [Serializable] 15 | public abstract class Binder 16 | { 17 | } 18 | } 19 | 20 | #endif // NANOCLR_REFLECTION 21 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System.Reflection 7 | { 8 | using System; 9 | 10 | /// 11 | /// Defines the member of a type that is the default member used by InvokeMember. 12 | /// 13 | /// Available only in mscorlib build with support for System.Reflection. 14 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface)] 15 | [ExcludeType] 16 | [Serializable] 17 | public sealed class DefaultMemberAttribute : Attribute 18 | { 19 | // You must provide the name of the member, this is required 20 | /// 21 | /// Initializes a new instance of the DefaultMemberAttribute class. 22 | /// 23 | /// A String containing the name of the member to invoke. This may be a constructor, method, property, or field. 24 | /// A suitable invocation attribute must be specified when the member is invoked. The default member of a class can be specified by passing an empty String as the name of the member. 25 | public DefaultMemberAttribute(string memberName) 26 | { 27 | MemberName = memberName; 28 | } 29 | 30 | /// 31 | /// Gets the name from the attribute. 32 | /// 33 | /// 34 | /// A string representing the member name. 35 | /// 36 | public string MemberName { get; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System.Reflection 7 | { 8 | [AttributeUsage(AttributeTargets.Field)] 9 | [ExcludeType] 10 | internal sealed class FieldNoReflectionAttribute : Attribute 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Reflection/IReflect.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #if NANOCLR_REFLECTION 5 | 6 | namespace System.Reflection 7 | { 8 | using System; 9 | 10 | /// 11 | /// Interoperates with the IDispatch interface. 12 | /// 13 | /// Available only in mscorlib build with support for System.Reflection. 14 | public interface IReflect 15 | { 16 | /// 17 | /// Retrieves a MethodInfo object that corresponds to a specified method under specified search constraints. 18 | /// 19 | /// The name of the member to find. 20 | /// The binding attributes used to control the search. 21 | /// A MethodInfo object containing the method information, with the match being based on the method name and search constraints specified in bindingAttr. 22 | MethodInfo GetMethod(String name, BindingFlags bindingAttr); 23 | 24 | /// 25 | /// Returns the FieldInfo object that corresponds to the specified field and binding flag. 26 | /// 27 | /// The name of the field to find. 28 | /// The binding attributes used to control the search. 29 | /// A FieldInfo object containing the field information for the named object that meets the search constraints specified in bindingAttr. 30 | FieldInfo GetField(String name, BindingFlags bindingAttr); 31 | } 32 | } 33 | 34 | #endif // NANOCLR_REFLECTION 35 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Reflection/MemberInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #if NANOCLR_REFLECTION 5 | 6 | namespace System.Reflection 7 | { 8 | using System; 9 | 10 | /// 11 | /// Obtains information about the attributes of a member and provides access to member metadata. 12 | /// 13 | /// Available only in mscorlib build with support for System.Reflection. 14 | [Serializable] 15 | public abstract class MemberInfo 16 | { 17 | /// 18 | /// When overridden in a derived class, gets a MemberTypes value indicating the type of the member method, constructor, event, and so on. 19 | /// 20 | /// 21 | /// A MemberTypes value indicating the type of member. 22 | /// 23 | public abstract MemberTypes MemberType 24 | { 25 | get; 26 | } 27 | 28 | /// 29 | /// Gets the name of the current member. 30 | /// 31 | /// 32 | /// A String containing the name of this member. 33 | /// 34 | public abstract String Name 35 | { 36 | get; 37 | } 38 | 39 | /// 40 | /// Gets the class that declares this member. 41 | /// 42 | /// 43 | /// The Type object for the class that declares this member. 44 | /// 45 | public abstract Type DeclaringType 46 | { 47 | get; 48 | } 49 | 50 | /// 51 | /// When overridden in a derived class, returns an array of all custom attributes applied to this member. 52 | /// 53 | /// true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. 54 | /// An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. 55 | public abstract object[] GetCustomAttributes(bool inherit); 56 | } 57 | } 58 | 59 | #endif // NANOCLR_REFLECTION 60 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #if NANOCLR_REFLECTION 5 | 6 | namespace System.Reflection 7 | { 8 | using System; 9 | using System.Runtime.CompilerServices; 10 | 11 | /// 12 | /// Marks each type of member that is defined as a derived class of MemberInfo. 13 | /// 14 | /// Available only in mscorlib build with support for System.Reflection. 15 | [Serializable] 16 | public enum MemberTypes 17 | { 18 | /// 19 | /// Specifies that the member is a constructor 20 | /// 21 | Constructor = 0x01, 22 | /// 23 | /// Specifies that the member is an event 24 | /// 25 | Event = 0x02, 26 | /// 27 | /// Specifies that the member is a field 28 | /// 29 | Field = 0x04, 30 | /// 31 | /// Specifies that the member is a method 32 | /// 33 | Method = 0x08, 34 | /// 35 | /// Specifies that the member is a property 36 | /// 37 | Property = 0x10, 38 | /// 39 | /// Specifies that the member is a type 40 | /// 41 | TypeInfo = 0x20, 42 | /// 43 | /// Specifies that the member is a custom member type 44 | /// 45 | Custom = 0x40, 46 | /// 47 | /// Specifies that the member is a nested type 48 | /// 49 | NestedType = 0x80, 50 | /// 51 | /// Specifies all member types. 52 | /// 53 | All = Constructor | Event | Field | Method | Property | TypeInfo | NestedType, 54 | } 55 | } 56 | 57 | #endif // NANOCLR_REFLECTION 58 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Reflection/MethodInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #if NANOCLR_REFLECTION 5 | 6 | namespace System.Reflection 7 | { 8 | using System; 9 | 10 | /// 11 | /// Discovers the attributes of a method and provides access to method metadata. 12 | /// 13 | /// Available only in mscorlib build with support for System.Reflection. 14 | [Serializable] 15 | public abstract class MethodInfo : MethodBase 16 | { 17 | /// 18 | /// Gets a MemberTypes value indicating that this member is a method. 19 | /// 20 | /// 21 | /// A MemberTypes value indicating that this member is a method. 22 | /// 23 | public override MemberTypes MemberType 24 | { 25 | get { return MemberTypes.Method; } 26 | } 27 | 28 | /// 29 | /// Gets the return type of this method. 30 | /// 31 | /// 32 | /// The return type of this method. 33 | /// 34 | /// To get the return type property, first get the class Type. From the Type, get the MethodInfo. From the MethodInfo, get the ReturnType. 35 | public abstract Type ReturnType 36 | { 37 | get; 38 | } 39 | } 40 | } 41 | 42 | #endif // NANOCLR_REFLECTION 43 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Reflection/ParameterInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #if NANOCLR_REFLECTION 5 | 6 | namespace System.Reflection 7 | { 8 | using System; 9 | 10 | /// 11 | /// Discovers the attributes of a parameter and provides access to parameter metadata. 12 | /// 13 | /// Available only in mscorlib build with support for System.Reflection. 14 | [Serializable] 15 | public abstract class ParameterInfo 16 | { 17 | #pragma warning disable S3459 // required to fill in in native code 18 | private readonly Type _parameterType; 19 | #pragma warning restore S3459 // Unassigned members should be removed 20 | 21 | /// 22 | /// Gets the of this parameter. 23 | /// 24 | /// The object that represents the of this parameter. 25 | public virtual Type ParameterType => _parameterType; 26 | } 27 | } 28 | 29 | #endif // NANOCLR_REFLECTION 30 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Reflection/ParameterModifier.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////namespace System.Reflection { 4 | namespace System.Reflection { 5 | 6 | using System; 7 | public struct ParameterModifier { 8 | internal bool[] _byRef; 9 | public ParameterModifier(int paramaterCount) { 10 | if (paramaterCount <= 0) 11 | throw new ArgumentException(Environment.GetResourceString("Arg_ParmArraySize")); 12 | 13 | _byRef = new bool[paramaterCount]; 14 | } 15 | 16 | public bool this[int index] { 17 | get {return _byRef[index]; } 18 | set {_byRef[index] = value;} 19 | } 20 | 21 | } 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Reflection/RuntimeConstructorInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #if NANOCLR_REFLECTION 5 | 6 | namespace System.Reflection 7 | { 8 | using System; 9 | using System.Runtime.CompilerServices; 10 | 11 | [Serializable] 12 | internal sealed class RuntimeConstructorInfo : ConstructorInfo 13 | { 14 | public override ParameterInfo[] GetParameters() 15 | { 16 | return GetParametersNative(); 17 | } 18 | } 19 | } 20 | 21 | #endif // NANOCLR_REFLECTION 22 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Reflection/RuntimeFieldInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #if NANOCLR_REFLECTION 5 | 6 | namespace System.Reflection 7 | { 8 | using System; 9 | using Runtime.CompilerServices; 10 | 11 | [Serializable] 12 | internal sealed class RuntimeFieldInfo : FieldInfo 13 | { 14 | public override extern String Name 15 | { 16 | [MethodImpl(MethodImplOptions.InternalCall)] 17 | get; 18 | } 19 | 20 | public override extern Type DeclaringType 21 | { 22 | [MethodImpl(MethodImplOptions.InternalCall)] 23 | get; 24 | } 25 | 26 | public override extern Type FieldType 27 | { 28 | [MethodImpl(MethodImplOptions.InternalCall)] 29 | get; 30 | } 31 | 32 | [MethodImpl(MethodImplOptions.InternalCall)] 33 | public override extern Object GetValue(Object obj); 34 | } 35 | } 36 | 37 | #endif // NANOCLR_REFLECTION 38 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Reflection/RuntimeMethodInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #if NANOCLR_REFLECTION 5 | 6 | namespace System.Reflection 7 | { 8 | using System; 9 | using Runtime.CompilerServices; 10 | 11 | [Serializable] 12 | internal sealed class RuntimeMethodInfo : MethodInfo 13 | { 14 | public override extern Type ReturnType 15 | { 16 | [MethodImpl(MethodImplOptions.InternalCall)] 17 | get; 18 | } 19 | 20 | public override object[] GetCustomAttributes(bool inherit) 21 | { 22 | return CustomAttributesHelpers.GetCustomAttributesInternal(GetCustomAttributesNative(inherit)); 23 | } 24 | 25 | public override ParameterInfo[] GetParameters() 26 | { 27 | return GetParametersNative(); 28 | } 29 | 30 | [MethodImpl(MethodImplOptions.InternalCall)] 31 | private extern object[] GetCustomAttributesNative(bool inherit); 32 | } 33 | } 34 | 35 | #endif // NANOCLR_REFLECTION 36 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/AccessedThroughPropertyAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Runtime.CompilerServices 5 | { 6 | using System; 7 | 8 | /// 9 | /// Specifies the name of the property that accesses the attributed field. 10 | /// 11 | [AttributeUsage(AttributeTargets.Field)] 12 | public sealed class AccessedThroughPropertyAttribute : Attribute 13 | { 14 | private readonly string _propertyName; 15 | 16 | /// 17 | /// Initializes a new instance of the AccessedThroughPropertyAttribute class with the name of the property used to access the attributed field. 18 | /// 19 | /// The name of the property used to access the attributed field. 20 | public AccessedThroughPropertyAttribute(string propertyName) 21 | { 22 | _propertyName = propertyName; 23 | } 24 | 25 | /// 26 | /// Gets the name of the property used to access the attributed field. 27 | /// 28 | /// 29 | /// The name of the property used to access the attributed field. 30 | /// 31 | public string PropertyName 32 | { 33 | get 34 | { 35 | return _propertyName; 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/AssemblyAttributesGoHere.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////namespace System.Runtime.CompilerServices { 4 | namespace System.Runtime.CompilerServices { 5 | 6 | using System; 7 | 8 | internal sealed class AssemblyAttributesGoHere 9 | { 10 | internal AssemblyAttributesGoHere() 11 | { 12 | } 13 | } 14 | 15 | internal sealed class AssemblyAttributesGoHereS 16 | { 17 | internal AssemblyAttributesGoHereS() 18 | { 19 | } 20 | } 21 | 22 | internal sealed class AssemblyAttributesGoHereM 23 | { 24 | internal AssemblyAttributesGoHereM() 25 | { 26 | } 27 | } 28 | 29 | internal sealed class AssemblyAttributesGoHereSM 30 | { 31 | internal AssemblyAttributesGoHereSM() 32 | { 33 | } 34 | } 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerArgumentExpressionAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | // ReSharper disable once CheckNamespace 5 | namespace System.Runtime.CompilerServices 6 | { 7 | /// 8 | /// Indicates that a parameter captures the expression passed for another parameter as a string. 9 | /// 10 | [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] 11 | [ExcludeType] 12 | public sealed class CallerArgumentExpressionAttribute : Attribute 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | /// The name of the parameter whose expression should be captured as a string. 18 | public CallerArgumentExpressionAttribute(string parameterName) 19 | { 20 | ParameterName = parameterName; 21 | } 22 | 23 | /// 24 | /// Gets the name of the parameter whose expression should be captured as a string. 25 | /// 26 | public string ParameterName { get; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | // ReSharper disable once CheckNamespace 5 | namespace System.Runtime.CompilerServices 6 | { 7 | /// 8 | /// Allows you to obtain the method or property name of the caller to the method. 9 | /// 10 | [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] 11 | [ExcludeType] 12 | public sealed class CallerMemberNameAttribute : Attribute 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | public CallerMemberNameAttribute() 18 | { 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallingConvention.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////namespace System.Runtime.CompilerServices 4 | namespace System.Runtime.CompilerServices 5 | { 6 | /** Types used in Custom Modifier to specify calling conventions. 7 | **/ 8 | public class CallConvCdecl 9 | { 10 | } 11 | 12 | public class CallConvStdcall 13 | { 14 | } 15 | 16 | public class CallConvThiscall 17 | { 18 | } 19 | 20 | public class CallConvFastcall 21 | { 22 | } 23 | 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CompilationRelaxations.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////namespace System.Runtime.CompilerServices 4 | namespace System.Runtime.CompilerServices 5 | { 6 | 7 | using System; 8 | 9 | [Serializable] 10 | enum CompilationRelaxations 11 | { 12 | ImpreciseException = 0x0001, 13 | ImpreciseFloat = 0x0002, 14 | ImpreciseAssign = 0x0004 15 | }; 16 | 17 | [Serializable, AttributeUsage(AttributeTargets.Module)] 18 | public class CompilationRelaxationsAttribute : Attribute 19 | { 20 | private int m_relaxations; // The relaxations. 21 | 22 | public CompilationRelaxationsAttribute ( 23 | int relaxations) 24 | { 25 | m_relaxations = relaxations; 26 | } 27 | 28 | public int CompilationRelaxations 29 | { 30 | get 31 | { 32 | return m_relaxations; 33 | } 34 | } 35 | } 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | namespace System.Runtime.CompilerServices 5 | { 6 | [Serializable, AttributeUsage(AttributeTargets.Class)] 7 | public class CompilerGlobalScopeAttribute : Attribute 8 | { 9 | public CompilerGlobalScopeAttribute () {} 10 | } 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CustomConstantAttribute.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////namespace System.Runtime.CompilerServices 4 | namespace System.Runtime.CompilerServices 5 | { 6 | [Serializable, AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited=false)] 7 | public abstract class CustomConstantAttribute : Attribute 8 | { 9 | public abstract Object Value { get; } 10 | } 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/DateTimeConstantAttribute.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////namespace System.Runtime.CompilerServices 4 | namespace System.Runtime.CompilerServices 5 | { 6 | [Serializable, AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited=false)] 7 | public sealed class DateTimeConstantAttribute : CustomConstantAttribute 8 | { 9 | public DateTimeConstantAttribute(long ticks) 10 | { 11 | date = new System.DateTime(ticks); 12 | } 13 | 14 | public override Object Value 15 | { 16 | get { 17 | return date; 18 | } 19 | } 20 | 21 | private System.DateTime date; 22 | } 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/DecimalConstantAttribute.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////namespace System.Runtime.CompilerServices 4 | namespace System.Runtime.CompilerServices 5 | { 6 | [Serializable, AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited=false),CLSCompliant(false)] 7 | public sealed class DecimalConstantAttribute : Attribute 8 | { 9 | public DecimalConstantAttribute( 10 | byte scale, 11 | byte sign, 12 | uint hi, 13 | uint mid, 14 | uint low 15 | ) 16 | { 17 | dec = new System.Decimal((int) low, (int)mid, (int)hi, (sign != 0), scale); 18 | } 19 | 20 | public System.Decimal Value 21 | { 22 | get { 23 | return dec; 24 | } 25 | } 26 | 27 | private System.Decimal dec; 28 | } 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/DiscardableAttribute.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////namespace System.Runtime.CompilerServices { 4 | namespace System.Runtime.CompilerServices { 5 | 6 | using System; 7 | 8 | /** Custom attribute to indicating a TypeDef is a discardable attribute 9 | */ 10 | public class DiscardableAttribute : Attribute 11 | { 12 | public DiscardableAttribute() 13 | { 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeTypeAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Runtime.CompilerServices 5 | { 6 | /// 7 | /// When a class, enum, or struct is marked with it will be excluded from the PE files and stubbs generated by .NET nanoFramework metadata processor. 8 | /// 9 | /// 10 | /// 11 | /// This attribute is exclusive to .NET nanoFramework and is not part of the .NET Standard. 12 | /// 13 | /// 14 | /// [!Important] Placing this attribute on a class will cause the type from being excluded from the assembly metadata and therefore it will not be available at all in assemblies using or referencing them. 15 | /// 16 | /// 17 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] 18 | public class ExcludeTypeAttribute : Attribute 19 | { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExtensionAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Runtime.CompilerServices 5 | { 6 | /// 7 | /// Indicates that a method is an extension method, or that a class or assembly contains extension methods. 8 | /// 9 | [ExcludeType] 10 | [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] 11 | public sealed class ExtensionAttribute : Attribute { } 12 | } 13 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IDispatchConstantAttribute.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | using System.Runtime.InteropServices; 6 | 7 | namespace System.Runtime.CompilerServices 8 | { 9 | [Serializable, AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited=false)] 10 | public sealed class IDispatchConstantAttribute : CustomConstantAttribute 11 | { 12 | public IDispatchConstantAttribute() 13 | { 14 | } 15 | 16 | public override Object Value 17 | { 18 | get 19 | { 20 | return new DispatchWrapper(null); 21 | } 22 | } 23 | 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IUnknownConstantAttribute.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | using System.Runtime.InteropServices; 6 | 7 | namespace System.Runtime.CompilerServices 8 | { 9 | [Serializable, AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited=false)] 10 | public sealed class IUnknownConstantAttribute : CustomConstantAttribute 11 | { 12 | public IUnknownConstantAttribute() 13 | { 14 | } 15 | 16 | public override Object Value 17 | { 18 | get 19 | { 20 | return new UnknownWrapper(null); 21 | } 22 | } 23 | 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Runtime.CompilerServices 5 | { 6 | /// 7 | /// Indicates the name by which an indexer is known in programming languages that do not support indexers directly. 8 | /// 9 | [AttributeUsage(AttributeTargets.Property)] 10 | [ExcludeType] 11 | [Serializable] 12 | public sealed class IndexerNameAttribute : Attribute 13 | { 14 | /// 15 | /// Initializes a new instance of the IndexerNameAttribute class. 16 | /// 17 | /// The name of the indexer, as shown to other languages. 18 | public IndexerNameAttribute(String indexerName) 19 | { } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Runtime.CompilerServices 5 | { 6 | /// 7 | /// Specifies that types that are ordinarily visible only within the current assembly are visible to a specified assembly. 8 | /// 9 | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] 10 | [ExcludeType] 11 | public sealed class InternalsVisibleToAttribute : Attribute 12 | { 13 | private readonly string _assemblyName; 14 | 15 | /// 16 | /// Initializes a new instance of the InternalsVisibleToAttribute class with the name of the specified friend assembly. 17 | /// 18 | /// The name of a friend assembly. 19 | public InternalsVisibleToAttribute(string assemblyName) 20 | { 21 | _assemblyName = assemblyName; 22 | } 23 | 24 | /// 25 | /// Gets the name of the friend assembly to which all types and type members that are marked with the internal keyword are to be made visible. 26 | /// 27 | /// 28 | /// A string that represents the name of the friend assembly. 29 | /// 30 | public string AssemblyName 31 | { 32 | get 33 | { 34 | return _assemblyName; 35 | } 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IsExternalInit.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.ComponentModel; 5 | 6 | namespace System.Runtime.CompilerServices 7 | { 8 | /// 9 | /// Reserved to be used by the compiler for tracking metadata. 10 | /// This class should not be used by developers in source code. 11 | /// 12 | [EditorBrowsable(EditorBrowsableState.Never)] 13 | public static class IsExternalInit 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IsVolatile.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////namespace System.Runtime.CompilerServices 4 | namespace System.Runtime.CompilerServices 5 | { 6 | public sealed class IsVolatile 7 | { 8 | // no instantiation, please! 9 | private IsVolatile() 10 | {} 11 | } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RequiredAttributeAttribute.cs: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | using System; 6 | 7 | namespace System.Runtime.CompilerServices 8 | { 9 | [Serializable, AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface, 10 | AllowMultiple=false, Inherited=false)] 11 | public sealed class RequiredAttributeAttribute : Attribute 12 | { 13 | private Type requiredContract; 14 | 15 | public RequiredAttributeAttribute (Type requiredContract) 16 | { 17 | this.requiredContract= requiredContract; 18 | } 19 | 20 | public Type RequiredContract 21 | { 22 | get { return this.requiredContract; } 23 | } 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeFeature.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Runtime.CompilerServices 5 | { 6 | /// 7 | /// Defines APIs to determine whether specific features are supported by the common language runtime. 8 | /// 9 | public static partial class RuntimeFeature 10 | { 11 | /// 12 | /// Indicates that this version of runtime supports default interface method implementations. 13 | /// 14 | public const string DefaultImplementationsOfInterfaces = nameof(DefaultImplementationsOfInterfaces); 15 | 16 | /// 17 | /// Checks whether a certain feature is supported by the Runtime. 18 | /// 19 | public static bool IsSupported(string feature) 20 | { 21 | if (feature == DefaultImplementationsOfInterfaces) 22 | { 23 | return true; 24 | } 25 | 26 | return false; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeHelpers.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Runtime.CompilerServices 5 | { 6 | /// 7 | /// Provides a set of static methods and properties that provide support for compilers. This class cannot be inherited. 8 | /// 9 | [Serializable] 10 | public static class RuntimeHelpers 11 | { 12 | /// 13 | /// Provides a fast way to initialize an array from data that is stored in a module. 14 | /// 15 | /// The array to be initialized. 16 | /// A field handle that specifies the location of the data used to initialize the array. 17 | [MethodImpl(MethodImplOptions.InternalCall)] 18 | public static extern void InitializeArray(Array array, RuntimeFieldHandle fldHandle); 19 | 20 | /// 21 | /// Boxes a value type. 22 | /// 23 | /// The value type to be boxed. 24 | /// A boxed copy of obj if it is a value class; otherwise, obj itself. 25 | [MethodImpl(MethodImplOptions.InternalCall)] 26 | public static extern Object GetObjectValue(Object obj); 27 | 28 | /// 29 | /// Runs a specified class constructor method. 30 | /// 31 | /// A type handle that specifies the class constructor method to run. 32 | [MethodImpl(MethodImplOptions.InternalCall)] 33 | public static extern void RunClassConstructor(RuntimeTypeHandle type); 34 | 35 | /// 36 | /// Gets the offset, in bytes, to the data in the given string. 37 | /// 38 | /// 39 | /// The byte offset, from the start of the String object to the first character in the string. 40 | /// 41 | public static extern int OffsetToStringData 42 | { 43 | [MethodImpl(MethodImplOptions.InternalCall)] 44 | get; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System.Runtime.InteropServices 7 | { 8 | /// 9 | /// Dictates which character set marshaled strings should use. 10 | /// 11 | [ExcludeType] 12 | [Serializable] 13 | public enum CharSet 14 | { 15 | /// 16 | /// This value is obsolete and has the same behavior as CharSet.Ansi. 17 | /// 18 | None = 1, 19 | /// 20 | /// Marshal strings as multiple-byte character strings. 21 | /// 22 | Ansi = 2, 23 | /// 24 | /// Marshal strings as Unicode 2-byte characters. 25 | /// 26 | Unicode = 3, 27 | /// 28 | /// Automatically marshal strings appropriately for the target operating system. The default is Unicode on Windows NT, Windows 2000, Windows XP, and the Windows Server 2003 family; 29 | /// the default is Ansi on Windows 98 and Windows Me. Although the common language runtime default is Auto, languages may override this default. 30 | /// For example, by default C# marks all methods and types as Ansi. 31 | /// 32 | Auto = 4 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System.Runtime.InteropServices 7 | { 8 | /// 9 | /// Controls the layout of an object when exported to unmanaged code. 10 | /// 11 | [ExcludeType] 12 | [Serializable] 13 | public enum LayoutKind 14 | { 15 | /// 16 | /// The members of the object are laid out sequentially, in the order in which they appear when exported to unmanaged memory. 17 | /// The members are laid out according to the packing specified in StructLayoutAttribute.Pack, and can be noncontiguous. 18 | /// 19 | Sequential = 0, 20 | /// 21 | /// The precise position of each member of an object in unmanaged memory is explicitly controlled, subject to the setting of the StructLayoutAttribute.Pack field. 22 | /// Each member must use the FieldOffsetAttribute to indicate the position of that field within the type. 23 | /// 24 | Explicit = 2, 25 | /// 26 | /// The runtime automatically chooses an appropriate layout for the members of an object in unmanaged memory. 27 | /// Objects defined with this enumeration member cannot be exposed outside of managed code. Attempting to do so generates an exception. 28 | /// 29 | Auto = 3 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/Remoting/RemotingServices.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System.Runtime.Remoting 7 | { 8 | /// 9 | /// Provides several methods for using and publishing remoted objects and proxies. This class cannot be inherited. 10 | /// 11 | public static class RemotingServices 12 | { 13 | /// 14 | /// Returns a Boolean value that indicates whether the given object is a transparent proxy or a real object. 15 | /// 16 | /// The reference to the object to check. 17 | /// A Boolean value that indicates whether the object specified in the proxy parameter is a transparent proxy or a real object. 18 | [MethodImpl(MethodImplOptions.InternalCall)] 19 | public static extern bool IsTransparentProxy(Object proxy); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.ComponentModel; 5 | using System.Runtime.CompilerServices; 6 | 7 | namespace System.Runtime.Remoting.Proxies 8 | { 9 | [EditorBrowsable(EditorBrowsableState.Never)] 10 | [ExcludeType] 11 | internal sealed class __TransparentProxy 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/RuntimeArgumentHandle.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// This value type is used for constructing System.ArgIterator. 8 | /// 9 | public struct RuntimeArgumentHandle 10 | { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/RuntimeFieldHandle.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Represents a field using an internal metadata token. 8 | /// 9 | [Serializable] 10 | public struct RuntimeFieldHandle 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/RuntimeMethodHandle.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// RuntimeMethodHandle is a handle to the internal metadata representation of a method. 8 | /// 9 | [Serializable] 10 | public struct RuntimeMethodHandle 11 | { 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/RuntimeTypeHandle.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Represents a type using an internal metadata token. 8 | /// 9 | [Serializable] 10 | public struct RuntimeTypeHandle 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/SerializableAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System 7 | { 8 | /// 9 | /// Indicates that a class can be serialized. This class cannot be inherited. 10 | /// 11 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false)] 12 | [ExcludeType] 13 | public sealed class SerializableAttribute : Attribute 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/SystemException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Serves as the base class for system exceptions namespace. 8 | /// 9 | [Serializable] 10 | public class SystemException : Exception 11 | { 12 | /// 13 | /// Initializes a new instance of the SystemException class. 14 | /// 15 | public SystemException() { } 16 | 17 | /// 18 | /// Initializes a new instance of the SystemException class with a specified error message. 19 | /// 20 | /// The message that describes the error. 21 | public SystemException(String message) 22 | : base(message) 23 | { 24 | } 25 | 26 | /// 27 | /// Initializes a new instance of the SystemException class with a specified error message and a reference to the inner exception that is the cause of this exception. 28 | /// 29 | /// The error message that explains the reason for the exception. 30 | /// The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. 31 | public SystemException(String message, Exception innerException) 32 | : base(message, innerException) 33 | { 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Runtime.Versioning 5 | { 6 | /// 7 | /// Identifies the version of the .NET Framework that a particular assembly was compiled against. 8 | /// 9 | [AttributeUsage(AttributeTargets.Assembly)] 10 | public sealed class TargetFrameworkAttribute : Attribute 11 | { 12 | private String _frameworkName; 13 | private String _frameworkDisplayName; 14 | 15 | /// 16 | /// Initializes an instance of the TargetFrameworkAttribute class by specifying the .NET Framework version against which an assembly was built. 17 | /// 18 | /// The version of the .NET Framework against which the assembly was built. 19 | /// 20 | public TargetFrameworkAttribute(String frameworkName) 21 | { 22 | ArgumentNullException.ThrowIfNull(frameworkName); 23 | 24 | _frameworkName = frameworkName; 25 | } 26 | 27 | /// 28 | /// Gets the name of the .NET Framework version against which a particular assembly was compiled. 29 | /// 30 | /// 31 | /// The name of the .NET Framework version with which the assembly was compiled. 32 | /// 33 | public String FrameworkName 34 | { 35 | get { return _frameworkName; } 36 | } 37 | 38 | #pragma warning disable S2292 // Trivial properties should be auto-implemented 39 | /// 40 | /// Gets the display name of the .NET Framework version against which an assembly was built. 41 | /// 42 | /// 43 | /// The display name of the .NET Framework version. 44 | /// 45 | public String FrameworkDisplayName 46 | #pragma warning restore S2292 // Trivial properties should be auto-implemented 47 | { 48 | get { return _frameworkDisplayName; } 49 | set { _frameworkDisplayName = value; } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/ThreadAttributes.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace System 7 | { 8 | /// 9 | /// Indicates that the COM threading model for an application is single-threaded apartment (STA). 10 | /// 11 | [AttributeUsage(AttributeTargets.Method)] 12 | [ExcludeType] 13 | public sealed class STAThreadAttribute : Attribute 14 | { 15 | /// 16 | /// Initializes a new instance of the STAThreadAttribute class. 17 | /// 18 | public STAThreadAttribute() 19 | { 20 | } 21 | } 22 | 23 | /// 24 | /// Indicates that the COM threading model for an application is multithreaded apartment (MTA). 25 | /// 26 | [AttributeUsage(AttributeTargets.Method)] 27 | [ExcludeType] 28 | public sealed class MTAThreadAttribute : Attribute 29 | { 30 | /// 31 | /// Initializes a new instance of the MTAThreadAttribute class. 32 | /// 33 | public MTAThreadAttribute() 34 | { 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Threading/AutoResetEvent.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Threading 5 | { 6 | using Runtime.CompilerServices; 7 | /// 8 | /// Notifies a waiting thread that an event has occurred. This class cannot be inherited. 9 | /// 10 | public sealed class AutoResetEvent : WaitHandle 11 | { 12 | /// 13 | /// Initializes a new instance of the AutoResetEvent class with a Boolean value indicating whether to set the initial state to signaled. 14 | /// 15 | /// true to set the initial state to signaled; false to set the initial state to non-signaled. 16 | [MethodImpl(MethodImplOptions.InternalCall)] 17 | public extern AutoResetEvent(bool initialState); 18 | 19 | /// 20 | /// Sets the state of the event to nonsignaled, causing threads to block. 21 | /// 22 | /// true if the operation succeeds; otherwise, false. 23 | [MethodImpl(MethodImplOptions.InternalCall)] 24 | public extern bool Reset(); 25 | 26 | /// 27 | /// Sets the state of the event to signaled, allowing one or more waiting threads to proceed. 28 | /// 29 | /// true if the operation succeeds; otherwise, false. 30 | [MethodImpl(MethodImplOptions.InternalCall)] 31 | public extern bool Set(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Threading/ManualResetEvent.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Threading 5 | { 6 | using Runtime.CompilerServices; 7 | /// 8 | /// Notifies one or more waiting threads that an event has occurred. This class cannot be inherited. 9 | /// 10 | public sealed class ManualResetEvent : WaitHandle 11 | { 12 | /// 13 | /// Initializes a new instance of the ManualResetEvent class with a Boolean value indicating whether to set the initial state to signaled. 14 | /// 15 | /// true to set the initial state signaled; false to set the initial state to nonsignaled. 16 | [MethodImpl(MethodImplOptions.InternalCall)] 17 | public extern ManualResetEvent(bool initialState); 18 | 19 | /// 20 | /// Sets the state of the event to nonsignaled, causing threads to block. 21 | /// 22 | /// true if the operation succeeds; otherwise, false. 23 | [MethodImpl(MethodImplOptions.InternalCall)] 24 | public extern bool Reset(); 25 | 26 | /// 27 | /// Sets the state of the event to signaled, allowing one or more waiting threads to proceed. 28 | /// 29 | /// true if the operation succeeds; otherwise, false. 30 | [MethodImpl(MethodImplOptions.InternalCall)] 31 | public extern bool Set(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Threading/Monitor.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Threading 5 | { 6 | using System; 7 | using Runtime.CompilerServices; 8 | 9 | /// 10 | /// Provides a mechanism that synchronizes access to objects. 11 | /// 12 | public static class Monitor 13 | { 14 | /// 15 | /// Acquires an exclusive lock on the specified object. 16 | /// 17 | /// The object on which to acquire the monitor lock. 18 | [MethodImpl(MethodImplOptions.InternalCall)] 19 | public static extern void Enter(Object obj); 20 | 21 | /// 22 | /// Releases an exclusive lock on the specified object. 23 | /// 24 | /// The object on which to release the lock. 25 | [MethodImpl(MethodImplOptions.InternalCall)] 26 | public static extern void Exit(Object obj); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Threading/SpinWait.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary/System/Threading/SpinWait.cs -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Threading/ThreadAbortException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Threading 5 | { 6 | using System; 7 | 8 | /// 9 | /// The exception that is thrown when a call is made to the Abort method. This class cannot be inherited. 10 | /// 11 | [Serializable] 12 | public sealed class ThreadAbortException : SystemException 13 | { 14 | private ThreadAbortException() { } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Threading/ThreadPriority.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Threading 5 | { 6 | /// 7 | /// Specifies the scheduling priority of a Thread. 8 | /// 9 | [Serializable] 10 | public enum ThreadPriority 11 | { 12 | /// 13 | /// The Thread can be scheduled after threads with any other priority. 14 | /// 15 | Lowest = 0, 16 | /// 17 | /// The Thread can be scheduled after threads with Normal priority and before those with Lowest priority. 18 | /// 19 | BelowNormal = 1, 20 | /// 21 | /// The Thread can be scheduled after threads with AboveNormal priority and before those with BelowNormal priority. Threads have Normal priority by default. 22 | /// 23 | Normal = 2, 24 | /// 25 | /// The Thread can be scheduled after threads with Highest priority and before those with Normal priority. 26 | /// 27 | AboveNormal = 3, 28 | /// 29 | /// The Thread can be scheduled before threads with any other priority. 30 | /// 31 | Highest = 4 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Threading/ThreadStart.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Threading 5 | { 6 | //NOTE: If you change the signature here, there is code in COMSynchronization 7 | // that invokes this delegate in native. 8 | 9 | /// 10 | /// Represents the method that executes on a Thread. 11 | /// 12 | public delegate void ThreadStart(); 13 | } 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Threading/Timeout.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System.Threading 5 | { 6 | /// 7 | /// Contains constants that specify infinite time-out intervals. This class cannot be inherited. 8 | /// 9 | public static class Timeout 10 | { 11 | /// 12 | /// A constant used to specify an infinite waiting period, for threading methods that accept an Int32 parameter. 13 | /// 14 | /// The value of this field is -1 (0xFFFFFFFF). 15 | public const int Infinite = -1; 16 | 17 | /// 18 | /// A constant used to specify an infinite waiting period, for methods that accept a parameter. 19 | /// 20 | /// 21 | /// For threading methods that accept a timeout parameter of type , such as and , this value is used to suspend the thread indefinitely. However, in most cases, we recommend that you use other classes such as , , or instead to synchronize threads or manage resources. 22 | /// The value of this field is -00:00:00.0010000, or -1 millisecond. 23 | /// 24 | public static readonly TimeSpan InfiniteTimeSpan = new TimeSpan(0, 0, 0, 0, Infinite); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/TimeoutException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// The exception that is thrown when the time allotted for a process or operation has expired. 8 | /// 9 | [Serializable] 10 | public class TimeoutException : SystemException 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | public TimeoutException() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the class with a specified error message. 21 | /// 22 | /// The message that describes the error. 23 | public TimeoutException(String message) 24 | : base(message) 25 | { 26 | } 27 | 28 | /// 29 | /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. 30 | /// 31 | /// The error message that explains the reason for the exception. 32 | /// The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. 33 | public TimeoutException(String message, Exception innerException) 34 | : base(message, innerException) 35 | { 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/TypedReference.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.ComponentModel; 5 | using System.Runtime.CompilerServices; 6 | 7 | namespace System 8 | { 9 | 10 | /// 11 | /// Describes objects that contain both a managed pointer to a location and a runtime representation of the type that may be stored at that location. 12 | /// 13 | [EditorBrowsable(EditorBrowsableState.Never)] 14 | [ExcludeType] 15 | public struct TypedReference { } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/UIntPtr.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.ComponentModel; 5 | using System.Runtime.CompilerServices; 6 | 7 | namespace System 8 | { 9 | /// 10 | /// A platform-specific type that is used to represent a pointer or a handle. 11 | /// 12 | [EditorBrowsable(EditorBrowsableState.Never)] 13 | [ExcludeType] 14 | [Serializable] 15 | public struct UIntPtr 16 | { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/ValueType.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | using Runtime.CompilerServices; 7 | 8 | /// 9 | /// Provides the base class for value types. 10 | /// 11 | [Serializable] 12 | #pragma warning disable CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode() 13 | /////////////////////////////////////////////////////////////////////////////////////////////////////// 14 | // GetHashCode() implementation is provided by general native function CLR_RT_HeapBlock::GetHashCode // 15 | /////////////////////////////////////////////////////////////////////////////////////////////////////// 16 | #pragma warning disable S1206 // "Equals(Object)" and "GetHashCode()" should be overridden in pairs 17 | public abstract class ValueType 18 | #pragma warning restore S1206 // "Equals(Object)" and "GetHashCode()" should be overridden in pairs 19 | #pragma warning restore CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode() 20 | { 21 | 22 | /// 23 | /// Indicates whether this instance and a specified object are equal. 24 | /// 25 | /// The object to compare with the current instance. 26 | /// true if obj and this instance are the same type and represent the same value; otherwise, false. 27 | [MethodImpl(MethodImplOptions.InternalCall)] 28 | public override extern bool Equals(Object obj); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/Void.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | /// 7 | /// Specifies a return value type for a method that does not return a value. 8 | /// 9 | [Serializable] 10 | public struct Void 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/System/WeakReference.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace System 5 | { 6 | using Runtime.CompilerServices; 7 | /// 8 | /// Represents a weak reference, which references an object while still allowing that object to be reclaimed by garbage collection. 9 | /// 10 | [Serializable] 11 | public class WeakReference 12 | { 13 | /// 14 | /// Initializes a new instance of the WeakReference class, referencing the specified object. 15 | /// 16 | /// The object to track or null. 17 | [MethodImpl(MethodImplOptions.InternalCall)] 18 | public extern WeakReference(Object target); 19 | 20 | /// 21 | /// Gets an indication whether the object referenced by the current WeakReference object has been garbage collected. 22 | /// 23 | /// true if the object referenced by the current WeakReference object has not been garbage collected and is still accessible; otherwise, false. 24 | public virtual extern bool IsAlive 25 | { 26 | [MethodImpl(MethodImplOptions.InternalCall)] 27 | get; 28 | } 29 | 30 | /// 31 | /// Gets or sets the object (the target) referenced by the current WeakReference object. 32 | /// 33 | /// null if the object referenced by the current WeakReference object has been garbage collected; otherwise, a reference to the object referenced by the current WeakReference object. 34 | public virtual extern Object Target 35 | { 36 | [MethodImpl(MethodImplOptions.InternalCall)] 37 | get; 38 | 39 | [MethodImpl(MethodImplOptions.InternalCall)] 40 | set; 41 | } 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/coreAssembly.rsp: -------------------------------------------------------------------------------- 1 | # CSC requires the runtimemetadataversion flag when building a core assembly (containing System.Object) 2 | /runtimemetadataversion:v4.0.30319 3 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanoframework/CoreLibrary/0e0f7bed1a529816b8515855e864defb56ef4b52/nanoFramework.CoreLibrary/key.snk -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /nanoFramework.CoreLibrary/packages.lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dependencies": { 4 | ".NETnanoFramework,Version=v1.0": { 5 | "Microsoft.Build.Tasks.Git": { 6 | "type": "Direct", 7 | "requested": "[1.1.1, 1.1.1]", 8 | "resolved": "1.1.1", 9 | "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" 10 | }, 11 | "Microsoft.SourceLink.Common": { 12 | "type": "Direct", 13 | "requested": "[1.1.1, 1.1.1]", 14 | "resolved": "1.1.1", 15 | "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" 16 | }, 17 | "Microsoft.SourceLink.GitHub": { 18 | "type": "Direct", 19 | "requested": "[1.1.1, 1.1.1]", 20 | "resolved": "1.1.1", 21 | "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==" 22 | }, 23 | "Nerdbank.GitVersioning": { 24 | "type": "Direct", 25 | "requested": "[3.7.115, 3.7.115]", 26 | "resolved": "3.7.115", 27 | "contentHash": "EpXamaAdRfG/BMxGgvZlTM0npRnkmXUjAj8OdNKd17t4oN+2nvjdv/KnFmzOOMDqvlwB49UCwtOHJrAQTfUBtQ==" 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /spelling_exclusion.dic: -------------------------------------------------------------------------------- 1 | nano 2 | -------------------------------------------------------------------------------- /version.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", 3 | "version": "1.17", 4 | "assemblyVersion": { 5 | "precision": "build" 6 | }, 7 | "semVer1NumericIdentifierPadding": 3, 8 | "nuGetPackageVersion": { 9 | "semVer": 2.0 10 | }, 11 | "publicReleaseRefSpec": [ 12 | "^refs/heads/develop$", 13 | "^refs/heads/main$", 14 | "^refs/heads/v\\d+(?:\\.\\d+)?$" 15 | ], 16 | "cloudBuild": { 17 | "setAllVariables": true 18 | }, 19 | "release": { 20 | "branchName": "release-v{version}", 21 | "versionIncrement": "build", 22 | "firstUnstableTag": "preview" 23 | } 24 | } 25 | --------------------------------------------------------------------------------