Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Perovich <alperovi@microsoft.com>2017-03-04 02:44:29 +0300
committerAlex Perovich <alperovi@microsoft.com>2017-03-04 03:24:43 +0300
commit7aba657e077f0d65893392b7764724cd9fafeb42 (patch)
tree361636004f1c97905e4a6b4f65f6e8e463f12c59 /src/System.Private.CoreLib/shared
parent3c837a0e8cee5302190a5f9066bae7685f72f24c (diff)
Shared changes from coreclr
Diffstat (limited to 'src/System.Private.CoreLib/shared')
-rw-r--r--src/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs44
-rw-r--r--src/System.Private.CoreLib/shared/Interop/Windows/Interop.Libraries.cs1
-rw-r--r--src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems182
-rw-r--r--src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.shproj19
-rw-r--r--src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.sources93
-rw-r--r--src/System.Private.CoreLib/shared/System/Action.cs35
-rw-r--r--src/System.Private.CoreLib/shared/System/ApplicationException.cs56
-rw-r--r--src/System.Private.CoreLib/shared/System/ArgumentNullException.cs53
-rw-r--r--src/System.Private.CoreLib/shared/System/ArithmeticException.cs51
-rw-r--r--src/System.Private.CoreLib/shared/System/ArrayTypeMismatchException.cs51
-rw-r--r--src/System.Private.CoreLib/shared/System/AsyncCallback.cs17
-rw-r--r--src/System.Private.CoreLib/shared/System/AttributeTargets.cs36
-rw-r--r--src/System.Private.CoreLib/shared/System/AttributeUsageAttribute.cs60
-rw-r--r--src/System.Private.CoreLib/shared/System/CLSCompliantAttribute.cs34
-rw-r--r--src/System.Private.CoreLib/shared/System/CharEnumerator.cs81
-rw-r--r--src/System.Private.CoreLib/shared/System/Collections/IStructuralComparable.cs13
-rw-r--r--src/System.Private.CoreLib/shared/System/Collections/IStructuralEquatable.cs12
-rw-r--r--src/System.Private.CoreLib/shared/System/ComponentModel/EditorBrowsableAttribute.cs48
-rw-r--r--src/System.Private.CoreLib/shared/System/DataMisalignedException.cs39
-rw-r--r--src/System.Private.CoreLib/shared/System/DateTimeKind.cs17
-rw-r--r--src/System.Private.CoreLib/shared/System/DayOfWeek.cs27
-rw-r--r--src/System.Private.CoreLib/shared/System/DivideByZeroException.cs41
-rw-r--r--src/System.Private.CoreLib/shared/System/DuplicateWaitObjectException.cs65
-rw-r--r--src/System.Private.CoreLib/shared/System/EntryPointNotFoundException.cs42
-rw-r--r--src/System.Private.CoreLib/shared/System/EventArgs.cs19
-rw-r--r--src/System.Private.CoreLib/shared/System/EventHandler.cs14
-rw-r--r--src/System.Private.CoreLib/shared/System/ExecutionEngineException.cs47
-rw-r--r--src/System.Private.CoreLib/shared/System/FieldAccessException.cs39
-rw-r--r--src/System.Private.CoreLib/shared/System/FlagsAttribute.cs22
-rw-r--r--src/System.Private.CoreLib/shared/System/FormatException.cs41
-rw-r--r--src/System.Private.CoreLib/shared/System/FormattableString.cs81
-rw-r--r--src/System.Private.CoreLib/shared/System/IAsyncResult.cs30
-rw-r--r--src/System.Private.CoreLib/shared/System/IComparable.cs37
-rw-r--r--src/System.Private.CoreLib/shared/System/IConvertible.cs63
-rw-r--r--src/System.Private.CoreLib/shared/System/ICustomFormatter.cs24
-rw-r--r--src/System.Private.CoreLib/shared/System/IDisposable.cs60
-rw-r--r--src/System.Private.CoreLib/shared/System/IEquatable.cs14
-rw-r--r--src/System.Private.CoreLib/shared/System/IFormatProvider.cs23
-rw-r--r--src/System.Private.CoreLib/shared/System/IFormattable.cs15
-rw-r--r--src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs2
-rw-r--r--src/System.Private.CoreLib/shared/System/IObservable.cs11
-rw-r--r--src/System.Private.CoreLib/shared/System/IObserver.cs13
-rw-r--r--src/System.Private.CoreLib/shared/System/IProgress.cs15
-rw-r--r--src/System.Private.CoreLib/shared/System/IndexOutOfRangeException.cs41
-rw-r--r--src/System.Private.CoreLib/shared/System/InsufficientExecutionStackException.cs32
-rw-r--r--src/System.Private.CoreLib/shared/System/InvalidCastException.cs44
-rw-r--r--src/System.Private.CoreLib/shared/System/InvalidOperationException.cs42
-rw-r--r--src/System.Private.CoreLib/shared/System/InvalidProgramException.cs41
-rw-r--r--src/System.Private.CoreLib/shared/System/InvalidTimeZoneException.cs28
-rw-r--r--src/System.Private.CoreLib/shared/System/MarshalByRefObject.cs30
-rw-r--r--src/System.Private.CoreLib/shared/System/MemberAccessException.cs48
-rw-r--r--src/System.Private.CoreLib/shared/System/MethodAccessException.cs39
-rw-r--r--src/System.Private.CoreLib/shared/System/MidpointRounding.cs12
-rw-r--r--src/System.Private.CoreLib/shared/System/MulticastNotSupportedException.cs37
-rw-r--r--src/System.Private.CoreLib/shared/System/NotFiniteNumberException.cs71
-rw-r--r--src/System.Private.CoreLib/shared/System/NotImplementedException.cs40
-rw-r--r--src/System.Private.CoreLib/shared/System/NotSupportedException.cs41
-rw-r--r--src/System.Private.CoreLib/shared/System/NullReferenceException.cs41
-rw-r--r--src/System.Private.CoreLib/shared/System/ObjectDisposedException.cs82
-rw-r--r--src/System.Private.CoreLib/shared/System/ObsoleteAttribute.cs61
-rw-r--r--src/System.Private.CoreLib/shared/System/OverflowException.cs41
-rw-r--r--src/System.Private.CoreLib/shared/System/ParamArrayAttribute.cs21
-rw-r--r--src/System.Private.CoreLib/shared/System/PlatformNotSupportedException.cs41
-rw-r--r--src/System.Private.CoreLib/shared/System/RankException.cs42
-rw-r--r--src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/ExtensionAttribute.cs14
-rw-r--r--src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/FormattableStringFactory.cs58
-rw-r--r--src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/ITuple.cs22
-rw-r--r--src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/IsVolatile.cs12
-rw-r--r--src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs57
-rw-r--r--src/System.Private.CoreLib/shared/System/StackOverflowException.cs41
-rw-r--r--src/System.Private.CoreLib/shared/System/StringSplitOptions.cs13
-rw-r--r--src/System.Private.CoreLib/shared/System/SystemException.cs32
-rw-r--r--src/System.Private.CoreLib/shared/System/Text/Normalization.cs29
-rw-r--r--src/System.Private.CoreLib/shared/System/ThreadAttributes.cs28
-rw-r--r--src/System.Private.CoreLib/shared/System/ThreadStaticAttribute.cs28
-rw-r--r--src/System.Private.CoreLib/shared/System/Threading/Timeout.cs20
-rw-r--r--src/System.Private.CoreLib/shared/System/TimeZoneNotFoundException.cs28
-rw-r--r--src/System.Private.CoreLib/shared/System/TimeoutException.cs41
-rw-r--r--src/System.Private.CoreLib/shared/System/TupleExtensions.cs930
-rw-r--r--src/System.Private.CoreLib/shared/System/TypeAccessException.cs34
-rw-r--r--src/System.Private.CoreLib/shared/System/TypeCode.cs48
-rw-r--r--src/System.Private.CoreLib/shared/System/TypeInitializationException.cs79
-rw-r--r--src/System.Private.CoreLib/shared/System/UnauthorizedAccessException.cs45
-rw-r--r--src/System.Private.CoreLib/shared/System/UnhandledExceptionEventArgs.cs29
-rw-r--r--src/System.Private.CoreLib/shared/System/UnhandledExceptionEventHandler.cs9
-rw-r--r--src/System.Private.CoreLib/shared/System/Void.cs17
86 files changed, 4083 insertions, 93 deletions
diff --git a/src/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs b/src/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs
new file mode 100644
index 000000000..bc357125b
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs
@@ -0,0 +1,44 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+internal partial class Interop
+{
+ internal partial class BCrypt
+ {
+ internal static unsafe int BCryptGenRandom(byte* pbBuffer, int count)
+ {
+ Debug.Assert(pbBuffer != null);
+ Debug.Assert(count >= 0);
+
+ return BCryptGenRandom(IntPtr.Zero, pbBuffer, count, BCRYPT_USE_SYSTEM_PREFERRED_RNG);
+ }
+
+ private const int BCRYPT_USE_SYSTEM_PREFERRED_RNG = 0x00000002;
+ internal const int STATUS_SUCCESS = 0x0;
+ internal const int STATUS_NO_MEMORY = unchecked((int)0xC0000017);
+
+ [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)]
+ private static unsafe extern int BCryptGenRandom(IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags);
+ }
+
+ internal static unsafe void GetRandomBytes(byte* buffer, int length)
+ {
+ int status = BCrypt.BCryptGenRandom(buffer, length);
+ if (status != BCrypt.STATUS_SUCCESS)
+ {
+ if (status == BCrypt.STATUS_NO_MEMORY)
+ {
+ throw new OutOfMemoryException();
+ }
+ else
+ {
+ throw new InvalidOperationException();
+ }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/Interop/Windows/Interop.Libraries.cs b/src/System.Private.CoreLib/shared/Interop/Windows/Interop.Libraries.cs
index a5b125d6f..58bb12d63 100644
--- a/src/System.Private.CoreLib/shared/Interop/Windows/Interop.Libraries.cs
+++ b/src/System.Private.CoreLib/shared/Interop/Windows/Interop.Libraries.cs
@@ -6,6 +6,7 @@ internal static partial class Interop
{
internal static partial class Libraries
{
+ internal const string BCrypt = "BCrypt.dll";
internal const string Crypt32 = "crypt32.dll";
internal const string Kernel32 = "kernel32.dll";
internal const string NtDll = "ntdll.dll";
diff --git a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
new file mode 100644
index 000000000..2ca7c35bd
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
+ <HasSharedItems>true</HasSharedItems>
+ <SharedGUID>c5ed3c1d-b572-46f1-8f96-522a85ce1179</SharedGUID>
+ </PropertyGroup>
+ <PropertyGroup Label="Configuration">
+ <Import_RootNamespace/>
+ </PropertyGroup>
+ <PropertyGroup>
+ <TargetsWindows Condition="'$(TargetsWindows)' != 'true'">false</TargetsWindows>
+ <TargetsUnix Condition="'$(TargetsUnix)' != 'true'">false</TargetsUnix>
+ <TargetsOSX Condition="'$(TargetsOSX)' != 'true'">false</TargetsOSX>
+ </PropertyGroup>
+ <ItemGroup Condition="$(TargetsWindows)">
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Interop.BOOL.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Interop.Errors.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Interop.Libraries.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\BCrypt\Interop.BCryptGenRandom.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.CancelIoEx.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.CloseHandle.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.CreateFile.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.FileTypes.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.FlushFileBuffers.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.FormatMessage.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetFileInformationByHandleEx.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetFileType_SafeHandle.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetFullPathNameW.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetLongPathNameW.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetTempFileNameW.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetTempPathW.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.LockFile.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_IntPtr.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_NativeOverlapped.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SecurityOptions.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SECURITY_ATTRIBUTES.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SetEndOfFile.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SetErrorMode.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.FILE_INFO_BY_HANDLE_CLASS.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SetFilePointerEx.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.WriteFile_SafeHandle_IntPtr.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.WriteFile_SafeHandle_NativeOverlapped.cs"/>
+ </ItemGroup>
+ <ItemGroup Condition="$(TargetsUnix)">
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\Interop.Errors.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\Interop.IOErrors.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\Interop.Libraries.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.Close.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.FLock.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.FSync.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.FTruncate.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.GetCwd.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.LockFileRegion.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.LSeek.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.MksTemps.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.Open.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.OpenFlags.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.PathConf.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.Permissions.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.PosixFAdvise.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.Read.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.Stat.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.Unlink.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.Write.cs"/>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Action.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ApplicationException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ArgumentNullException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ArithmeticException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ArrayTypeMismatchException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\AsyncCallback.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\AttributeTargets.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\AttributeUsageAttribute.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Buffers\ArrayPool.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Buffers\ConfigurableArrayPool.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Buffers\TlsOverPerCoreLockedStacksArrayPool.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Buffers\Utilities.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\CharEnumerator.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\CLSCompliantAttribute.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Collections\IStructuralComparable.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Collections\IStructuralEquatable.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ComponentModel\EditorBrowsableAttribute.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\DataMisalignedException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\DateTimeKind.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\DayOfWeek.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\DivideByZeroException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\DuplicateWaitObjectException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\EntryPointNotFoundException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\EventArgs.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\EventHandler.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ExecutionEngineException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\FieldAccessException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\FlagsAttribute.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\FormatException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\FormattableString.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IAsyncResult.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IComparable.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IConvertible.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ICustomFormatter.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IDisposable.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IEquatable.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IFormatProvider.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IFormattable.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IndexOutOfRangeException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\InsufficientExecutionStackException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\InvalidCastException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\InvalidOperationException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\InvalidProgramException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\InvalidTimeZoneException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\Error.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\Path.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\PathInternal.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IObservable.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IObserver.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IProgress.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\MarshalByRefObject.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\MemberAccessException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\MethodAccessException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\MidpointRounding.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\MulticastNotSupportedException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\NotFiniteNumberException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\NotImplementedException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\NotSupportedException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\NullReferenceException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ObjectDisposedException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ObsoleteAttribute.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\OverflowException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ParamArrayAttribute.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\PlatformNotSupportedException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\RankException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ExtensionAttribute.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\FormattableStringFactory.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\IsVolatile.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ITuple.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\TupleElementNamesAttribute.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\StringBuffer.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Security\CryptographicException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\StackOverflowException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\StringSplitOptions.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\SystemException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Text\Normalization.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ThreadAttributes.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Threading\DeferredDisposableLifetime.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Threading\Timeout.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ThreadStaticAttribute.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\TimeoutException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\TimeZoneNotFoundException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\TupleExtensions.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\TypeAccessException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\TypeCode.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\TypeInitializationException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\UnauthorizedAccessException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\UnhandledExceptionEventArgs.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\UnhandledExceptionEventHandler.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Void.cs"/>
+ </ItemGroup>
+ <ItemGroup Condition="$(TargetsWindows)">
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Win32.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStreamCompletionSource.Win32.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\Path.Windows.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\PathHelper.Windows.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\PathInternal.Windows.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\PathInternal.Windows.StringBuffer.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\Win32Marshal.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Microsoft\Win32\SafeHandles\SafeFileHandle.Windows.cs"/>
+ </ItemGroup>
+ <ItemGroup Condition="$(TargetsUnix)">
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Unix.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\Path.Unix.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\PathInternal.Unix.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs"/>
+ </ItemGroup>
+ <ItemGroup Condition="$(TargetsUnix) and $(TargetsOSX)">
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.OSX.cs"/>
+ </ItemGroup>
+ <ItemGroup Condition="$(TargetsUnix) and !$(TargetsOSX)">
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Linux.cs"/>
+ </ItemGroup>
+</Project>
diff --git a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.shproj b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.shproj
new file mode 100644
index 000000000..af61b3b59
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.shproj
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>c5ed3c1d-b572-46f1-8f96-522a85ce1179</ProjectGuid>
+ <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
+ </PropertyGroup>
+ <!-- Set the properties to prevent any items from being excluded from the IDE view -->
+ <PropertyGroup>
+ <TargetsWindows>true</TargetsWindows>
+ <TargetsUnix>true</TargetsUnix>
+ <TargetsOSX>true</TargetsOSX>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
+ <PropertyGroup />
+ <Import Project="System.Private.CoreLib.Shared.projitems" Label="Shared" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
+</Project>
diff --git a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.sources b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.sources
deleted file mode 100644
index 884e77a40..000000000
--- a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.sources
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <TargetsWindows Condition="'$(TargetsWindows)' != 'true'">false</TargetsWindows>
- <TargetsUnix Condition="'$(TargetsUnix)' != 'true'">false</TargetsUnix>
- <TargetsOSX Condition="'$(TargetsOSX)' != 'true'">false</TargetsOSX>
- </PropertyGroup>
- <ItemGroup Condition="$(TargetsWindows)">
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Interop.BOOL.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Interop.Errors.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Interop.Libraries.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.CancelIoEx.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.CloseHandle.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.CreateFile.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.FileTypes.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.FlushFileBuffers.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.FormatMessage.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.GetFileInformationByHandleEx.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.GetFileType_SafeHandle.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.GetFullPathNameW.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.GetLongPathNameW.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.GetTempFileNameW.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.GetTempPathW.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.LockFile.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_IntPtr.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_NativeOverlapped.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.SecurityOptions.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.SECURITY_ATTRIBUTES.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.SetEndOfFile.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.SetErrorMode.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.FILE_INFO_BY_HANDLE_CLASS.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.SetFilePointerEx.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.WriteFile_SafeHandle_IntPtr.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Windows\Kernel32\Interop.WriteFile_SafeHandle_NativeOverlapped.cs"/>
- </ItemGroup>
- <ItemGroup Condition="$(TargetsUnix)">
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\Interop.Errors.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\Interop.IOErrors.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\Interop.Libraries.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.Close.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.FLock.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.FSync.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.FTruncate.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.GetCwd.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.LockFileRegion.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.LSeek.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.MksTemps.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.Open.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.OpenFlags.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.PathConf.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.Permissions.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.PosixFAdvise.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.Read.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.Stat.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.Unlink.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Interop\Unix\System.Native\Interop.Write.cs"/>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="$(MSBuildThisFileDirectory)\System\Buffers\ArrayPool.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\Buffers\ConfigurableArrayPool.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\Buffers\TlsOverPerCoreLockedStacksArrayPool.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\Buffers\Utilities.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\Error.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\FileStream.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\Path.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\PathInternal.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\Runtime\InteropServices\StringBuffer.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\Security\CryptographicException.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\Threading\DeferredDisposableLifetime.cs"/>
- </ItemGroup>
- <ItemGroup Condition="$(TargetsWindows)">
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\FileStream.Win32.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\FileStreamCompletionSource.Win32.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\Path.Windows.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\PathHelper.Windows.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\PathInternal.Windows.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\PathInternal.Windows.StringBuffer.cs" Condition="'$(IsProjectNLibrary)' != 'true'"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\Win32Marshal.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Microsoft\Win32\SafeHandles\SafeFileHandle.Windows.cs"/>
- </ItemGroup>
- <ItemGroup Condition="$(TargetsUnix)">
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\FileStream.Unix.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\Path.Unix.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\PathInternal.Unix.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs"/>
- </ItemGroup>
- <ItemGroup Condition="$(TargetsUnix) and $(TargetsOSX)">
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\FileStream.OSX.cs"/>
- </ItemGroup>
- <ItemGroup Condition="$(TargetsUnix) and !$(TargetsOSX)">
- <Compile Include="$(MSBuildThisFileDirectory)\System\IO\FileStream.Linux.cs"/>
- </ItemGroup>
-</Project>
diff --git a/src/System.Private.CoreLib/shared/System/Action.cs b/src/System.Private.CoreLib/shared/System/Action.cs
new file mode 100644
index 000000000..b82c14d9d
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Action.cs
@@ -0,0 +1,35 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ public delegate void Action<in T>(T obj);
+
+ public delegate void Action();
+ public delegate void Action<in T1, in T2>(T1 arg1, T2 arg2);
+ public delegate void Action<in T1, in T2, in T3>(T1 arg1, T2 arg2, T3 arg3);
+ public delegate void Action<in T1, in T2, in T3, in T4>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);
+
+ public delegate TResult Func<out TResult>();
+ public delegate TResult Func<in T, out TResult>(T arg);
+ public delegate TResult Func<in T1, in T2, out TResult>(T1 arg1, T2 arg2);
+ public delegate TResult Func<in T1, in T2, in T3, out TResult>(T1 arg1, T2 arg2, T3 arg3);
+ public delegate TResult Func<in T1, in T2, in T3, in T4, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);
+
+ public delegate void Action<in T1, in T2, in T3, in T4, in T5>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
+ public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
+ public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
+ public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
+
+ public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
+ public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
+ public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
+ public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
+
+ public delegate int Comparison<in T>(T x, T y);
+
+ public delegate TOutput Converter<in TInput, out TOutput>(TInput input);
+
+ public delegate bool Predicate<in T>(T obj);
+}
diff --git a/src/System.Private.CoreLib/shared/System/ApplicationException.cs b/src/System.Private.CoreLib/shared/System/ApplicationException.cs
new file mode 100644
index 000000000..900feb57f
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/ApplicationException.cs
@@ -0,0 +1,56 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: The base class for all "less serious" exceptions that must be
+** declared or caught.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ // The ApplicationException is the base class for nonfatal,
+ // application errors that occur. These exceptions are generated
+ // (i.e., thrown) by an application, not the Runtime. Applications that need
+ // to create their own exceptions do so by extending this class.
+ // ApplicationException extends but adds no new functionality to
+ // RecoverableException.
+ //
+ [Serializable]
+ public class ApplicationException : Exception
+ {
+ // Creates a new ApplicationException with its message string set to
+ // the empty string, its HRESULT set to COR_E_APPLICATION,
+ // and its ExceptionInfo reference set to null.
+ public ApplicationException()
+ : base(SR.Arg_ApplicationException)
+ {
+ HResult = __HResults.COR_E_APPLICATION;
+ }
+
+ // Creates a new ApplicationException with its message string set to
+ // message, its HRESULT set to COR_E_APPLICATION,
+ // and its ExceptionInfo reference set to null.
+ //
+ public ApplicationException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_APPLICATION;
+ }
+
+ public ApplicationException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_APPLICATION;
+ }
+
+ protected ApplicationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/ArgumentNullException.cs b/src/System.Private.CoreLib/shared/System/ArgumentNullException.cs
new file mode 100644
index 000000000..3a86223cc
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/ArgumentNullException.cs
@@ -0,0 +1,53 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: Exception class for null arguments to a method.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ // The ArgumentException is thrown when an argument
+ // is null when it shouldn't be.
+ //
+ [Serializable]
+ public class ArgumentNullException : ArgumentException
+ {
+ // Creates a new ArgumentNullException with its message
+ // string set to a default message explaining an argument was null.
+ public ArgumentNullException()
+ : base(SR.ArgumentNull_Generic)
+ {
+ // Use E_POINTER - COM used that for null pointers. Description is "invalid pointer"
+ HResult = __HResults.E_POINTER;
+ }
+
+ public ArgumentNullException(String paramName)
+ : base(SR.ArgumentNull_Generic, paramName)
+ {
+ HResult = __HResults.E_POINTER;
+ }
+
+ public ArgumentNullException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.E_POINTER;
+ }
+
+ public ArgumentNullException(String paramName, String message)
+ : base(message, paramName)
+ {
+ HResult = __HResults.E_POINTER;
+ }
+
+ protected ArgumentNullException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/ArithmeticException.cs b/src/System.Private.CoreLib/shared/System/ArithmeticException.cs
new file mode 100644
index 000000000..081ba454f
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/ArithmeticException.cs
@@ -0,0 +1,51 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: Exception class for bad arithmetic conditions!
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ // The ArithmeticException is thrown when overflow or underflow
+ // occurs.
+ //
+ [Serializable]
+ public class ArithmeticException : SystemException
+ {
+ // Creates a new ArithmeticException with its message string set to
+ // the empty string, its HRESULT set to COR_E_ARITHMETIC,
+ // and its ExceptionInfo reference set to null.
+ public ArithmeticException()
+ : base(SR.Arg_ArithmeticException)
+ {
+ HResult = __HResults.COR_E_ARITHMETIC;
+ }
+
+ // Creates a new ArithmeticException with its message string set to
+ // message, its HRESULT set to COR_E_ARITHMETIC,
+ // and its ExceptionInfo reference set to null.
+ //
+ public ArithmeticException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_ARITHMETIC;
+ }
+
+ public ArithmeticException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_ARITHMETIC;
+ }
+
+ protected ArithmeticException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/ArrayTypeMismatchException.cs b/src/System.Private.CoreLib/shared/System/ArrayTypeMismatchException.cs
new file mode 100644
index 000000000..3e941fdf8
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/ArrayTypeMismatchException.cs
@@ -0,0 +1,51 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: The arrays are of different primitive types.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ // The ArrayMismatchException is thrown when an attempt to store
+ // an object of the wrong type within an array occurs.
+ //
+ [Serializable]
+ public class ArrayTypeMismatchException : SystemException
+ {
+ // Creates a new ArrayMismatchException with its message string set to
+ // the empty string, its HRESULT set to COR_E_ARRAYTYPEMISMATCH,
+ // and its ExceptionInfo reference set to null.
+ public ArrayTypeMismatchException()
+ : base(SR.Arg_ArrayTypeMismatchException)
+ {
+ HResult = __HResults.COR_E_ARRAYTYPEMISMATCH;
+ }
+
+ // Creates a new ArrayMismatchException with its message string set to
+ // message, its HRESULT set to COR_E_ARRAYTYPEMISMATCH,
+ // and its ExceptionInfo reference set to null.
+ //
+ public ArrayTypeMismatchException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_ARRAYTYPEMISMATCH;
+ }
+
+ public ArrayTypeMismatchException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_ARRAYTYPEMISMATCH;
+ }
+
+ protected ArrayTypeMismatchException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/AsyncCallback.cs b/src/System.Private.CoreLib/shared/System/AsyncCallback.cs
new file mode 100644
index 000000000..5c49535cf
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/AsyncCallback.cs
@@ -0,0 +1,17 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Interface: AsyncCallbackDelegate
+**
+** Purpose: Type of callback for async operations
+**
+===========================================================*/
+
+namespace System
+{
+ [Serializable]
+ public delegate void AsyncCallback(IAsyncResult ar);
+}
diff --git a/src/System.Private.CoreLib/shared/System/AttributeTargets.cs b/src/System.Private.CoreLib/shared/System/AttributeTargets.cs
new file mode 100644
index 000000000..fdfa4ab73
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/AttributeTargets.cs
@@ -0,0 +1,36 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+namespace System
+{
+ // Enum used to indicate all the elements of the
+ // VOS it is valid to attach this element to.
+ [Flags]
+ [Serializable]
+ public enum AttributeTargets
+ {
+ Assembly = 0x0001,
+ Module = 0x0002,
+ Class = 0x0004,
+ Struct = 0x0008,
+ Enum = 0x0010,
+ Constructor = 0x0020,
+ Method = 0x0040,
+ Property = 0x0080,
+ Field = 0x0100,
+ Event = 0x0200,
+ Interface = 0x0400,
+ Parameter = 0x0800,
+ Delegate = 0x1000,
+ ReturnValue = 0x2000,
+ GenericParameter = 0x4000,
+
+ All = Assembly | Module | Class | Struct | Enum | Constructor |
+ Method | Property | Field | Event | Interface | Parameter |
+ Delegate | ReturnValue | GenericParameter
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/AttributeUsageAttribute.cs b/src/System.Private.CoreLib/shared/System/AttributeUsageAttribute.cs
new file mode 100644
index 000000000..22cc54864
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/AttributeUsageAttribute.cs
@@ -0,0 +1,60 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Purpose: The class denotes how to specify the usage of an attribute
+**
+**
+===========================================================*/
+
+using System.Reflection;
+
+namespace System
+{
+ /* By default, attributes are inherited and multiple attributes are not allowed */
+ [Serializable]
+ [AttributeUsage(AttributeTargets.Class, Inherited = true)]
+ public sealed class AttributeUsageAttribute : Attribute
+ {
+ internal AttributeTargets m_attributeTarget = AttributeTargets.All; // Defaults to all
+ internal bool m_allowMultiple = false; // Defaults to false
+ internal bool m_inherited = true; // Defaults to true
+
+ internal static AttributeUsageAttribute Default = new AttributeUsageAttribute(AttributeTargets.All);
+
+ //Constructors
+ public AttributeUsageAttribute(AttributeTargets validOn)
+ {
+ m_attributeTarget = validOn;
+ }
+ internal AttributeUsageAttribute(AttributeTargets validOn, bool allowMultiple, bool inherited)
+ {
+ m_attributeTarget = validOn;
+ m_allowMultiple = allowMultiple;
+ m_inherited = inherited;
+ }
+
+
+ //Properties
+ public AttributeTargets ValidOn
+ {
+ get { return m_attributeTarget; }
+ }
+
+ public bool AllowMultiple
+ {
+ get { return m_allowMultiple; }
+ set { m_allowMultiple = value; }
+ }
+
+ public bool Inherited
+ {
+ get { return m_inherited; }
+ set { m_inherited = value; }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/CLSCompliantAttribute.cs b/src/System.Private.CoreLib/shared/System/CLSCompliantAttribute.cs
new file mode 100644
index 000000000..e03600d13
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/CLSCompliantAttribute.cs
@@ -0,0 +1,34 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: Container for assemblies.
+**
+**
+=============================================================================*/
+
+namespace System
+{
+ [Serializable]
+ [AttributeUsage(AttributeTargets.All, Inherited = true, AllowMultiple = false)]
+ public sealed class CLSCompliantAttribute : Attribute
+ {
+ private bool _compliant;
+
+ public CLSCompliantAttribute(bool isCompliant)
+ {
+ _compliant = isCompliant;
+ }
+ public bool IsCompliant
+ {
+ get
+ {
+ return _compliant;
+ }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/CharEnumerator.cs b/src/System.Private.CoreLib/shared/System/CharEnumerator.cs
new file mode 100644
index 000000000..689ed7e48
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/CharEnumerator.cs
@@ -0,0 +1,81 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Purpose: Enumerates the characters on a string. skips range
+** checks.
+**
+**
+============================================================*/
+
+using System.Collections;
+using System.Collections.Generic;
+
+namespace System
+{
+ public sealed class CharEnumerator : IEnumerator, IEnumerator<char>, IDisposable, ICloneable
+ {
+ private String _str;
+ private int _index;
+ private char _currentElement;
+
+ internal CharEnumerator(String str)
+ {
+ _str = str;
+ _index = -1;
+ }
+
+ public object Clone()
+ {
+ return MemberwiseClone();
+ }
+
+ public bool MoveNext()
+ {
+ if (_index < (_str.Length - 1))
+ {
+ _index++;
+ _currentElement = _str[_index];
+ return true;
+ }
+ else
+ _index = _str.Length;
+ return false;
+ }
+
+ public void Dispose()
+ {
+ if (_str != null)
+ _index = _str.Length;
+ _str = null;
+ }
+
+ /// <internalonly/>
+ Object IEnumerator.Current
+ {
+ get { return Current; }
+ }
+
+ public char Current
+ {
+ get
+ {
+ if (_index == -1)
+ throw new InvalidOperationException(SR.InvalidOperation_EnumNotStarted);
+ if (_index >= _str.Length)
+ throw new InvalidOperationException(SR.InvalidOperation_EnumEnded);
+ return _currentElement;
+ }
+ }
+
+ public void Reset()
+ {
+ _currentElement = (char)0;
+ _index = -1;
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Collections/IStructuralComparable.cs b/src/System.Private.CoreLib/shared/System/Collections/IStructuralComparable.cs
new file mode 100644
index 000000000..a5e4834b9
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Collections/IStructuralComparable.cs
@@ -0,0 +1,13 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+
+namespace System.Collections
+{
+ public interface IStructuralComparable
+ {
+ Int32 CompareTo(Object other, IComparer comparer);
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Collections/IStructuralEquatable.cs b/src/System.Private.CoreLib/shared/System/Collections/IStructuralEquatable.cs
new file mode 100644
index 000000000..4e61d5e75
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Collections/IStructuralEquatable.cs
@@ -0,0 +1,12 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Collections
+{
+ public interface IStructuralEquatable
+ {
+ Boolean Equals(Object other, IEqualityComparer comparer);
+ int GetHashCode(IEqualityComparer comparer);
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/ComponentModel/EditorBrowsableAttribute.cs b/src/System.Private.CoreLib/shared/System/ComponentModel/EditorBrowsableAttribute.cs
new file mode 100644
index 000000000..9b4d6e626
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/ComponentModel/EditorBrowsableAttribute.cs
@@ -0,0 +1,48 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.ComponentModel
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Delegate | AttributeTargets.Interface)]
+ public sealed class EditorBrowsableAttribute : Attribute
+ {
+ private EditorBrowsableState browsableState;
+
+ public EditorBrowsableAttribute(EditorBrowsableState state)
+ {
+ browsableState = state;
+ }
+
+ public EditorBrowsableAttribute() : this(EditorBrowsableState.Always) { }
+
+ public EditorBrowsableState State
+ {
+ get { return browsableState; }
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+
+ EditorBrowsableAttribute other = obj as EditorBrowsableAttribute;
+
+ return (other != null) && other.browsableState == browsableState;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+ }
+
+ public enum EditorBrowsableState
+ {
+ Always,
+ Never,
+ Advanced
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/DataMisalignedException.cs b/src/System.Private.CoreLib/shared/System/DataMisalignedException.cs
new file mode 100644
index 000000000..b1991a048
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/DataMisalignedException.cs
@@ -0,0 +1,39 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+** Purpose: The exception class for a misaligned access exception
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public sealed class DataMisalignedException : SystemException
+ {
+ public DataMisalignedException()
+ : base(SR.Arg_DataMisalignedException)
+ {
+ HResult = __HResults.COR_E_DATAMISALIGNED;
+ }
+
+ public DataMisalignedException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_DATAMISALIGNED;
+ }
+
+ public DataMisalignedException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_DATAMISALIGNED;
+ }
+
+ internal DataMisalignedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/DateTimeKind.cs b/src/System.Private.CoreLib/shared/System/DateTimeKind.cs
new file mode 100644
index 000000000..6b5e690df
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/DateTimeKind.cs
@@ -0,0 +1,17 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ // This enum is used to indentify DateTime instances in cases when they are known to be in local time,
+ // UTC time or if this information has not been specified or is not applicable.
+
+ [Serializable]
+ public enum DateTimeKind
+ {
+ Unspecified = 0,
+ Utc = 1,
+ Local = 2,
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/DayOfWeek.cs b/src/System.Private.CoreLib/shared/System/DayOfWeek.cs
new file mode 100644
index 000000000..5d8425715
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/DayOfWeek.cs
@@ -0,0 +1,27 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Purpose: Enum for the day of the week.
+**
+**
+============================================================*/
+
+namespace System
+{
+ [Serializable]
+ public enum DayOfWeek
+ {
+ Sunday = 0,
+ Monday = 1,
+ Tuesday = 2,
+ Wednesday = 3,
+ Thursday = 4,
+ Friday = 5,
+ Saturday = 6,
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/DivideByZeroException.cs b/src/System.Private.CoreLib/shared/System/DivideByZeroException.cs
new file mode 100644
index 000000000..4abd43ada
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/DivideByZeroException.cs
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: Exception class for bad arithmetic conditions!
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class DivideByZeroException : ArithmeticException
+ {
+ public DivideByZeroException()
+ : base(SR.Arg_DivideByZero)
+ {
+ HResult = __HResults.COR_E_DIVIDEBYZERO;
+ }
+
+ public DivideByZeroException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_DIVIDEBYZERO;
+ }
+
+ public DivideByZeroException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_DIVIDEBYZERO;
+ }
+
+ protected DivideByZeroException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/DuplicateWaitObjectException.cs b/src/System.Private.CoreLib/shared/System/DuplicateWaitObjectException.cs
new file mode 100644
index 000000000..da29e2ad7
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/DuplicateWaitObjectException.cs
@@ -0,0 +1,65 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: Exception class for duplicate objects in WaitAll/WaitAny.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ // The DuplicateWaitObjectException is thrown when an object
+ // appears more than once in the list of objects to WaitAll or WaitAny.
+ //
+ [Serializable]
+ public class DuplicateWaitObjectException : ArgumentException
+ {
+ private static volatile String s_duplicateWaitObjectMessage = null;
+
+ private static String DuplicateWaitObjectMessage
+ {
+ get
+ {
+ if (s_duplicateWaitObjectMessage == null)
+ s_duplicateWaitObjectMessage = SR.Arg_DuplicateWaitObjectException;
+ return s_duplicateWaitObjectMessage;
+ }
+ }
+
+ // Creates a new DuplicateWaitObjectException with its message
+ // string set to a default message.
+ public DuplicateWaitObjectException()
+ : base(DuplicateWaitObjectMessage)
+ {
+ HResult = __HResults.COR_E_DUPLICATEWAITOBJECT;
+ }
+
+ public DuplicateWaitObjectException(String parameterName)
+ : base(DuplicateWaitObjectMessage, parameterName)
+ {
+ HResult = __HResults.COR_E_DUPLICATEWAITOBJECT;
+ }
+
+ public DuplicateWaitObjectException(String parameterName, String message)
+ : base(message, parameterName)
+ {
+ HResult = __HResults.COR_E_DUPLICATEWAITOBJECT;
+ }
+
+ public DuplicateWaitObjectException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_DUPLICATEWAITOBJECT;
+ }
+
+ // This constructor is required for serialization
+ protected DuplicateWaitObjectException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/EntryPointNotFoundException.cs b/src/System.Private.CoreLib/shared/System/EntryPointNotFoundException.cs
new file mode 100644
index 000000000..835d33413
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/EntryPointNotFoundException.cs
@@ -0,0 +1,42 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: The exception class for some failed P/Invoke calls.
+**
+**
+=============================================================================*/
+
+using System;
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class EntryPointNotFoundException : TypeLoadException
+ {
+ public EntryPointNotFoundException()
+ : base(SR.Arg_EntryPointNotFoundException)
+ {
+ HResult = __HResults.COR_E_ENTRYPOINTNOTFOUND;
+ }
+
+ public EntryPointNotFoundException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_ENTRYPOINTNOTFOUND;
+ }
+
+ public EntryPointNotFoundException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_ENTRYPOINTNOTFOUND;
+ }
+
+ protected EntryPointNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/EventArgs.cs b/src/System.Private.CoreLib/shared/System/EventArgs.cs
new file mode 100644
index 000000000..c0356613d
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/EventArgs.cs
@@ -0,0 +1,19 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+
+namespace System
+{
+ // The base class for all event classes.
+ [Serializable]
+ public class EventArgs
+ {
+ public static readonly EventArgs Empty = new EventArgs();
+
+ public EventArgs()
+ {
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/EventHandler.cs b/src/System.Private.CoreLib/shared/System/EventHandler.cs
new file mode 100644
index 000000000..e6923cf63
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/EventHandler.cs
@@ -0,0 +1,14 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+
+namespace System
+{
+ [Serializable]
+ public delegate void EventHandler(Object sender, EventArgs e);
+
+ [Serializable]
+ public delegate void EventHandler<TEventArgs>(Object sender, TEventArgs e); // Removed TEventArgs constraint post-.NET 4
+}
diff --git a/src/System.Private.CoreLib/shared/System/ExecutionEngineException.cs b/src/System.Private.CoreLib/shared/System/ExecutionEngineException.cs
new file mode 100644
index 000000000..bebfd493a
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/ExecutionEngineException.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+//
+//
+/*=============================================================================
+**
+**
+**
+** Purpose: The exception class for misc execution engine exceptions.
+** Currently, its only used as a placeholder type when the EE
+** does a FailFast.
+**
+**
+=============================================================================*/
+
+using System;
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Obsolete("This type previously indicated an unspecified fatal error in the runtime. The runtime no longer raises this exception so this type is obsolete.")]
+ [Serializable]
+ public sealed class ExecutionEngineException : SystemException
+ {
+ public ExecutionEngineException()
+ : base(SR.Arg_ExecutionEngineException)
+ {
+ HResult = __HResults.COR_E_EXECUTIONENGINE;
+ }
+
+ public ExecutionEngineException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_EXECUTIONENGINE;
+ }
+
+ public ExecutionEngineException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_EXECUTIONENGINE;
+ }
+
+ internal ExecutionEngineException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/FieldAccessException.cs b/src/System.Private.CoreLib/shared/System/FieldAccessException.cs
new file mode 100644
index 000000000..ac62c0fca
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/FieldAccessException.cs
@@ -0,0 +1,39 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+** Purpose: The exception class for class loading failures.
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class FieldAccessException : MemberAccessException
+ {
+ public FieldAccessException()
+ : base(SR.Arg_FieldAccessException)
+ {
+ HResult = __HResults.COR_E_FIELDACCESS;
+ }
+
+ public FieldAccessException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_FIELDACCESS;
+ }
+
+ public FieldAccessException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_FIELDACCESS;
+ }
+
+ protected FieldAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/FlagsAttribute.cs b/src/System.Private.CoreLib/shared/System/FlagsAttribute.cs
new file mode 100644
index 000000000..5f8c108ae
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/FlagsAttribute.cs
@@ -0,0 +1,22 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+namespace System
+{
+ // Custom attribute to indicate that the enum
+ // should be treated as a bitfield (or set of flags).
+ // An IDE may use this information to provide a richer
+ // development experience.
+ [Serializable]
+ [AttributeUsage(AttributeTargets.Enum, Inherited = false)]
+ public class FlagsAttribute : Attribute
+ {
+ public FlagsAttribute()
+ {
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/FormatException.cs b/src/System.Private.CoreLib/shared/System/FormatException.cs
new file mode 100644
index 000000000..c5758e11c
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/FormatException.cs
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Purpose: Exception to designate an illegal argument to FormatMessage.
+**
+**
+===========================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class FormatException : SystemException
+ {
+ public FormatException()
+ : base(SR.Arg_FormatException)
+ {
+ HResult = __HResults.COR_E_FORMAT;
+ }
+
+ public FormatException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_FORMAT;
+ }
+
+ public FormatException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_FORMAT;
+ }
+
+ protected FormatException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/FormattableString.cs b/src/System.Private.CoreLib/shared/System/FormattableString.cs
new file mode 100644
index 000000000..6369363b5
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/FormattableString.cs
@@ -0,0 +1,81 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Purpose: implementation of the FormattableString
+** class.
+**
+===========================================================*/
+
+namespace System
+{
+ /// <summary>
+ /// A composite format string along with the arguments to be formatted. An instance of this
+ /// type may result from the use of the C# or VB language primitive "interpolated string".
+ /// </summary>
+ public abstract class FormattableString : IFormattable
+ {
+ /// <summary>
+ /// The composite format string.
+ /// </summary>
+ public abstract string Format { get; }
+
+ /// <summary>
+ /// Returns an object array that contains zero or more objects to format. Clients should not
+ /// mutate the contents of the array.
+ /// </summary>
+ public abstract object[] GetArguments();
+
+ /// <summary>
+ /// The number of arguments to be formatted.
+ /// </summary>
+ public abstract int ArgumentCount { get; }
+
+ /// <summary>
+ /// Returns one argument to be formatted from argument position <paramref name="index"/>.
+ /// </summary>
+ public abstract object GetArgument(int index);
+
+ /// <summary>
+ /// Format to a string using the given culture.
+ /// </summary>
+ public abstract string ToString(IFormatProvider formatProvider);
+
+ string IFormattable.ToString(string ignored, IFormatProvider formatProvider)
+ {
+ return ToString(formatProvider);
+ }
+
+ /// <summary>
+ /// Format the given object in the invariant culture. This static method may be
+ /// imported in C# by
+ /// <code>
+ /// using static System.FormattableString;
+ /// </code>.
+ /// Within the scope
+ /// of that import directive an interpolated string may be formatted in the
+ /// invariant culture by writing, for example,
+ /// <code>
+ /// Invariant($"{{ lat = {latitude}; lon = {longitude} }}")
+ /// </code>
+ /// </summary>
+ public static string Invariant(FormattableString formattable)
+ {
+ if (formattable == null)
+ {
+ throw new ArgumentNullException(nameof(formattable));
+ }
+
+ return formattable.ToString(Globalization.CultureInfo.InvariantCulture);
+ }
+
+ public override string ToString()
+ {
+ return ToString(Globalization.CultureInfo.CurrentCulture);
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/IAsyncResult.cs b/src/System.Private.CoreLib/shared/System/IAsyncResult.cs
new file mode 100644
index 000000000..0abeaca52
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/IAsyncResult.cs
@@ -0,0 +1,30 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Interface: IAsyncResult
+**
+** Purpose: Interface to encapsulate the results of an async
+** operation
+**
+===========================================================*/
+
+using System;
+using System.Threading;
+
+namespace System
+{
+ public interface IAsyncResult
+ {
+ bool IsCompleted { get; }
+
+ WaitHandle AsyncWaitHandle { get; }
+
+
+ Object AsyncState { get; }
+
+ bool CompletedSynchronously { get; }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/IComparable.cs b/src/System.Private.CoreLib/shared/System/IComparable.cs
new file mode 100644
index 000000000..72aeeb027
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/IComparable.cs
@@ -0,0 +1,37 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ // The IComparable interface is implemented by classes that support an
+ // ordering of instances of the class. The ordering represented by
+ // IComparable can be used to sort arrays and collections of objects
+ // that implement the interface.
+ //
+ public interface IComparable
+ {
+ // Interface does not need to be marked with the serializable attribute
+ // Compares this object to another object, returning an integer that
+ // indicates the relationship. An implementation of this method must return
+ // a value less than zero if this is less than object, zero
+ // if this is equal to object, or a value greater than zero
+ // if this is greater than object.
+ //
+ int CompareTo(Object obj);
+ }
+
+ // Generic version of IComparable.
+
+ public interface IComparable<in T>
+ {
+ // Interface does not need to be marked with the serializable attribute
+ // Compares this object to another object, returning an integer that
+ // indicates the relationship. An implementation of this method must return
+ // a value less than zero if this is less than object, zero
+ // if this is equal to object, or a value greater than zero
+ // if this is greater than object.
+ //
+ int CompareTo(T other);
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/IConvertible.cs b/src/System.Private.CoreLib/shared/System/IConvertible.cs
new file mode 100644
index 000000000..87351127f
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/IConvertible.cs
@@ -0,0 +1,63 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ // The IConvertible interface represents an object that contains a value. This
+ // interface is implemented by the following types in the System namespace:
+ // Boolean, Char, SByte, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64,
+ // Single, Double, Decimal, DateTime, and String. The interface may
+ // be implemented by other types that are to be considered values. For example,
+ // a library of nullable database types could implement IConvertible.
+ //
+ // Note: The interface was originally proposed as IValue.
+ //
+ // The implementations of IConvertible provided by the System.XXX value classes
+ // simply forward to the appropriate Value.ToXXX(YYY) methods (a description of
+ // the Value class follows below). In cases where a Value.ToXXX(YYY) method
+ // does not exist (because the particular conversion is not supported), the
+ // IConvertible implementation should simply throw an InvalidCastException.
+
+ [CLSCompliant(false)]
+ public interface IConvertible
+ {
+ // Returns the type code of this object. An implementation of this method
+ // must not return TypeCode.Empty (which represents a null reference) or
+ // TypeCode.Object (which represents an object that doesn't implement the
+ // IConvertible interface). An implementation of this method should return
+ // TypeCode.DBNull if the value of this object is a database null. For
+ // example, a nullable integer type should return TypeCode.DBNull if the
+ // value of the object is the database null. Otherwise, an implementation
+ // of this method should return the TypeCode that best describes the
+ // internal representation of the object.
+
+ TypeCode GetTypeCode();
+
+ // The ToXXX methods convert the value of the underlying object to the
+ // given type. If a particular conversion is not supported, the
+ // implementation must throw an InvalidCastException. If the value of the
+ // underlying object is not within the range of the target type, the
+ // implementation must throw an OverflowException. The
+ // IFormatProvider will be used to get a NumberFormatInfo or similar
+ // appropriate service object, and may safely be null.
+
+ bool ToBoolean(IFormatProvider provider);
+ char ToChar(IFormatProvider provider);
+ sbyte ToSByte(IFormatProvider provider);
+ byte ToByte(IFormatProvider provider);
+ short ToInt16(IFormatProvider provider);
+ ushort ToUInt16(IFormatProvider provider);
+ int ToInt32(IFormatProvider provider);
+ uint ToUInt32(IFormatProvider provider);
+ long ToInt64(IFormatProvider provider);
+ ulong ToUInt64(IFormatProvider provider);
+ float ToSingle(IFormatProvider provider);
+ double ToDouble(IFormatProvider provider);
+ Decimal ToDecimal(IFormatProvider provider);
+ DateTime ToDateTime(IFormatProvider provider);
+ String ToString(IFormatProvider provider);
+ Object ToType(Type conversionType, IFormatProvider provider);
+ }
+}
+
diff --git a/src/System.Private.CoreLib/shared/System/ICustomFormatter.cs b/src/System.Private.CoreLib/shared/System/ICustomFormatter.cs
new file mode 100644
index 000000000..47340f309
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/ICustomFormatter.cs
@@ -0,0 +1,24 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Interface: ICustomFormatter
+**
+**
+** Purpose: Marks a class as providing special formatting
+**
+**
+===========================================================*/
+
+using System;
+
+namespace System
+{
+ public interface ICustomFormatter
+ {
+ // Interface does not need to be marked with the serializable attribute
+ String Format(String format, Object arg, IFormatProvider formatProvider);
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/IDisposable.cs b/src/System.Private.CoreLib/shared/System/IDisposable.cs
new file mode 100644
index 000000000..24f0740ed
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/IDisposable.cs
@@ -0,0 +1,60 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Interface: IDisposable
+**
+**
+** Purpose: Interface for assisting with deterministic finalization.
+**
+**
+===========================================================*/
+
+namespace System
+{
+ // IDisposable is an attempt at helping to solve problems with deterministic
+ // finalization. The GC of course doesn't leave any way to deterministically
+ // know when a finalizer will run. This forces classes that hold onto OS
+ // resources or some sort of important state (such as a FileStream or a
+ // network connection) to provide a Close or Dispose method so users can
+ // run clean up code deterministically. We have formalized this into an
+ // interface with one method. Classes may privately implement IDisposable and
+ // provide a Close method instead, if that name is by far the expected name
+ // for objects in that domain (ie, you don't Dispose of a FileStream, you Close
+ // it).
+ //
+ // This interface could be theoretically used as a marker by a compiler to
+ // ensure a disposable object has been cleaned up along all code paths if it's
+ // been allocated in that method, though in practice any compiler that
+ // draconian may tick off any number of people. Perhaps an external tool (like
+ // like Purify or BoundsChecker) could do this. Instead, C# has added a using
+ // clause, which will generate a try/finally statement where the resource
+ // passed into the using clause will always have it's Dispose method called.
+ // Syntax is using(FileStream fs = ...) { .. };
+ //
+ // Dispose should meet the following conditions:
+ // 1) Be safely callable multiple times
+ // 2) Release any resources associated with the instance
+ // 3) Call the base class's Dispose method, if necessary
+ // 4) Suppress finalization of this class to help the GC by reducing the
+ // number of objects on the finalization queue.
+ // 5) Dispose shouldn't generally throw exceptions, except for very serious
+ // errors that are particularly unexpected. (ie, OutOfMemoryException)
+ // Ideally, nothing should go wrong with your object by calling Dispose.
+ //
+ // If possible, a class should define a finalizer that calls Dispose.
+ // However, in many situations, this is impractical. For instance, take the
+ // classic example of a Stream and a StreamWriter (which has an internal
+ // buffer of data to write to the Stream). If both objects are collected
+ // before Close or Dispose has been called on either, then the GC may run the
+ // finalizer for the Stream first, before the StreamWriter. At that point, any
+ // data buffered by the StreamWriter cannot be written to the Stream. In this
+ // case, it doesn't make much sense to provide a finalizer on the StreamWriter
+ // since you cannot solve this problem correctly.
+ public interface IDisposable
+ {
+ void Dispose();
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/IEquatable.cs b/src/System.Private.CoreLib/shared/System/IEquatable.cs
new file mode 100644
index 000000000..1264fdd57
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/IEquatable.cs
@@ -0,0 +1,14 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+
+namespace System
+{
+ public interface IEquatable<T>
+ {
+ bool Equals(T other);
+ }
+}
+
diff --git a/src/System.Private.CoreLib/shared/System/IFormatProvider.cs b/src/System.Private.CoreLib/shared/System/IFormatProvider.cs
new file mode 100644
index 000000000..0c17354af
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/IFormatProvider.cs
@@ -0,0 +1,23 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Purpose: Notes a class which knows how to return formatting information
+**
+**
+============================================================*/
+
+using System;
+
+namespace System
+{
+ public interface IFormatProvider
+ {
+ // Interface does not need to be marked with the serializable attribute
+ Object GetFormat(Type formatType);
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/IFormattable.cs b/src/System.Private.CoreLib/shared/System/IFormattable.cs
new file mode 100644
index 000000000..28a7d7057
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/IFormattable.cs
@@ -0,0 +1,15 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Diagnostics.Contracts;
+
+namespace System
+{
+ public interface IFormattable
+ {
+ [Pure]
+ String ToString(String format, IFormatProvider formatProvider);
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs b/src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs
index 0442c4486..500c60aa8 100644
--- a/src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs
+++ b/src/System.Private.CoreLib/shared/System/IO/Path.Unix.cs
@@ -14,6 +14,8 @@ namespace System.IO
public static char[] GetInvalidPathChars() => new char[] { '\0' };
+ internal static int MaxPath => Interop.Sys.MaxPath;
+
// Expands the given path to a fully qualified path.
public static string GetFullPath(string path)
{
diff --git a/src/System.Private.CoreLib/shared/System/IObservable.cs b/src/System.Private.CoreLib/shared/System/IObservable.cs
new file mode 100644
index 000000000..aabb0b8fb
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/IObservable.cs
@@ -0,0 +1,11 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ public interface IObservable<out T>
+ {
+ IDisposable Subscribe(IObserver<T> observer);
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/IObserver.cs b/src/System.Private.CoreLib/shared/System/IObserver.cs
new file mode 100644
index 000000000..39e123de8
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/IObserver.cs
@@ -0,0 +1,13 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ public interface IObserver<in T>
+ {
+ void OnNext(T value);
+ void OnError(Exception error);
+ void OnCompleted();
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/IProgress.cs b/src/System.Private.CoreLib/shared/System/IProgress.cs
new file mode 100644
index 000000000..724c7bdce
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/IProgress.cs
@@ -0,0 +1,15 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ /// <summary>Defines a provider for progress updates.</summary>
+ /// <typeparam name="T">The type of progress update value.</typeparam>
+ public interface IProgress<in T>
+ {
+ /// <summary>Reports a progress update.</summary>
+ /// <param name="value">The value of the updated progress.</param>
+ void Report(T value);
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/IndexOutOfRangeException.cs b/src/System.Private.CoreLib/shared/System/IndexOutOfRangeException.cs
new file mode 100644
index 000000000..4969c2b86
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/IndexOutOfRangeException.cs
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: Exception class for invalid array indices.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public sealed class IndexOutOfRangeException : SystemException
+ {
+ public IndexOutOfRangeException()
+ : base(SR.Arg_IndexOutOfRangeException)
+ {
+ HResult = __HResults.COR_E_INDEXOUTOFRANGE;
+ }
+
+ public IndexOutOfRangeException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_INDEXOUTOFRANGE;
+ }
+
+ public IndexOutOfRangeException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_INDEXOUTOFRANGE;
+ }
+
+ internal IndexOutOfRangeException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/InsufficientExecutionStackException.cs b/src/System.Private.CoreLib/shared/System/InsufficientExecutionStackException.cs
new file mode 100644
index 000000000..b9a4a12dd
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/InsufficientExecutionStackException.cs
@@ -0,0 +1,32 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public sealed class InsufficientExecutionStackException : SystemException
+ {
+ public InsufficientExecutionStackException()
+ : base(SR.Arg_InsufficientExecutionStackException)
+ {
+ HResult = __HResults.COR_E_INSUFFICIENTEXECUTIONSTACK;
+ }
+
+ public InsufficientExecutionStackException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_INSUFFICIENTEXECUTIONSTACK;
+ }
+
+ public InsufficientExecutionStackException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_INSUFFICIENTEXECUTIONSTACK;
+ }
+
+ internal InsufficientExecutionStackException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/InvalidCastException.cs b/src/System.Private.CoreLib/shared/System/InvalidCastException.cs
new file mode 100644
index 000000000..01d92b283
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/InvalidCastException.cs
@@ -0,0 +1,44 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Purpose: Exception class for invalid cast conditions!
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class InvalidCastException : SystemException
+ {
+ public InvalidCastException()
+ : base(SR.Arg_InvalidCastException)
+ {
+ HResult = __HResults.COR_E_INVALIDCAST;
+ }
+
+ public InvalidCastException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_INVALIDCAST;
+ }
+
+ public InvalidCastException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_INVALIDCAST;
+ }
+
+ public InvalidCastException(String message, int errorCode)
+ : base(message)
+ {
+ HResult = errorCode;
+ }
+
+ protected InvalidCastException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/InvalidOperationException.cs b/src/System.Private.CoreLib/shared/System/InvalidOperationException.cs
new file mode 100644
index 000000000..24a08c808
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/InvalidOperationException.cs
@@ -0,0 +1,42 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: Exception class for denoting an object was in a state that
+** made calling a method illegal.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class InvalidOperationException : SystemException
+ {
+ public InvalidOperationException()
+ : base(SR.Arg_InvalidOperationException)
+ {
+ HResult = __HResults.COR_E_INVALIDOPERATION;
+ }
+
+ public InvalidOperationException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_INVALIDOPERATION;
+ }
+
+ public InvalidOperationException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_INVALIDOPERATION;
+ }
+
+ protected InvalidOperationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/InvalidProgramException.cs b/src/System.Private.CoreLib/shared/System/InvalidProgramException.cs
new file mode 100644
index 000000000..401b3a0dd
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/InvalidProgramException.cs
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: The exception class for programs with invalid IL or bad metadata.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public sealed class InvalidProgramException : SystemException
+ {
+ public InvalidProgramException()
+ : base(SR.InvalidProgram_Default)
+ {
+ HResult = __HResults.COR_E_INVALIDPROGRAM;
+ }
+
+ public InvalidProgramException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_INVALIDPROGRAM;
+ }
+
+ public InvalidProgramException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_INVALIDPROGRAM;
+ }
+
+ internal InvalidProgramException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/InvalidTimeZoneException.cs b/src/System.Private.CoreLib/shared/System/InvalidTimeZoneException.cs
new file mode 100644
index 000000000..8f0751c42
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/InvalidTimeZoneException.cs
@@ -0,0 +1,28 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class InvalidTimeZoneException : Exception
+ {
+ public InvalidTimeZoneException()
+ {
+ }
+
+ public InvalidTimeZoneException(String message)
+ : base(message)
+ {
+ }
+
+ public InvalidTimeZoneException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
+
+ protected InvalidTimeZoneException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/MarshalByRefObject.cs b/src/System.Private.CoreLib/shared/System/MarshalByRefObject.cs
new file mode 100644
index 000000000..9014de00c
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/MarshalByRefObject.cs
@@ -0,0 +1,30 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ [Serializable]
+ public abstract class MarshalByRefObject
+ {
+ protected MarshalByRefObject()
+ {
+ }
+
+ public object GetLifetimeService()
+ {
+ throw new PlatformNotSupportedException();
+ }
+
+ public virtual object InitializeLifetimeService()
+ {
+ throw new PlatformNotSupportedException();
+ }
+
+ protected MarshalByRefObject MemberwiseClone(bool cloneIdentity)
+ {
+ MarshalByRefObject mbr = (MarshalByRefObject)base.MemberwiseClone();
+ return mbr;
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/MemberAccessException.cs b/src/System.Private.CoreLib/shared/System/MemberAccessException.cs
new file mode 100644
index 000000000..54eee67b0
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/MemberAccessException.cs
@@ -0,0 +1,48 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+////////////////////////////////////////////////////////////////////////////////
+// MemberAccessException
+// Thrown when we try accessing a member that we cannot
+// access, due to it being removed, private or something similar.
+////////////////////////////////////////////////////////////////////////////////
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ // The MemberAccessException is thrown when trying to access a class
+ // member fails.
+ //
+ [Serializable]
+ public class MemberAccessException : SystemException
+ {
+ // Creates a new MemberAccessException with its message string set to
+ // the empty string, its HRESULT set to COR_E_MEMBERACCESS,
+ // and its ExceptionInfo reference set to null.
+ public MemberAccessException()
+ : base(SR.Arg_AccessException)
+ {
+ HResult = __HResults.COR_E_MEMBERACCESS;
+ }
+
+ // Creates a new MemberAccessException with its message string set to
+ // message, its HRESULT set to COR_E_ACCESS,
+ // and its ExceptionInfo reference set to null.
+ //
+ public MemberAccessException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_MEMBERACCESS;
+ }
+
+ public MemberAccessException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_MEMBERACCESS;
+ }
+
+ protected MemberAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/MethodAccessException.cs b/src/System.Private.CoreLib/shared/System/MethodAccessException.cs
new file mode 100644
index 000000000..2ecbd14d6
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/MethodAccessException.cs
@@ -0,0 +1,39 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+** Purpose: The exception class for class loading failures.
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class MethodAccessException : MemberAccessException
+ {
+ public MethodAccessException()
+ : base(SR.Arg_MethodAccessException)
+ {
+ HResult = __HResults.COR_E_METHODACCESS;
+ }
+
+ public MethodAccessException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_METHODACCESS;
+ }
+
+ public MethodAccessException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_METHODACCESS;
+ }
+
+ protected MethodAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/MidpointRounding.cs b/src/System.Private.CoreLib/shared/System/MidpointRounding.cs
new file mode 100644
index 000000000..a75de43e6
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/MidpointRounding.cs
@@ -0,0 +1,12 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ public enum MidpointRounding
+ {
+ ToEven = 0,
+ AwayFromZero = 1,
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/MulticastNotSupportedException.cs b/src/System.Private.CoreLib/shared/System/MulticastNotSupportedException.cs
new file mode 100644
index 000000000..4fcaa9857
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/MulticastNotSupportedException.cs
@@ -0,0 +1,37 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+////////////////////////////////////////////////////////////////////////////////
+// MulticastNotSupportedException
+// This is thrown when you add multiple callbacks to a non-multicast delegate.
+////////////////////////////////////////////////////////////////////////////////
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public sealed class MulticastNotSupportedException : SystemException
+ {
+ public MulticastNotSupportedException()
+ : base(SR.Arg_MulticastNotSupportedException)
+ {
+ HResult = __HResults.COR_E_MULTICASTNOTSUPPORTED;
+ }
+
+ public MulticastNotSupportedException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_MULTICASTNOTSUPPORTED;
+ }
+
+ public MulticastNotSupportedException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_MULTICASTNOTSUPPORTED;
+ }
+
+ internal MulticastNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/NotFiniteNumberException.cs b/src/System.Private.CoreLib/shared/System/NotFiniteNumberException.cs
new file mode 100644
index 000000000..5bc8df1e2
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/NotFiniteNumberException.cs
@@ -0,0 +1,71 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class NotFiniteNumberException : ArithmeticException
+ {
+ private double _offendingNumber;
+
+ public NotFiniteNumberException()
+ : base(SR.Arg_NotFiniteNumberException)
+ {
+ _offendingNumber = 0;
+ HResult = __HResults.COR_E_NOTFINITENUMBER;
+ }
+
+ public NotFiniteNumberException(double offendingNumber)
+ : base()
+ {
+ _offendingNumber = offendingNumber;
+ HResult = __HResults.COR_E_NOTFINITENUMBER;
+ }
+
+ public NotFiniteNumberException(String message)
+ : base(message)
+ {
+ _offendingNumber = 0;
+ HResult = __HResults.COR_E_NOTFINITENUMBER;
+ }
+
+ public NotFiniteNumberException(String message, double offendingNumber)
+ : base(message)
+ {
+ _offendingNumber = offendingNumber;
+ HResult = __HResults.COR_E_NOTFINITENUMBER;
+ }
+
+ public NotFiniteNumberException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_NOTFINITENUMBER;
+ }
+
+ public NotFiniteNumberException(String message, double offendingNumber, Exception innerException)
+ : base(message, innerException)
+ {
+ _offendingNumber = offendingNumber;
+ HResult = __HResults.COR_E_NOTFINITENUMBER;
+ }
+
+ protected NotFiniteNumberException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ _offendingNumber = info.GetInt32("OffendingNumber");
+ }
+
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData(info, context);
+ info.AddValue("OffendingNumber", _offendingNumber, typeof(Int32));
+ }
+
+ public double OffendingNumber
+ {
+ get { return _offendingNumber; }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/NotImplementedException.cs b/src/System.Private.CoreLib/shared/System/NotImplementedException.cs
new file mode 100644
index 000000000..4d141eac8
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/NotImplementedException.cs
@@ -0,0 +1,40 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: Exception thrown when a requested method or operation is not
+** implemented.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class NotImplementedException : SystemException
+ {
+ public NotImplementedException()
+ : base(SR.Arg_NotImplementedException)
+ {
+ HResult = __HResults.E_NOTIMPL;
+ }
+ public NotImplementedException(String message)
+ : base(message)
+ {
+ HResult = __HResults.E_NOTIMPL;
+ }
+ public NotImplementedException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.E_NOTIMPL;
+ }
+
+ protected NotImplementedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/NotSupportedException.cs b/src/System.Private.CoreLib/shared/System/NotSupportedException.cs
new file mode 100644
index 000000000..21b2d54a4
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/NotSupportedException.cs
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: For methods that should be implemented on subclasses.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class NotSupportedException : SystemException
+ {
+ public NotSupportedException()
+ : base(SR.Arg_NotSupportedException)
+ {
+ HResult = __HResults.COR_E_NOTSUPPORTED;
+ }
+
+ public NotSupportedException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_NOTSUPPORTED;
+ }
+
+ public NotSupportedException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_NOTSUPPORTED;
+ }
+
+ protected NotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/NullReferenceException.cs b/src/System.Private.CoreLib/shared/System/NullReferenceException.cs
new file mode 100644
index 000000000..0aa5c6197
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/NullReferenceException.cs
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: Exception class for dereferencing a null reference.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class NullReferenceException : SystemException
+ {
+ public NullReferenceException()
+ : base(SR.Arg_NullReferenceException)
+ {
+ HResult = __HResults.COR_E_NULLREFERENCE;
+ }
+
+ public NullReferenceException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_NULLREFERENCE;
+ }
+
+ public NullReferenceException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_NULLREFERENCE;
+ }
+
+ protected NullReferenceException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/ObjectDisposedException.cs b/src/System.Private.CoreLib/shared/System/ObjectDisposedException.cs
new file mode 100644
index 000000000..abb7c89da
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/ObjectDisposedException.cs
@@ -0,0 +1,82 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Globalization;
+using System.Runtime.Serialization;
+
+namespace System
+{
+ /// <devdoc>
+ /// <para> The exception that is thrown when accessing an object that was
+ /// disposed.</para>
+ /// </devdoc>
+ [Serializable]
+ public class ObjectDisposedException : InvalidOperationException
+ {
+ private String _objectName;
+
+ // This constructor should only be called by the EE (COMPlusThrow)
+ private ObjectDisposedException() :
+ this(null, SR.ObjectDisposed_Generic)
+ {
+ }
+
+ public ObjectDisposedException(String objectName) :
+ this(objectName, SR.ObjectDisposed_Generic)
+ {
+ }
+
+ public ObjectDisposedException(String objectName, String message) : base(message)
+ {
+ HResult = __HResults.COR_E_OBJECTDISPOSED;
+ _objectName = objectName;
+ }
+
+ public ObjectDisposedException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_OBJECTDISPOSED;
+ }
+
+ protected ObjectDisposedException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ _objectName = info.GetString("ObjectName");
+ }
+
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData(info, context);
+ info.AddValue("ObjectName", ObjectName, typeof(String));
+ }
+
+ /// <devdoc>
+ /// <para>Gets the text for the message for this exception.</para>
+ /// </devdoc>
+ public override String Message
+ {
+ get
+ {
+ String name = ObjectName;
+ if (name == null || name.Length == 0)
+ return base.Message;
+
+ String objectDisposed = SR.Format(SR.ObjectDisposed_ObjectName_Name, name);
+ return base.Message + Environment.NewLine + objectDisposed;
+ }
+ }
+
+ public String ObjectName
+ {
+ get
+ {
+ if ((_objectName == null)) // && !CompatibilitySwitches.IsAppEarlierThanWindowsPhone8)
+ {
+ return String.Empty;
+ }
+ return _objectName;
+ }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/ObsoleteAttribute.cs b/src/System.Private.CoreLib/shared/System/ObsoleteAttribute.cs
new file mode 100644
index 000000000..f18368599
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/ObsoleteAttribute.cs
@@ -0,0 +1,61 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Purpose: Attribute for functions, etc that will be removed.
+**
+**
+===========================================================*/
+
+using System;
+
+namespace System
+{
+ // This attribute is attached to members that are not to be used any longer.
+ // Message is some human readable explanation of what to use
+ // Error indicates if the compiler should treat usage of such a method as an
+ // error. (this would be used if the actual implementation of the obsolete
+ // method's implementation had changed).
+ //
+ [Serializable]
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum |
+ AttributeTargets.Interface | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Delegate
+ , Inherited = false)]
+ public sealed class ObsoleteAttribute : Attribute
+ {
+ private String _message;
+ private bool _error;
+
+ public ObsoleteAttribute()
+ {
+ _message = null;
+ _error = false;
+ }
+
+ public ObsoleteAttribute(String message)
+ {
+ _message = message;
+ _error = false;
+ }
+
+ public ObsoleteAttribute(String message, bool error)
+ {
+ _message = message;
+ _error = error;
+ }
+
+ public String Message
+ {
+ get { return _message; }
+ }
+
+ public bool IsError
+ {
+ get { return _error; }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/OverflowException.cs b/src/System.Private.CoreLib/shared/System/OverflowException.cs
new file mode 100644
index 000000000..e28c688dd
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/OverflowException.cs
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: Exception class for Arthimatic Overflows.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class OverflowException : ArithmeticException
+ {
+ public OverflowException()
+ : base(SR.Arg_OverflowException)
+ {
+ HResult = __HResults.COR_E_OVERFLOW;
+ }
+
+ public OverflowException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_OVERFLOW;
+ }
+
+ public OverflowException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_OVERFLOW;
+ }
+
+ protected OverflowException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/ParamArrayAttribute.cs b/src/System.Private.CoreLib/shared/System/ParamArrayAttribute.cs
new file mode 100644
index 000000000..d3c3d46d5
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/ParamArrayAttribute.cs
@@ -0,0 +1,21 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: Attribute for multiple parameters.
+**
+**
+=============================================================================*/
+
+namespace System
+{
+ [AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
+ public sealed class ParamArrayAttribute : Attribute
+ {
+ public ParamArrayAttribute() { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/PlatformNotSupportedException.cs b/src/System.Private.CoreLib/shared/System/PlatformNotSupportedException.cs
new file mode 100644
index 000000000..d2370b392
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/PlatformNotSupportedException.cs
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: To handle features that don't run on particular platforms
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class PlatformNotSupportedException : NotSupportedException
+ {
+ public PlatformNotSupportedException()
+ : base(SR.Arg_PlatformNotSupported)
+ {
+ HResult = __HResults.COR_E_PLATFORMNOTSUPPORTED;
+ }
+
+ public PlatformNotSupportedException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_PLATFORMNOTSUPPORTED;
+ }
+
+ public PlatformNotSupportedException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_PLATFORMNOTSUPPORTED;
+ }
+
+ protected PlatformNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/RankException.cs b/src/System.Private.CoreLib/shared/System/RankException.cs
new file mode 100644
index 000000000..612d0f086
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/RankException.cs
@@ -0,0 +1,42 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: For methods that are passed arrays with the wrong number of
+** dimensions.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class RankException : SystemException
+ {
+ public RankException()
+ : base(SR.Arg_RankException)
+ {
+ HResult = __HResults.COR_E_RANK;
+ }
+
+ public RankException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_RANK;
+ }
+
+ public RankException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_RANK;
+ }
+
+ protected RankException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/ExtensionAttribute.cs b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/ExtensionAttribute.cs
new file mode 100644
index 000000000..92170880f
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/ExtensionAttribute.cs
@@ -0,0 +1,14 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+
+namespace System.Runtime.CompilerServices
+{
+ /// <summary>
+ /// Indicates that a method is an extension method, or that a class or assembly contains extension methods.
+ /// </summary>
+ [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]
+ public sealed class ExtensionAttribute : Attribute { }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/FormattableStringFactory.cs b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/FormattableStringFactory.cs
new file mode 100644
index 000000000..23d03860e
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/FormattableStringFactory.cs
@@ -0,0 +1,58 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Purpose: implementation of the FormattableStringFactory
+** class.
+**
+===========================================================*/
+
+namespace System.Runtime.CompilerServices
+{
+ /// <summary>
+ /// A factory type used by compilers to create instances of the type <see cref="FormattableString"/>.
+ /// </summary>
+ public static class FormattableStringFactory
+ {
+ /// <summary>
+ /// Create a <see cref="FormattableString"/> from a composite format string and object
+ /// array containing zero or more objects to format.
+ /// </summary>
+ public static FormattableString Create(string format, params object[] arguments)
+ {
+ if (format == null)
+ {
+ throw new ArgumentNullException(nameof(format));
+ }
+
+ if (arguments == null)
+ {
+ throw new ArgumentNullException(nameof(arguments));
+ }
+
+ return new ConcreteFormattableString(format, arguments);
+ }
+
+ private sealed class ConcreteFormattableString : FormattableString
+ {
+ private readonly string _format;
+ private readonly object[] _arguments;
+
+ internal ConcreteFormattableString(string format, object[] arguments)
+ {
+ _format = format;
+ _arguments = arguments;
+ }
+
+ public override string Format { get { return _format; } }
+ public override object[] GetArguments() { return _arguments; }
+ public override int ArgumentCount { get { return _arguments.Length; } }
+ public override object GetArgument(int index) { return _arguments[index]; }
+ public override string ToString(IFormatProvider formatProvider) { return string.Format(formatProvider, _format, _arguments); }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/ITuple.cs b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/ITuple.cs
new file mode 100644
index 000000000..cafee11f8
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/ITuple.cs
@@ -0,0 +1,22 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Runtime.CompilerServices
+{
+ /// <summary>
+ /// This interface is required for types that want to be indexed into by dynamic patterns.
+ /// </summary>
+ public interface ITuple
+ {
+ /// <summary>
+ /// The number of positions in this data structure.
+ /// </summary>
+ int Length { get; }
+
+ /// <summary>
+ /// Get the element at position <param name="index"/>.
+ /// </summary>
+ object this[int index] { get; }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/IsVolatile.cs b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/IsVolatile.cs
new file mode 100644
index 000000000..fd1c6a1b1
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/IsVolatile.cs
@@ -0,0 +1,12 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Runtime.CompilerServices
+{
+ public static class IsVolatile
+ {
+ // no instantiation, please!
+ }
+}
+
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs
new file mode 100644
index 000000000..65b120e6b
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs
@@ -0,0 +1,57 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Collections.Generic;
+
+namespace System.Runtime.CompilerServices
+{
+ /// <summary>
+ /// Indicates that the use of <see cref="System.ValueTuple"/> on a member is meant to be treated as a tuple with element names.
+ /// </summary>
+ [CLSCompliant(false)]
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Event)]
+ public sealed class TupleElementNamesAttribute : Attribute
+ {
+ private readonly string[] _transformNames;
+
+ /// <summary>
+ /// Initializes a new instance of the <see
+ /// cref="TupleElementNamesAttribute"/> class.
+ /// </summary>
+ /// <param name="transformNames">
+ /// Specifies, in a pre-order depth-first traversal of a type's
+ /// construction, which <see cref="System.ValueType"/> occurrences are
+ /// meant to carry element names.
+ /// </param>
+ /// <remarks>
+ /// This constructor is meant to be used on types that contain an
+ /// instantiation of <see cref="System.ValueType"/> that contains
+ /// element names. For instance, if <c>C</c> is a generic type with
+ /// two type parameters, then a use of the constructed type <c>C{<see
+ /// cref="System.ValueTuple{T1, T2}"/>, <see
+ /// cref="System.ValueTuple{T1, T2, T3}"/></c> might be intended to
+ /// treat the first type argument as a tuple with element names and the
+ /// second as a tuple without element names. In which case, the
+ /// appropriate attribute specification should use a
+ /// <c>transformNames</c> value of <c>{ "name1", "name2", null, null,
+ /// null }</c>.
+ /// </remarks>
+ public TupleElementNamesAttribute(string[] transformNames)
+ {
+ if (transformNames == null)
+ {
+ throw new ArgumentNullException(nameof(transformNames));
+ }
+
+ _transformNames = transformNames;
+ }
+
+ /// <summary>
+ /// Specifies, in a pre-order depth-first traversal of a type's
+ /// construction, which <see cref="System.ValueTuple"/> elements are
+ /// meant to carry element names.
+ /// </summary>
+ public IList<string> TransformNames => _transformNames;
+ }
+} \ No newline at end of file
diff --git a/src/System.Private.CoreLib/shared/System/StackOverflowException.cs b/src/System.Private.CoreLib/shared/System/StackOverflowException.cs
new file mode 100644
index 000000000..0a875e737
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/StackOverflowException.cs
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: The exception class for stack overflow.
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public sealed class StackOverflowException : SystemException
+ {
+ public StackOverflowException()
+ : base(SR.Arg_StackOverflowException)
+ {
+ HResult = __HResults.COR_E_STACKOVERFLOW;
+ }
+
+ public StackOverflowException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_STACKOVERFLOW;
+ }
+
+ public StackOverflowException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_STACKOVERFLOW;
+ }
+
+ internal StackOverflowException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/StringSplitOptions.cs b/src/System.Private.CoreLib/shared/System/StringSplitOptions.cs
new file mode 100644
index 000000000..43b626a01
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/StringSplitOptions.cs
@@ -0,0 +1,13 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ [Flags]
+ public enum StringSplitOptions
+ {
+ None = 0,
+ RemoveEmptyEntries = 1
+ }
+} \ No newline at end of file
diff --git a/src/System.Private.CoreLib/shared/System/SystemException.cs b/src/System.Private.CoreLib/shared/System/SystemException.cs
new file mode 100644
index 000000000..f4779a2cd
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/SystemException.cs
@@ -0,0 +1,32 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class SystemException : Exception
+ {
+ public SystemException()
+ : base(SR.Arg_SystemException)
+ {
+ HResult = __HResults.COR_E_SYSTEM;
+ }
+
+ public SystemException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_SYSTEM;
+ }
+
+ public SystemException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_SYSTEM;
+ }
+
+ protected SystemException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Text/Normalization.cs b/src/System.Private.CoreLib/shared/System/Text/Normalization.cs
new file mode 100644
index 000000000..dc8bc2af7
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Text/Normalization.cs
@@ -0,0 +1,29 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Text
+{
+ // This is the enumeration for Normalization Forms
+ public enum NormalizationForm
+ {
+ FormC = 1,
+ FormD = 2,
+ FormKC = 5,
+ FormKD = 6
+ }
+
+ internal enum ExtendedNormalizationForms
+ {
+ FormC = 1,
+ FormD = 2,
+ FormKC = 5,
+ FormKD = 6,
+ FormIdna = 0xd,
+ FormCDisallowUnassigned = 0x101,
+ FormDDisallowUnassigned = 0x102,
+ FormKCDisallowUnassigned = 0x105,
+ FormKDDisallowUnassigned = 0x106,
+ FormIdnaDisallowUnassigned = 0x10d
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/ThreadAttributes.cs b/src/System.Private.CoreLib/shared/System/ThreadAttributes.cs
new file mode 100644
index 000000000..624873610
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/ThreadAttributes.cs
@@ -0,0 +1,28 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Purpose: For Threads-related custom attributes.
+**
+=============================================================================*/
+
+namespace System
+{
+ [AttributeUsage(AttributeTargets.Method)]
+ public sealed class STAThreadAttribute : Attribute
+ {
+ public STAThreadAttribute()
+ {
+ }
+ }
+
+ [AttributeUsage(AttributeTargets.Method)]
+ public sealed class MTAThreadAttribute : Attribute
+ {
+ public MTAThreadAttribute()
+ {
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/ThreadStaticAttribute.cs b/src/System.Private.CoreLib/shared/System/ThreadStaticAttribute.cs
new file mode 100644
index 000000000..3755e65a7
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/ThreadStaticAttribute.cs
@@ -0,0 +1,28 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Purpose: Custom attribute to indicate that the field should be treated
+** as a static relative to a thread.
+**
+**
+**
+===========================================================*/
+
+using System;
+
+namespace System
+{
+ [Serializable]
+ [AttributeUsage(AttributeTargets.Field, Inherited = false)]
+ public class ThreadStaticAttribute : Attribute
+ {
+ public ThreadStaticAttribute()
+ {
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Threading/Timeout.cs b/src/System.Private.CoreLib/shared/System/Threading/Timeout.cs
new file mode 100644
index 000000000..df1ea5f2b
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Threading/Timeout.cs
@@ -0,0 +1,20 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Threading;
+using System;
+
+namespace System.Threading
+{
+ // A constant used by methods that take a timeout (Object.Wait, Thread.Sleep
+ // etc) to indicate that no timeout should occur.
+ //
+ public static class Timeout
+ {
+ public static readonly TimeSpan InfiniteTimeSpan = new TimeSpan(0, 0, 0, 0, Timeout.Infinite);
+
+ public const int Infinite = -1;
+ internal const uint UnsignedInfinite = unchecked((uint)-1);
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/TimeZoneNotFoundException.cs b/src/System.Private.CoreLib/shared/System/TimeZoneNotFoundException.cs
new file mode 100644
index 000000000..ee21c2524
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/TimeZoneNotFoundException.cs
@@ -0,0 +1,28 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class TimeZoneNotFoundException : Exception
+ {
+ public TimeZoneNotFoundException()
+ {
+ }
+
+ public TimeZoneNotFoundException(String message)
+ : base(message)
+ {
+ }
+
+ public TimeZoneNotFoundException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
+
+ protected TimeZoneNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/TimeoutException.cs b/src/System.Private.CoreLib/shared/System/TimeoutException.cs
new file mode 100644
index 000000000..32775a1c5
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/TimeoutException.cs
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: Exception class for Timeout
+**
+**
+=============================================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public class TimeoutException : SystemException
+ {
+ public TimeoutException()
+ : base(SR.Arg_TimeoutException)
+ {
+ HResult = __HResults.COR_E_TIMEOUT;
+ }
+
+ public TimeoutException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_TIMEOUT;
+ }
+
+ public TimeoutException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_TIMEOUT;
+ }
+
+ protected TimeoutException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/TupleExtensions.cs b/src/System.Private.CoreLib/shared/System/TupleExtensions.cs
new file mode 100644
index 000000000..b63cb4121
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/TupleExtensions.cs
@@ -0,0 +1,930 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+
+namespace System
+{
+ /// <summary>
+ /// Provides extension methods for <see cref="Tuple"/> instances to interop with C# tuples features (deconstruction syntax, converting from and to <see cref="ValueTuple"/>).
+ /// </summary>
+ public static class TupleExtensions
+ {
+ #region Deconstruct
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 1 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1>(
+ this Tuple<T1> value,
+ out T1 item1)
+ {
+ item1 = value.Item1;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 2 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2>(
+ this Tuple<T1, T2> value,
+ out T1 item1, out T2 item2)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 3 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3>(
+ this Tuple<T1, T2, T3> value,
+ out T1 item1, out T2 item2, out T3 item3)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 4 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4>(
+ this Tuple<T1, T2, T3, T4> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 5 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5>(
+ this Tuple<T1, T2, T3, T4, T5> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 6 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6>(
+ this Tuple<T1, T2, T3, T4, T5, T6> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 7 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 8 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 9 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 10 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ item10 = value.Rest.Item3;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 11 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ item10 = value.Rest.Item3;
+ item11 = value.Rest.Item4;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 12 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ item10 = value.Rest.Item3;
+ item11 = value.Rest.Item4;
+ item12 = value.Rest.Item5;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 13 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ item10 = value.Rest.Item3;
+ item11 = value.Rest.Item4;
+ item12 = value.Rest.Item5;
+ item13 = value.Rest.Item6;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 14 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ item10 = value.Rest.Item3;
+ item11 = value.Rest.Item4;
+ item12 = value.Rest.Item5;
+ item13 = value.Rest.Item6;
+ item14 = value.Rest.Item7;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 15 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15>>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ item10 = value.Rest.Item3;
+ item11 = value.Rest.Item4;
+ item12 = value.Rest.Item5;
+ item13 = value.Rest.Item6;
+ item14 = value.Rest.Item7;
+ item15 = value.Rest.Rest.Item1;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 16 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16>>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ item10 = value.Rest.Item3;
+ item11 = value.Rest.Item4;
+ item12 = value.Rest.Item5;
+ item13 = value.Rest.Item6;
+ item14 = value.Rest.Item7;
+ item15 = value.Rest.Rest.Item1;
+ item16 = value.Rest.Rest.Item2;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 17 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17>>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ item10 = value.Rest.Item3;
+ item11 = value.Rest.Item4;
+ item12 = value.Rest.Item5;
+ item13 = value.Rest.Item6;
+ item14 = value.Rest.Item7;
+ item15 = value.Rest.Rest.Item1;
+ item16 = value.Rest.Rest.Item2;
+ item17 = value.Rest.Rest.Item3;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 18 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18>>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ item10 = value.Rest.Item3;
+ item11 = value.Rest.Item4;
+ item12 = value.Rest.Item5;
+ item13 = value.Rest.Item6;
+ item14 = value.Rest.Item7;
+ item15 = value.Rest.Rest.Item1;
+ item16 = value.Rest.Rest.Item2;
+ item17 = value.Rest.Rest.Item3;
+ item18 = value.Rest.Rest.Item4;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 19 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19>>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18, out T19 item19)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ item10 = value.Rest.Item3;
+ item11 = value.Rest.Item4;
+ item12 = value.Rest.Item5;
+ item13 = value.Rest.Item6;
+ item14 = value.Rest.Item7;
+ item15 = value.Rest.Rest.Item1;
+ item16 = value.Rest.Rest.Item2;
+ item17 = value.Rest.Rest.Item3;
+ item18 = value.Rest.Rest.Item4;
+ item19 = value.Rest.Rest.Item5;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 20 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19, T20>>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18, out T19 item19, out T20 item20)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ item10 = value.Rest.Item3;
+ item11 = value.Rest.Item4;
+ item12 = value.Rest.Item5;
+ item13 = value.Rest.Item6;
+ item14 = value.Rest.Item7;
+ item15 = value.Rest.Rest.Item1;
+ item16 = value.Rest.Rest.Item2;
+ item17 = value.Rest.Rest.Item3;
+ item18 = value.Rest.Rest.Item4;
+ item19 = value.Rest.Rest.Item5;
+ item20 = value.Rest.Rest.Item6;
+ }
+
+ /// <summary>
+ /// Deconstruct a properly nested <see cref="Tuple"/> with 21 elements.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19, T20, T21>>> value,
+ out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18, out T19 item19, out T20 item20, out T21 item21)
+ {
+ item1 = value.Item1;
+ item2 = value.Item2;
+ item3 = value.Item3;
+ item4 = value.Item4;
+ item5 = value.Item5;
+ item6 = value.Item6;
+ item7 = value.Item7;
+ item8 = value.Rest.Item1;
+ item9 = value.Rest.Item2;
+ item10 = value.Rest.Item3;
+ item11 = value.Rest.Item4;
+ item12 = value.Rest.Item5;
+ item13 = value.Rest.Item6;
+ item14 = value.Rest.Item7;
+ item15 = value.Rest.Rest.Item1;
+ item16 = value.Rest.Rest.Item2;
+ item17 = value.Rest.Rest.Item3;
+ item18 = value.Rest.Rest.Item4;
+ item19 = value.Rest.Rest.Item5;
+ item20 = value.Rest.Rest.Item6;
+ item21 = value.Rest.Rest.Item7;
+ }
+ #endregion
+
+ #region ToValueTuple
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 1 element.
+ /// </summary>
+ public static ValueTuple<T1>
+ ToValueTuple<T1>(
+ this Tuple<T1> value)
+ {
+ return ValueTuple.Create(value.Item1);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 2 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2>
+ ToValueTuple<T1, T2>(
+ this Tuple<T1, T2> value)
+ {
+ return ValueTuple.Create(value.Item1, value.Item2);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 3 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3>
+ ToValueTuple<T1, T2, T3>(
+ this Tuple<T1, T2, T3> value)
+ {
+ return ValueTuple.Create(value.Item1, value.Item2, value.Item3);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 4 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4>
+ ToValueTuple<T1, T2, T3, T4>(
+ this Tuple<T1, T2, T3, T4> value)
+ {
+ return ValueTuple.Create(value.Item1, value.Item2, value.Item3, value.Item4);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 5 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5>
+ ToValueTuple<T1, T2, T3, T4, T5>(
+ this Tuple<T1, T2, T3, T4, T5> value)
+ {
+ return ValueTuple.Create(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 6 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6>
+ ToValueTuple<T1, T2, T3, T4, T5, T6>(
+ this Tuple<T1, T2, T3, T4, T5, T6> value)
+ {
+ return ValueTuple.Create(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 7 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7> value)
+ {
+ return ValueTuple.Create(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 8 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ ValueTuple.Create(value.Rest.Item1));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 9 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ ValueTuple.Create(value.Rest.Item1, value.Rest.Item2));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 10 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ ValueTuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 11 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ ValueTuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 12 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ ValueTuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 13 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ ValueTuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 14 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ ValueTuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 15 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15>>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15>>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLong(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ ValueTuple.Create(value.Rest.Rest.Item1)));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 16 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15, T16>>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16>>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLong(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ ValueTuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2)));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 17 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15, T16, T17>>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17>>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLong(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ ValueTuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3)));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 18 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15, T16, T17, T18>>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18>>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLong(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ ValueTuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4)));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 19 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15, T16, T17, T18, T19>>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19>>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLong(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ ValueTuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4, value.Rest.Rest.Item5)));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 20 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15, T16, T17, T18, T19, T20>>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19, T20>>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLong(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ ValueTuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4, value.Rest.Rest.Item5, value.Rest.Rest.Item6)));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="ValueTuple"/> from a properly nested <see cref="Tuple"/> with 21 elements.
+ /// </summary>
+ public static ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15, T16, T17, T18, T19, T20, T21>>>
+ ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(
+ this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19, T20, T21>>> value)
+ {
+ return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLong(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ ValueTuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4, value.Rest.Rest.Item5, value.Rest.Rest.Item6, value.Rest.Rest.Item7)));
+ }
+ #endregion
+
+ #region ToTuple
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 1 element.
+ /// </summary>
+ public static Tuple<T1>
+ ToTuple<T1>(
+ this ValueTuple<T1> value)
+ {
+ return Tuple.Create(value.Item1);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 2 elements.
+ /// </summary>
+ public static Tuple<T1, T2>
+ ToTuple<T1, T2>(
+ this ValueTuple<T1, T2> value)
+ {
+ return Tuple.Create(value.Item1, value.Item2);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 3 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3>
+ ToTuple<T1, T2, T3>(
+ this ValueTuple<T1, T2, T3> value)
+ {
+ return Tuple.Create(value.Item1, value.Item2, value.Item3);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 4 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4>
+ ToTuple<T1, T2, T3, T4>(
+ this ValueTuple<T1, T2, T3, T4> value)
+ {
+ return Tuple.Create(value.Item1, value.Item2, value.Item3, value.Item4);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 5 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5>
+ ToTuple<T1, T2, T3, T4, T5>(
+ this ValueTuple<T1, T2, T3, T4, T5> value)
+ {
+ return Tuple.Create(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 6 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6>
+ ToTuple<T1, T2, T3, T4, T5, T6>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6> value)
+ {
+ return Tuple.Create(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 7 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7> value)
+ {
+ return Tuple.Create(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7);
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 8 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ Tuple.Create(value.Rest.Item1));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 9 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ Tuple.Create(value.Rest.Item1, value.Rest.Item2));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 10 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ Tuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 11 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ Tuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 12 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ Tuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 13 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ Tuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 14 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ Tuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 15 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15>>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15>>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ Tuple.Create(value.Rest.Rest.Item1)));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 16 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16>>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15, T16>>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ Tuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2)));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 17 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17>>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15, T16, T17>>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ Tuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3)));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 18 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18>>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15, T16, T17, T18>>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ Tuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4)));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 19 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19>>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15, T16, T17, T18, T19>>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ Tuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4, value.Rest.Rest.Item5)));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 20 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19, T20>>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15, T16, T17, T18, T19, T20>>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ Tuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4, value.Rest.Rest.Item5, value.Rest.Rest.Item6)));
+ }
+
+ /// <summary>
+ /// Make a properly nested <see cref="Tuple"/> from a properly nested <see cref="ValueTuple"/> with 21 elements.
+ /// </summary>
+ public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19, T20, T21>>>
+ ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(
+ this ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8, T9, T10, T11, T12, T13, T14, ValueTuple<T15, T16, T17, T18, T19, T20, T21>>> value)
+ {
+ return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7,
+ CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7,
+ Tuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4, value.Rest.Rest.Item5, value.Rest.Rest.Item6, value.Rest.Rest.Item7)));
+ }
+ #endregion
+
+ private static ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> CreateLong<T1, T2, T3, T4, T5, T6, T7, TRest>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest) where TRest : struct, ITuple =>
+ new ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>(item1, item2, item3, item4, item5, item6, item7, rest);
+
+ private static Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> CreateLongRef<T1, T2, T3, T4, T5, T6, T7, TRest>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest) where TRest : ITuple =>
+ new Tuple<T1, T2, T3, T4, T5, T6, T7, TRest>(item1, item2, item3, item4, item5, item6, item7, rest);
+ }
+} \ No newline at end of file
diff --git a/src/System.Private.CoreLib/shared/System/TypeAccessException.cs b/src/System.Private.CoreLib/shared/System/TypeAccessException.cs
new file mode 100644
index 000000000..32afbdfeb
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/TypeAccessException.cs
@@ -0,0 +1,34 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ // TypeAccessException derives from TypeLoadException rather than MemberAccessException because in
+ // pre-v4 releases of the runtime TypeLoadException was used in lieu of a TypeAccessException.
+ [Serializable]
+ public class TypeAccessException : TypeLoadException
+ {
+ public TypeAccessException()
+ : base(SR.Arg_TypeAccessException)
+ {
+ HResult = __HResults.COR_E_TYPEACCESS;
+ }
+
+ public TypeAccessException(string message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_TYPEACCESS;
+ }
+
+ public TypeAccessException(string message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_TYPEACCESS;
+ }
+
+ protected TypeAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/TypeCode.cs b/src/System.Private.CoreLib/shared/System/TypeCode.cs
new file mode 100644
index 000000000..293eb1f1a
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/TypeCode.cs
@@ -0,0 +1,48 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+// The TypeCode enum represents the type code of an object. To obtain the
+// TypeCode for a given object, use the Value.GetTypeCode() method. The
+// TypeCode.Empty value represents a null object reference. The TypeCode.Object
+// value represents an object that doesn't implement the IConvertible interface. The
+// TypeCode.DBNull value represents the database null, which is distinct and
+// different from a null reference. The other type codes represent values that
+// use the given simple type encoding.
+//
+// Note that when an object has a given TypeCode, there is no guarantee that
+// the object is an instance of the corresponding System.XXX value class. For
+// example, an object with the type code TypeCode.Int32 might actually be an
+// instance of a nullable 32-bit integer type (with a value that isn't the
+// database null).
+//
+// There are no type codes for "Missing", "Error", "IDispatch", and "IUnknown".
+// These types of values are instead represented as classes. When the type code
+// of an object is TypeCode.Object, a further instance-of check can be used to
+// determine if the object is one of these values.
+
+namespace System
+{
+ [Serializable]
+ public enum TypeCode
+ {
+ Empty = 0, // Null reference
+ Object = 1, // Instance that isn't a value
+ DBNull = 2, // Database null value
+ Boolean = 3, // Boolean
+ Char = 4, // Unicode character
+ SByte = 5, // Signed 8-bit integer
+ Byte = 6, // Unsigned 8-bit integer
+ Int16 = 7, // Signed 16-bit integer
+ UInt16 = 8, // Unsigned 16-bit integer
+ Int32 = 9, // Signed 32-bit integer
+ UInt32 = 10, // Unsigned 32-bit integer
+ Int64 = 11, // Signed 64-bit integer
+ UInt64 = 12, // Unsigned 64-bit integer
+ Single = 13, // IEEE 32-bit float
+ Double = 14, // IEEE 64-bit double
+ Decimal = 15, // Decimal
+ DateTime = 16, // DateTime
+ String = 18, // Unicode character string
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/TypeInitializationException.cs b/src/System.Private.CoreLib/shared/System/TypeInitializationException.cs
new file mode 100644
index 000000000..919102834
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/TypeInitializationException.cs
@@ -0,0 +1,79 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+**
+**
+** Purpose: The exception class to wrap exceptions thrown by
+** a type's class initializer (.cctor). This is sufficiently
+** distinct from a TypeLoadException, which means we couldn't
+** find the type.
+**
+**
+=============================================================================*/
+
+using System.Globalization;
+using System.Runtime.Serialization;
+
+namespace System
+{
+ [Serializable]
+ public sealed class TypeInitializationException : SystemException
+ {
+ private String _typeName;
+
+ // This exception is not creatable without specifying the
+ // inner exception.
+ private TypeInitializationException()
+ : base(SR.TypeInitialization_Default)
+ {
+ HResult = __HResults.COR_E_TYPEINITIALIZATION;
+ }
+
+
+ public TypeInitializationException(String fullTypeName, Exception innerException)
+ : this(fullTypeName, SR.Format(SR.TypeInitialization_Type, fullTypeName), innerException)
+ {
+ }
+
+ // This is called from within the runtime. I believe this is necessary
+ // for Interop only, though it's not particularly useful.
+ internal TypeInitializationException(String message) : base(message)
+ {
+ HResult = __HResults.COR_E_TYPEINITIALIZATION;
+ }
+
+ internal TypeInitializationException(String fullTypeName, String message, Exception innerException)
+ : base(message, innerException)
+ {
+ _typeName = fullTypeName;
+ HResult = __HResults.COR_E_TYPEINITIALIZATION;
+ }
+
+ internal TypeInitializationException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ _typeName = info.GetString("TypeName");
+ }
+
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData(info, context);
+ info.AddValue("TypeName", TypeName, typeof(String));
+ }
+
+ public String TypeName
+ {
+ get
+ {
+ if (_typeName == null)
+ {
+ return String.Empty;
+ }
+ return _typeName;
+ }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/UnauthorizedAccessException.cs b/src/System.Private.CoreLib/shared/System/UnauthorizedAccessException.cs
new file mode 100644
index 000000000..997358826
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/UnauthorizedAccessException.cs
@@ -0,0 +1,45 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Purpose: An exception for OS 'access denied' types of
+** errors, including IO and limited security types
+** of errors.
+**
+**
+===========================================================*/
+
+using System.Runtime.Serialization;
+
+namespace System
+{
+ // The UnauthorizedAccessException is thrown when access errors
+ // occur from IO or other OS methods.
+ [Serializable]
+ public class UnauthorizedAccessException : SystemException
+ {
+ public UnauthorizedAccessException()
+ : base(SR.Arg_UnauthorizedAccessException)
+ {
+ HResult = __HResults.COR_E_UNAUTHORIZEDACCESS;
+ }
+
+ public UnauthorizedAccessException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_UNAUTHORIZEDACCESS;
+ }
+
+ public UnauthorizedAccessException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_UNAUTHORIZEDACCESS;
+ }
+
+ protected UnauthorizedAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/UnhandledExceptionEventArgs.cs b/src/System.Private.CoreLib/shared/System/UnhandledExceptionEventArgs.cs
new file mode 100644
index 000000000..d33830181
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/UnhandledExceptionEventArgs.cs
@@ -0,0 +1,29 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ [Serializable]
+ public class UnhandledExceptionEventArgs : EventArgs
+ {
+ private Object _exception;
+ private bool _isTerminating;
+
+ public UnhandledExceptionEventArgs(Object exception, bool isTerminating)
+ {
+ _exception = exception;
+ _isTerminating = isTerminating;
+ }
+
+ public Object ExceptionObject
+ {
+ get { return _exception; }
+ }
+
+ public bool IsTerminating
+ {
+ get { return _isTerminating; }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/UnhandledExceptionEventHandler.cs b/src/System.Private.CoreLib/shared/System/UnhandledExceptionEventHandler.cs
new file mode 100644
index 000000000..b99414c18
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/UnhandledExceptionEventHandler.cs
@@ -0,0 +1,9 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ [Serializable]
+ public delegate void UnhandledExceptionEventHandler(Object sender, UnhandledExceptionEventArgs e);
+}
diff --git a/src/System.Private.CoreLib/shared/System/Void.cs b/src/System.Private.CoreLib/shared/System/Void.cs
new file mode 100644
index 000000000..5c20f634f
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Void.cs
@@ -0,0 +1,17 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+////////////////////////////////////////////////////////////////////////////////
+// Void
+// This class represents the void return type
+////////////////////////////////////////////////////////////////////////////////
+
+namespace System
+{
+ // This class represents the void return type
+ [Serializable]
+ public struct Void
+ {
+ }
+}