diff --git a/src/mscorlib/System.Private.CoreLib.csproj b/src/mscorlib/System.Private.CoreLib.csproj
index ff62e7d827e9..218ef0839d2c 100644
--- a/src/mscorlib/System.Private.CoreLib.csproj
+++ b/src/mscorlib/System.Private.CoreLib.csproj
@@ -125,39 +125,21 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -181,17 +163,13 @@
-
-
-
-
@@ -310,7 +288,6 @@
-
@@ -327,6 +304,7 @@
+
@@ -336,7 +314,6 @@
-
@@ -368,16 +345,12 @@
-
-
-
-
@@ -401,7 +374,6 @@
-
@@ -628,23 +600,15 @@
-
-
-
-
-
-
-
-
@@ -654,13 +618,11 @@
-
-
@@ -677,7 +639,6 @@
-
@@ -699,9 +660,6 @@
-
-
-
@@ -709,14 +667,9 @@
-
-
-
-
-
@@ -758,20 +711,13 @@
-
-
-
-
-
-
-
@@ -801,13 +747,11 @@
-
-
@@ -815,7 +759,6 @@
-
@@ -833,7 +776,6 @@
-
diff --git a/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems b/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
index a7736298ca7d..a5cc8978c7f0 100644
--- a/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
+++ b/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
@@ -82,6 +82,7 @@
+
@@ -121,6 +122,8 @@
+
+
@@ -130,6 +133,8 @@
+
+
@@ -175,6 +180,7 @@
+
@@ -188,12 +194,20 @@
+
+
+
+
+
+
+
+
@@ -203,6 +217,7 @@
+
@@ -212,7 +227,10 @@
+
+
+
@@ -292,29 +310,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -329,12 +380,12 @@
+
-
@@ -346,6 +397,7 @@
+
@@ -359,6 +411,8 @@
+
+
@@ -372,6 +426,7 @@
+
diff --git a/src/mscorlib/src/System/ArgumentException.cs b/src/mscorlib/shared/System/ArgumentException.cs
similarity index 97%
rename from src/mscorlib/src/System/ArgumentException.cs
rename to src/mscorlib/shared/System/ArgumentException.cs
index fe054a9aa00d..96afbe10d9d5 100644
--- a/src/mscorlib/src/System/ArgumentException.cs
+++ b/src/mscorlib/shared/System/ArgumentException.cs
@@ -21,7 +21,7 @@ namespace System
// message describing what was wrong and which parameter is incorrect.
//
[Serializable]
- public class ArgumentException : SystemException, ISerializable
+ public class ArgumentException : SystemException
{
private String _paramName;
diff --git a/src/mscorlib/src/System/Configuration/Assemblies/AssemblyHashAlgorithm.cs b/src/mscorlib/shared/System/Configuration/Assemblies/AssemblyHashAlgorithm.cs
similarity index 65%
rename from src/mscorlib/src/System/Configuration/Assemblies/AssemblyHashAlgorithm.cs
rename to src/mscorlib/shared/System/Configuration/Assemblies/AssemblyHashAlgorithm.cs
index b3e6b214359f..aca8da5932b6 100644
--- a/src/mscorlib/src/System/Configuration/Assemblies/AssemblyHashAlgorithm.cs
+++ b/src/mscorlib/shared/System/Configuration/Assemblies/AssemblyHashAlgorithm.cs
@@ -2,23 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-**
-**
-** Purpose:
-**
-**
-===========================================================*/
-
-using System.Runtime.InteropServices;
-
-
-using System;
-
namespace System.Configuration.Assemblies
{
- [Serializable]
public enum AssemblyHashAlgorithm
{
None = 0,
diff --git a/src/mscorlib/src/System/Configuration/Assemblies/AssemblyVersionCompatibility.cs b/src/mscorlib/shared/System/Configuration/Assemblies/AssemblyVersionCompatibility.cs
similarity index 60%
rename from src/mscorlib/src/System/Configuration/Assemblies/AssemblyVersionCompatibility.cs
rename to src/mscorlib/shared/System/Configuration/Assemblies/AssemblyVersionCompatibility.cs
index f1d5ff022125..ef7b3eb45f01 100644
--- a/src/mscorlib/src/System/Configuration/Assemblies/AssemblyVersionCompatibility.cs
+++ b/src/mscorlib/shared/System/Configuration/Assemblies/AssemblyVersionCompatibility.cs
@@ -2,20 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-**
-**
-** Purpose: defining the different flavor's assembly version compatibility
-**
-**
-===========================================================*/
-
-using System;
-
namespace System.Configuration.Assemblies
{
- [Serializable]
public enum AssemblyVersionCompatibility
{
SameMachine = 1,
diff --git a/src/mscorlib/shared/System/Diagnostics/CodeAnalysis/SuppressMessageAttribute.cs b/src/mscorlib/shared/System/Diagnostics/CodeAnalysis/SuppressMessageAttribute.cs
new file mode 100644
index 000000000000..893d7b8bc99a
--- /dev/null
+++ b/src/mscorlib/shared/System/Diagnostics/CodeAnalysis/SuppressMessageAttribute.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.
+
+/*============================================================
+**
+**
+**
+** An attribute to suppress violation messages/warnings
+** by static code analysis tools.
+**
+**
+===========================================================*/
+
+namespace System.Diagnostics.CodeAnalysis
+{
+ [AttributeUsage(
+ AttributeTargets.All,
+ Inherited = false,
+ AllowMultiple = true
+ )
+ ]
+ [Conditional("CODE_ANALYSIS")]
+ public sealed class SuppressMessageAttribute : Attribute
+ {
+ public SuppressMessageAttribute(string category, string checkId)
+ {
+ Category = category;
+ CheckId = checkId;
+ }
+
+ public string Category { get; }
+ public string CheckId { get; }
+ public string Scope { get; set; }
+ public string Target { get; set; }
+ public string MessageId { get; set; }
+ public string Justification { get; set; }
+ }
+}
diff --git a/src/mscorlib/src/System/Diagnostics/ConditionalAttribute.cs b/src/mscorlib/shared/System/Diagnostics/ConditionalAttribute.cs
similarity index 58%
rename from src/mscorlib/src/System/Diagnostics/ConditionalAttribute.cs
rename to src/mscorlib/shared/System/Diagnostics/ConditionalAttribute.cs
index 5212db85995b..d5bca6e2088e 100644
--- a/src/mscorlib/src/System/Diagnostics/ConditionalAttribute.cs
+++ b/src/mscorlib/shared/System/Diagnostics/ConditionalAttribute.cs
@@ -2,27 +2,17 @@
// 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.Diagnostics
{
[Serializable]
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)]
public sealed class ConditionalAttribute : Attribute
{
- public ConditionalAttribute(String conditionString)
- {
- m_conditionString = conditionString;
- }
-
- public String ConditionString
+ public ConditionalAttribute(string conditionString)
{
- get
- {
- return m_conditionString;
- }
+ ConditionString = conditionString;
}
- private String m_conditionString;
+ public string ConditionString { get; }
}
}
diff --git a/src/mscorlib/shared/System/ICloneable.cs b/src/mscorlib/shared/System/ICloneable.cs
new file mode 100644
index 000000000000..9f123e45c849
--- /dev/null
+++ b/src/mscorlib/shared/System/ICloneable.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 ICloneable
+ {
+ object Clone();
+ }
+}
diff --git a/src/mscorlib/src/System/IO/DirectoryNotFoundException.cs b/src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs
similarity index 73%
rename from src/mscorlib/src/System/IO/DirectoryNotFoundException.cs
rename to src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs
index 83ddf604cfdd..786c2106a347 100644
--- a/src/mscorlib/src/System/IO/DirectoryNotFoundException.cs
+++ b/src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs
@@ -2,18 +2,6 @@
// 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 for accessing a path that doesn't exist.
-**
-**
-===========================================================*/
-
-using System;
using System.Runtime.Serialization;
namespace System.IO
@@ -33,19 +21,20 @@ public DirectoryNotFoundException()
HResult = __HResults.COR_E_DIRECTORYNOTFOUND;
}
- public DirectoryNotFoundException(String message)
+ public DirectoryNotFoundException(string message)
: base(message)
{
HResult = __HResults.COR_E_DIRECTORYNOTFOUND;
}
- public DirectoryNotFoundException(String message, Exception innerException)
+ public DirectoryNotFoundException(string message, Exception innerException)
: base(message, innerException)
{
HResult = __HResults.COR_E_DIRECTORYNOTFOUND;
}
- protected DirectoryNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
+ protected DirectoryNotFoundException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
{
}
}
diff --git a/src/mscorlib/src/System/IO/EndOfStreamException.cs b/src/mscorlib/shared/System/IO/EndOfStreamException.cs
similarity index 67%
rename from src/mscorlib/src/System/IO/EndOfStreamException.cs
rename to src/mscorlib/shared/System/IO/EndOfStreamException.cs
index a0e197a359dc..52ab22cfbb9b 100644
--- a/src/mscorlib/src/System/IO/EndOfStreamException.cs
+++ b/src/mscorlib/shared/System/IO/EndOfStreamException.cs
@@ -2,22 +2,14 @@
// 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 be thrown when reading past end-of-file.
-**
-**
-===========================================================*/
-
-using System;
using System.Runtime.Serialization;
namespace System.IO
{
+#if PROJECTN
+ [Internal.Runtime.CompilerServices.RelocatedType("System.IO")]
+ [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
+#endif
[Serializable]
public class EndOfStreamException : IOException
{
@@ -27,19 +19,20 @@ public EndOfStreamException()
HResult = __HResults.COR_E_ENDOFSTREAM;
}
- public EndOfStreamException(String message)
+ public EndOfStreamException(string message)
: base(message)
{
HResult = __HResults.COR_E_ENDOFSTREAM;
}
- public EndOfStreamException(String message, Exception innerException)
+ public EndOfStreamException(string message, Exception innerException)
: base(message, innerException)
{
HResult = __HResults.COR_E_ENDOFSTREAM;
}
- protected EndOfStreamException(SerializationInfo info, StreamingContext context) : base(info, context)
+ protected EndOfStreamException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
{
}
}
diff --git a/src/mscorlib/src/System/IO/FileAccess.cs b/src/mscorlib/shared/System/IO/FileAccess.cs
similarity index 79%
rename from src/mscorlib/src/System/IO/FileAccess.cs
rename to src/mscorlib/shared/System/IO/FileAccess.cs
index ad6117ebd379..eaa94f348322 100644
--- a/src/mscorlib/src/System/IO/FileAccess.cs
+++ b/src/mscorlib/shared/System/IO/FileAccess.cs
@@ -2,19 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-** Enum: FileAccess
-**
-**
-**
-**
-** Purpose: Enum describing whether you want read and/or write
-** permission to a file.
-**
-**
-===========================================================*/
-
using System;
namespace System.IO
@@ -24,6 +11,9 @@ namespace System.IO
//
[Serializable]
[Flags]
+#if PROJECTN
+ [Internal.Runtime.CompilerServices.RelocatedTypeAttribute("System.IO.FileSystem.Primitives")]
+#endif
public enum FileAccess
{
// Specifies read access to the file. Data can be read from the file and
diff --git a/src/mscorlib/src/System/IO/FileMode.cs b/src/mscorlib/shared/System/IO/FileMode.cs
similarity index 83%
rename from src/mscorlib/src/System/IO/FileMode.cs
rename to src/mscorlib/shared/System/IO/FileMode.cs
index 6f222e7a60f4..73ef68bb66c5 100644
--- a/src/mscorlib/src/System/IO/FileMode.cs
+++ b/src/mscorlib/shared/System/IO/FileMode.cs
@@ -2,21 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-** Enum: FileMode
-**
-**
-**
-**
-** Purpose: Enum describing whether to create a new file or
-** open an existing one.
-**
-**
-===========================================================*/
-
-using System;
-
namespace System.IO
{
// Contains constants for specifying how the OS should open a file.
@@ -27,7 +12,9 @@ namespace System.IO
// to the end of the file). To truncate a file or create it if it doesn't
// exist, use Create.
//
- [Serializable]
+#if PROJECTN
+ [Internal.Runtime.CompilerServices.RelocatedTypeAttribute("System.IO.FileSystem.Primitives")]
+#endif
public enum FileMode
{
// Creates a new file. An exception is raised if the file already exists.
diff --git a/src/mscorlib/src/System/IO/FileOptions.cs b/src/mscorlib/shared/System/IO/FileOptions.cs
similarity index 81%
rename from src/mscorlib/src/System/IO/FileOptions.cs
rename to src/mscorlib/shared/System/IO/FileOptions.cs
index c01d70510ff8..d9188dd44e68 100644
--- a/src/mscorlib/src/System/IO/FileOptions.cs
+++ b/src/mscorlib/shared/System/IO/FileOptions.cs
@@ -2,19 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-** Enum: FileOptions
-**
-**
-**
-**
-** Purpose: Additional options to how to create a FileStream.
-** Exposes the more obscure CreateFile functionality.
-**
-**
-===========================================================*/
-
using System;
using System.Runtime.InteropServices;
@@ -23,8 +10,10 @@ namespace System.IO
// Maps to FILE_FLAG_DELETE_ON_CLOSE and similar values from winbase.h.
// We didn't expose a number of these values because we didn't believe
// a number of them made sense in managed code, at least not yet.
- [Serializable]
[Flags]
+#if PROJECTN
+ [Internal.Runtime.CompilerServices.RelocatedTypeAttribute("System.IO.FileSystem")]
+#endif
public enum FileOptions
{
// NOTE: any change to FileOptions enum needs to be
diff --git a/src/mscorlib/src/System/IO/FileShare.cs b/src/mscorlib/shared/System/IO/FileShare.cs
similarity index 84%
rename from src/mscorlib/src/System/IO/FileShare.cs
rename to src/mscorlib/shared/System/IO/FileShare.cs
index 812a0013bbbc..a96ae5cff7d0 100644
--- a/src/mscorlib/src/System/IO/FileShare.cs
+++ b/src/mscorlib/shared/System/IO/FileShare.cs
@@ -2,20 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-** Enum: FileShare
-**
-**
-**
-**
-** Purpose: Enum describing how to share files with other
-** processes - ie, whether two processes can simultaneously
-** read from the same file.
-**
-**
-===========================================================*/
-
using System;
namespace System.IO
@@ -27,8 +13,10 @@ namespace System.IO
// Note these values currently match the values for FILE_SHARE_READ,
// FILE_SHARE_WRITE, and FILE_SHARE_DELETE in winnt.h
//
- [Serializable]
[Flags]
+#if PROJECTN
+ [Internal.Runtime.CompilerServices.RelocatedTypeAttribute("System.IO.FileSystem.Primitives")]
+#endif
public enum FileShare
{
// No sharing. Any request to open the file (by this process or another
diff --git a/src/mscorlib/src/System/IO/PathTooLongException.cs b/src/mscorlib/shared/System/IO/PathTooLongException.cs
similarity index 68%
rename from src/mscorlib/src/System/IO/PathTooLongException.cs
rename to src/mscorlib/shared/System/IO/PathTooLongException.cs
index 156c83612b54..613af051cab7 100644
--- a/src/mscorlib/src/System/IO/PathTooLongException.cs
+++ b/src/mscorlib/shared/System/IO/PathTooLongException.cs
@@ -2,17 +2,6 @@
// 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 for paths and/or filenames that are
-** too long.
-**
-**
-===========================================================*/
using System;
using System.Runtime.Serialization;
@@ -28,19 +17,20 @@ public PathTooLongException()
HResult = __HResults.COR_E_PATHTOOLONG;
}
- public PathTooLongException(String message)
+ public PathTooLongException(string message)
: base(message)
{
HResult = __HResults.COR_E_PATHTOOLONG;
}
- public PathTooLongException(String message, Exception innerException)
+ public PathTooLongException(string message, Exception innerException)
: base(message, innerException)
{
HResult = __HResults.COR_E_PATHTOOLONG;
}
- protected PathTooLongException(SerializationInfo info, StreamingContext context) : base(info, context)
+ protected PathTooLongException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
{
}
}
diff --git a/src/mscorlib/src/System/IO/SeekOrigin.cs b/src/mscorlib/shared/System/IO/SeekOrigin.cs
similarity index 64%
rename from src/mscorlib/src/System/IO/SeekOrigin.cs
rename to src/mscorlib/shared/System/IO/SeekOrigin.cs
index efb319a2e206..3798a0ce7022 100644
--- a/src/mscorlib/src/System/IO/SeekOrigin.cs
+++ b/src/mscorlib/shared/System/IO/SeekOrigin.cs
@@ -2,26 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-** Enum: SeekOrigin
-**
-**
-**
-**
-** Purpose: Enum describing locations in a stream you could
-** seek relative to.
-**
-**
-===========================================================*/
-
-using System;
-
namespace System.IO
{
// Provides seek reference points. To seek to the end of a stream,
// call stream.Seek(0, SeekOrigin.End).
- [Serializable]
public enum SeekOrigin
{
// These constants match Win32's FILE_BEGIN, FILE_CURRENT, and FILE_END
diff --git a/src/mscorlib/src/System/MissingMethodException.cs b/src/mscorlib/shared/System/MissingMethodException.cs
similarity index 55%
rename from src/mscorlib/src/System/MissingMethodException.cs
rename to src/mscorlib/shared/System/MissingMethodException.cs
index 580ec426b4a5..07d428967b5e 100644
--- a/src/mscorlib/src/System/MissingMethodException.cs
+++ b/src/mscorlib/shared/System/MissingMethodException.cs
@@ -11,17 +11,12 @@
**
=============================================================================*/
-
-using System;
-using System.Runtime.Remoting;
using System.Runtime.Serialization;
-using System.Runtime.CompilerServices;
-using System.Globalization;
namespace System
{
[Serializable]
- public class MissingMethodException : MissingMemberException, ISerializable
+ public class MissingMethodException : MissingMemberException
{
public MissingMethodException()
: base(SR.Arg_MissingMethodException)
@@ -29,46 +24,37 @@ public MissingMethodException()
HResult = __HResults.COR_E_MISSINGMETHOD;
}
- public MissingMethodException(String message)
+ public MissingMethodException(string message)
: base(message)
{
HResult = __HResults.COR_E_MISSINGMETHOD;
}
- public MissingMethodException(String message, Exception inner)
+ public MissingMethodException(string message, Exception inner)
: base(message, inner)
{
HResult = __HResults.COR_E_MISSINGMETHOD;
}
- protected MissingMethodException(SerializationInfo info, StreamingContext context) : base(info, context)
+ public MissingMethodException(string className, string methodName)
{
+ ClassName = className;
+ MemberName = methodName;
}
- public override String Message
+ protected MissingMethodException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
{
- get
- {
- if (ClassName == null)
- {
- return base.Message;
- }
- else
- {
- // do any desired fixups to classname here.
- return SR.Format(SR.MissingMethod_Name, ClassName + "." + MemberName + (Signature != null ? " " + FormatSignature(Signature) : ""));
- }
- }
}
- public MissingMethodException(String className, String methodName)
+ public override string Message
{
- ClassName = className;
- MemberName = methodName;
+ get
+ {
+ return ClassName == null ? base.Message :
+ SR.Format(SR.MissingMethod_Name, ClassName + "." + MemberName +
+ (Signature != null ? " " + FormatSignature(Signature) : string.Empty));
+ }
}
-
- // If ClassName != null, Message will construct on the fly using it
- // and the other variables. This allows customization of the
- // format depending on the language environment.
}
}
diff --git a/src/mscorlib/src/System/ParamsArray.cs b/src/mscorlib/shared/System/ParamsArray.cs
similarity index 57%
rename from src/mscorlib/src/System/ParamsArray.cs
rename to src/mscorlib/shared/System/ParamsArray.cs
index ee28b9168bc9..1c73bc585649 100644
--- a/src/mscorlib/src/System/ParamsArray.cs
+++ b/src/mscorlib/shared/System/ParamsArray.cs
@@ -9,74 +9,74 @@ internal struct ParamsArray
// Sentinel fixed-length arrays eliminate the need for a "count" field keeping this
// struct down to just 4 fields. These are only used for their "Length" property,
// that is, their elements are never set or referenced.
- private static readonly object[] oneArgArray = new object[1];
- private static readonly object[] twoArgArray = new object[2];
- private static readonly object[] threeArgArray = new object[3];
+ private static readonly object[] s_oneArgArray = new object[1];
+ private static readonly object[] s_twoArgArray = new object[2];
+ private static readonly object[] s_threeArgArray = new object[3];
- private readonly object arg0;
- private readonly object arg1;
- private readonly object arg2;
+ private readonly object _arg0;
+ private readonly object _arg1;
+ private readonly object _arg2;
// After construction, the first three elements of this array will never be accessed
// because the indexer will retrieve those values from arg0, arg1, and arg2.
- private readonly object[] args;
+ private readonly object[] _args;
public ParamsArray(object arg0)
{
- this.arg0 = arg0;
- arg1 = null;
- arg2 = null;
+ _arg0 = arg0;
+ _arg1 = null;
+ _arg2 = null;
// Always assign this.args to make use of its "Length" property
- args = oneArgArray;
+ _args = s_oneArgArray;
}
public ParamsArray(object arg0, object arg1)
{
- this.arg0 = arg0;
- this.arg1 = arg1;
- arg2 = null;
+ _arg0 = arg0;
+ _arg1 = arg1;
+ _arg2 = null;
// Always assign this.args to make use of its "Length" property
- args = twoArgArray;
+ _args = s_twoArgArray;
}
public ParamsArray(object arg0, object arg1, object arg2)
{
- this.arg0 = arg0;
- this.arg1 = arg1;
- this.arg2 = arg2;
+ _arg0 = arg0;
+ _arg1 = arg1;
+ _arg2 = arg2;
// Always assign this.args to make use of its "Length" property
- args = threeArgArray;
+ _args = s_threeArgArray;
}
public ParamsArray(object[] args)
{
int len = args.Length;
- arg0 = len > 0 ? args[0] : null;
- arg1 = len > 1 ? args[1] : null;
- arg2 = len > 2 ? args[2] : null;
- this.args = args;
+ _arg0 = len > 0 ? args[0] : null;
+ _arg1 = len > 1 ? args[1] : null;
+ _arg2 = len > 2 ? args[2] : null;
+ _args = args;
}
public int Length
{
- get { return args.Length; }
+ get { return _args.Length; }
}
public object this[int index]
{
- get { return index == 0 ? arg0 : GetAtSlow(index); }
+ get { return index == 0 ? _arg0 : GetAtSlow(index); }
}
private object GetAtSlow(int index)
{
if (index == 1)
- return arg1;
+ return _arg1;
if (index == 2)
- return arg2;
- return args[index];
+ return _arg2;
+ return _args[index];
}
}
}
diff --git a/src/mscorlib/src/System/Progress.cs b/src/mscorlib/shared/System/Progress.cs
similarity index 98%
rename from src/mscorlib/src/System/Progress.cs
rename to src/mscorlib/shared/System/Progress.cs
index 755e7719fef5..48a6a35e75aa 100644
--- a/src/mscorlib/src/System/Progress.cs
+++ b/src/mscorlib/shared/System/Progress.cs
@@ -19,6 +19,9 @@ namespace System
/// when the instance is constructed. If there is no current SynchronizationContext
/// at the time of construction, the callbacks will be invoked on the ThreadPool.
///
+#if PROJECTN
+ [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
+#endif
public class Progress : IProgress
{
/// The synchronization context captured upon construction. This will never be null.
diff --git a/src/mscorlib/src/System/Random.cs b/src/mscorlib/shared/System/Random.cs
similarity index 91%
rename from src/mscorlib/src/System/Random.cs
rename to src/mscorlib/shared/System/Random.cs
index a81a4f4cc7fa..a66a9ea423c1 100644
--- a/src/mscorlib/src/System/Random.cs
+++ b/src/mscorlib/shared/System/Random.cs
@@ -5,7 +5,6 @@
/*============================================================
**
**
-**
** Purpose: A random number generator.
**
**
@@ -33,9 +32,9 @@ public class Random
//
// Member Variables
//
- private int inext;
- private int inextp;
- private int[] SeedArray = new int[56];
+ private int _inext;
+ private int _inextp;
+ private int[] _seedArray = new int[56];
//
// Public Constants
@@ -68,15 +67,15 @@ public Random(int Seed)
//Initialize our Seed array.
int subtraction = (Seed == Int32.MinValue) ? Int32.MaxValue : Math.Abs(Seed);
mj = MSEED - subtraction;
- SeedArray[55] = mj;
+ _seedArray[55] = mj;
mk = 1;
for (int i = 1; i < 55; i++)
{ //Apparently the range [1..55] is special (Knuth) and so we're wasting the 0'th position.
if ((ii += 21) >= 55) ii -= 55;
- SeedArray[ii] = mk;
+ _seedArray[ii] = mk;
mk = mj - mk;
if (mk < 0) mk += MBIG;
- mj = SeedArray[ii];
+ mj = _seedArray[ii];
}
for (int k = 1; k < 5; k++)
{
@@ -84,12 +83,12 @@ public Random(int Seed)
{
int n = i + 30;
if (n >= 55) n -= 55;
- SeedArray[i] -= SeedArray[1 + n];
- if (SeedArray[i] < 0) SeedArray[i] += MBIG;
+ _seedArray[i] -= _seedArray[1 + n];
+ if (_seedArray[i] < 0) _seedArray[i] += MBIG;
}
}
- inext = 0;
- inextp = 21;
+ _inext = 0;
+ _inextp = 21;
Seed = 1;
}
@@ -113,26 +112,25 @@ protected virtual double Sample()
private int InternalSample()
{
int retVal;
- int locINext = inext;
- int locINextp = inextp;
+ int locINext = _inext;
+ int locINextp = _inextp;
if (++locINext >= 56) locINext = 1;
if (++locINextp >= 56) locINextp = 1;
- retVal = SeedArray[locINext] - SeedArray[locINextp];
+ retVal = _seedArray[locINext] - _seedArray[locINextp];
if (retVal == MBIG) retVal--;
if (retVal < 0) retVal += MBIG;
- SeedArray[locINext] = retVal;
+ _seedArray[locINext] = retVal;
- inext = locINext;
- inextp = locINextp;
+ _inext = locINext;
+ _inextp = locINextp;
return retVal;
}
-
[ThreadStatic]
private static Random t_threadRandom;
private static readonly Random s_globalRandom = new Random(GenerateGlobalSeed());
@@ -161,9 +159,11 @@ private static int GenerateSeed()
**Action: Creates a number to use as global seed.
**Returns: An integer that is safe to use as seed values for thread-local seed generators.
==========================================================================================*/
- private static int GenerateGlobalSeed()
+ private static unsafe int GenerateGlobalSeed()
{
- return Guid.NewGuid().GetHashCode();
+ int result;
+ Interop.GetRandomBytes((byte*)&result, sizeof(int));
+ return result;
}
//
@@ -258,7 +258,7 @@ public virtual double NextDouble()
/*==================================NextBytes===================================
**Action: Fills the byte array with random bytes [0..0x7f]. The entire array is filled.
**Returns:Void
- **Arugments: buffer -- the array to be filled.
+ **Arguments: buffer -- the array to be filled.
**Exceptions: None
==============================================================================*/
public virtual void NextBytes(byte[] buffer)
diff --git a/src/mscorlib/src/System/Resources/IResourceReader.cs b/src/mscorlib/shared/System/Resources/IResourceReader.cs
similarity index 97%
rename from src/mscorlib/src/System/Resources/IResourceReader.cs
rename to src/mscorlib/shared/System/Resources/IResourceReader.cs
index f18e5baa8d2d..543a5a67de8a 100644
--- a/src/mscorlib/src/System/Resources/IResourceReader.cs
+++ b/src/mscorlib/shared/System/Resources/IResourceReader.cs
@@ -14,7 +14,6 @@
===========================================================*/
using System;
-using System.IO;
using System.Collections;
namespace System.Resources
@@ -26,7 +25,6 @@ public interface IResourceReader : IEnumerable, IDisposable
// This could close a network connection, a file, or do nothing.
void Close();
-
new IDictionaryEnumerator GetEnumerator();
}
}
diff --git a/src/mscorlib/src/System/Resources/MissingManifestResourceException.cs b/src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs
similarity index 70%
rename from src/mscorlib/src/System/Resources/MissingManifestResourceException.cs
rename to src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs
index c2a55cd7036d..5ab2e1303ecc 100644
--- a/src/mscorlib/src/System/Resources/MissingManifestResourceException.cs
+++ b/src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs
@@ -2,22 +2,14 @@
// 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 for a missing assembly-level resource
-**
-**
-===========================================================*/
-
using System;
using System.Runtime.Serialization;
namespace System.Resources
{
+#if PROJECTN
+ [Internal.Runtime.CompilerServices.RelocatedType("System.Resources.ResourceManager")]
+#endif
[Serializable]
public class MissingManifestResourceException : SystemException
{
@@ -27,19 +19,20 @@ public MissingManifestResourceException()
HResult = System.__HResults.COR_E_MISSINGMANIFESTRESOURCE;
}
- public MissingManifestResourceException(String message)
+ public MissingManifestResourceException(string message)
: base(message)
{
HResult = System.__HResults.COR_E_MISSINGMANIFESTRESOURCE;
}
- public MissingManifestResourceException(String message, Exception inner)
+ public MissingManifestResourceException(string message, Exception inner)
: base(message, inner)
{
HResult = System.__HResults.COR_E_MISSINGMANIFESTRESOURCE;
}
- protected MissingManifestResourceException(SerializationInfo info, StreamingContext context) : base(info, context)
+ protected MissingManifestResourceException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
{
}
}
diff --git a/src/mscorlib/src/System/Resources/MissingSatelliteAssemblyException.cs b/src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs
similarity index 85%
rename from src/mscorlib/src/System/Resources/MissingSatelliteAssemblyException.cs
rename to src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs
index df94f9e65396..b343e0cfbc46 100644
--- a/src/mscorlib/src/System/Resources/MissingSatelliteAssemblyException.cs
+++ b/src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs
@@ -31,26 +31,27 @@ public MissingSatelliteAssemblyException()
HResult = System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY;
}
- public MissingSatelliteAssemblyException(String message)
+ public MissingSatelliteAssemblyException(string message)
: base(message)
{
HResult = System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY;
}
- public MissingSatelliteAssemblyException(String message, String cultureName)
+ public MissingSatelliteAssemblyException(string message, String cultureName)
: base(message)
{
HResult = System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY;
_cultureName = cultureName;
}
- public MissingSatelliteAssemblyException(String message, Exception inner)
+ public MissingSatelliteAssemblyException(string message, Exception inner)
: base(message, inner)
{
HResult = System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY;
}
- protected MissingSatelliteAssemblyException(SerializationInfo info, StreamingContext context) : base(info, context)
+ protected MissingSatelliteAssemblyException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
{
}
diff --git a/src/mscorlib/shared/System/Resources/NeutralResourcesLanguageAttribute.cs b/src/mscorlib/shared/System/Resources/NeutralResourcesLanguageAttribute.cs
new file mode 100644
index 000000000000..3248b849a0f5
--- /dev/null
+++ b/src/mscorlib/shared/System/Resources/NeutralResourcesLanguageAttribute.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.Resources
+{
+#if PROJECTN
+ [Internal.Runtime.CompilerServices.RelocatedType("System.Resources.ResourceManager")]
+#endif
+ [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
+ public sealed class NeutralResourcesLanguageAttribute : Attribute
+ {
+ public NeutralResourcesLanguageAttribute(string cultureName)
+ {
+ if (cultureName == null)
+ throw new ArgumentNullException(nameof(cultureName));
+
+ CultureName = cultureName;
+ Location = UltimateResourceFallbackLocation.MainAssembly;
+ }
+
+ public NeutralResourcesLanguageAttribute(string cultureName, UltimateResourceFallbackLocation location)
+ {
+ if (cultureName == null)
+ throw new ArgumentNullException(nameof(cultureName));
+ if (!Enum.IsDefined(typeof(UltimateResourceFallbackLocation), location))
+ throw new ArgumentException(SR.Format(SR.Arg_InvalidNeutralResourcesLanguage_FallbackLoc, location));
+
+ CultureName = cultureName;
+ Location = location;
+ }
+
+ public string CultureName { get; }
+ public UltimateResourceFallbackLocation Location { get; }
+ }
+}
diff --git a/src/mscorlib/src/System/Resources/ResourceTypeCode.cs b/src/mscorlib/shared/System/Resources/ResourceTypeCode.cs
similarity index 98%
rename from src/mscorlib/src/System/Resources/ResourceTypeCode.cs
rename to src/mscorlib/shared/System/Resources/ResourceTypeCode.cs
index f9a846124aae..b0ceb61df40f 100644
--- a/src/mscorlib/src/System/Resources/ResourceTypeCode.cs
+++ b/src/mscorlib/shared/System/Resources/ResourceTypeCode.cs
@@ -24,7 +24,6 @@ what type an object is.
Note this data must be included in any documentation describing the
internals of .resources files.
*/
- [Serializable]
internal enum ResourceTypeCode
{
// Primitives
diff --git a/src/mscorlib/src/System/Resources/SatelliteContractVersionAttribute.cs b/src/mscorlib/shared/System/Resources/SatelliteContractVersionAttribute.cs
similarity index 77%
rename from src/mscorlib/src/System/Resources/SatelliteContractVersionAttribute.cs
rename to src/mscorlib/shared/System/Resources/SatelliteContractVersionAttribute.cs
index 4f1885e8eb2c..890bb7f67c68 100644
--- a/src/mscorlib/src/System/Resources/SatelliteContractVersionAttribute.cs
+++ b/src/mscorlib/shared/System/Resources/SatelliteContractVersionAttribute.cs
@@ -14,27 +14,21 @@
**
===========================================================*/
-using System;
-using System.Diagnostics.Contracts;
-
namespace System.Resources
{
+#if PROJECTN
+ [Internal.Runtime.CompilerServices.RelocatedType("System.Resources.ResourceManager")]
+#endif
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public sealed class SatelliteContractVersionAttribute : Attribute
{
- private String _version;
-
public SatelliteContractVersionAttribute(String version)
{
if (version == null)
throw new ArgumentNullException(nameof(version));
- Contract.EndContractBlock();
- _version = version;
+ Version = version;
}
- public String Version
- {
- get { return _version; }
- }
+ public String Version { get; }
}
}
diff --git a/src/mscorlib/src/System/Resources/UltimateResourceFallbackLocation.cs b/src/mscorlib/shared/System/Resources/UltimateResourceFallbackLocation.cs
similarity index 95%
rename from src/mscorlib/src/System/Resources/UltimateResourceFallbackLocation.cs
rename to src/mscorlib/shared/System/Resources/UltimateResourceFallbackLocation.cs
index 43f9b884855d..83640ec9fe5a 100644
--- a/src/mscorlib/src/System/Resources/UltimateResourceFallbackLocation.cs
+++ b/src/mscorlib/shared/System/Resources/UltimateResourceFallbackLocation.cs
@@ -4,10 +4,8 @@
/*============================================================
**
-**
-**
**
-**
+**
**
** Purpose: Tells the ResourceManager where to find the
** ultimate fallback resources for your assembly.
@@ -19,7 +17,6 @@
namespace System.Resources
{
- [Serializable]
public enum UltimateResourceFallbackLocation
{
MainAssembly,
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/AccessedThroughPropertyAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/AccessedThroughPropertyAttribute.cs
similarity index 53%
rename from src/mscorlib/src/System/Runtime/CompilerServices/AccessedThroughPropertyAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/AccessedThroughPropertyAttribute.cs
index fa6003df1fbf..25efcafa3fd8 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/AccessedThroughPropertyAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/AccessedThroughPropertyAttribute.cs
@@ -2,30 +2,16 @@
// 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
{
[AttributeUsage(AttributeTargets.Field)]
public sealed class AccessedThroughPropertyAttribute : Attribute
{
- private readonly string propertyName;
-
public AccessedThroughPropertyAttribute(string propertyName)
{
- this.propertyName = propertyName;
+ PropertyName = propertyName;
}
- public string PropertyName
- {
- get
- {
- return propertyName;
- }
- }
+ public string PropertyName { get; }
}
}
-
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs
similarity index 79%
rename from src/mscorlib/src/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs
index f1fc9ced8245..198ed3d0e760 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs
@@ -2,12 +2,10 @@
// 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
{
- [Serializable, AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
+ [Serializable]
+ [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public sealed class AsyncStateMachineAttribute : StateMachineAttribute
{
public AsyncStateMachineAttribute(Type stateMachineType)
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/CallerFilePathAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/CallerFilePathAttribute.cs
similarity index 96%
rename from src/mscorlib/src/System/Runtime/CompilerServices/CallerFilePathAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/CallerFilePathAttribute.cs
index 330934cf95b2..5858634b4274 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/CallerFilePathAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/CallerFilePathAttribute.cs
@@ -2,9 +2,6 @@
// 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
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/CallerLineNumberAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/CallerLineNumberAttribute.cs
similarity index 96%
rename from src/mscorlib/src/System/Runtime/CompilerServices/CallerLineNumberAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/CallerLineNumberAttribute.cs
index 9c87e8e25f3f..5bd2fcb91b94 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/CallerLineNumberAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/CallerLineNumberAttribute.cs
@@ -2,9 +2,6 @@
// 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
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs
similarity index 96%
rename from src/mscorlib/src/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs
index 4fc70908fbb1..8b046335b5a4 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs
@@ -2,9 +2,6 @@
// 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
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs
similarity index 73%
rename from src/mscorlib/src/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs
index 31e9ade0bfdb..3da2a95aebd1 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs
@@ -2,9 +2,6 @@
// 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
{
[Serializable]
@@ -14,4 +11,3 @@ public sealed class CompilerGeneratedAttribute : Attribute
public CompilerGeneratedAttribute() { }
}
}
-
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/DisablePrivateReflectionAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/DisablePrivateReflectionAttribute.cs
similarity index 72%
rename from src/mscorlib/src/System/Runtime/CompilerServices/DisablePrivateReflectionAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/DisablePrivateReflectionAttribute.cs
index 9427e3d20829..4fc00e10edeb 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/DisablePrivateReflectionAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/DisablePrivateReflectionAttribute.cs
@@ -2,11 +2,6 @@
// 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
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)]
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/FixedBufferAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/FixedBufferAttribute.cs
similarity index 69%
rename from src/mscorlib/src/System/Runtime/CompilerServices/FixedBufferAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/FixedBufferAttribute.cs
index e4008b86f03d..bb8f00f68635 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/FixedBufferAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/FixedBufferAttribute.cs
@@ -20,29 +20,13 @@ namespace System.Runtime.CompilerServices
[AttributeUsage(AttributeTargets.Field, Inherited = false)]
public sealed class FixedBufferAttribute : Attribute
{
- private Type elementType;
- private int length;
-
public FixedBufferAttribute(Type elementType, int length)
{
- this.elementType = elementType;
- this.length = length;
- }
-
- public Type ElementType
- {
- get
- {
- return elementType;
- }
+ ElementType = elementType;
+ Length = length;
}
- public int Length
- {
- get
- {
- return length;
- }
- }
+ public Type ElementType { get; }
+ public int Length { get; }
}
}
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/IAsyncStateMachine.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/IAsyncStateMachine.cs
similarity index 100%
rename from src/mscorlib/src/System/Runtime/CompilerServices/IAsyncStateMachine.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/IAsyncStateMachine.cs
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/INotifyCompletion.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/INotifyCompletion.cs
similarity index 100%
rename from src/mscorlib/src/System/Runtime/CompilerServices/INotifyCompletion.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/INotifyCompletion.cs
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/IndexerNameAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/IndexerNameAttribute.cs
similarity index 94%
rename from src/mscorlib/src/System/Runtime/CompilerServices/IndexerNameAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/IndexerNameAttribute.cs
index cc8cb59ffed4..65653a44d97c 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/IndexerNameAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/IndexerNameAttribute.cs
@@ -2,8 +2,6 @@
// 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
{
[Serializable]
@@ -11,6 +9,7 @@ namespace System.Runtime.CompilerServices
public sealed class IndexerNameAttribute : Attribute
{
public IndexerNameAttribute(String indexerName)
- { }
+ {
+ }
}
}
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs
similarity index 79%
rename from src/mscorlib/src/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs
index 4bb9b4eb8f4c..5ac3918028c3 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs
@@ -2,12 +2,10 @@
// 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
{
- [Serializable, AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
+ [Serializable]
+ [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public sealed class IteratorStateMachineAttribute : StateMachineAttribute
{
public IteratorStateMachineAttribute(Type stateMachineType)
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs
similarity index 80%
rename from src/mscorlib/src/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs
index a007e382a80c..6e307e72af15 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs
@@ -13,28 +13,21 @@
**
============================================================*/
-using System;
-
namespace System.Runtime.CompilerServices
{
[Serializable]
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public sealed class ReferenceAssemblyAttribute : Attribute
{
- private String _description; // Maybe ".NET FX v4.0 SP1, partial trust"?
-
public ReferenceAssemblyAttribute()
{
}
public ReferenceAssemblyAttribute(String description)
{
- _description = description;
+ Description = description;
}
- public String Description
- {
- get { return _description; }
- }
+ public String Description { get; }
}
}
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs
similarity index 63%
rename from src/mscorlib/src/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs
index 42b2e519b1d7..55dba0d113bb 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs
@@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
/*=============================================================================
**
**
@@ -13,40 +11,21 @@
**
=============================================================================*/
-
-using System;
-
namespace System.Runtime.CompilerServices
{
[Serializable]
[AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)]
public sealed class RuntimeCompatibilityAttribute : Attribute
{
- // fields
- private bool m_wrapNonExceptionThrows;
-
- // constructors
public RuntimeCompatibilityAttribute()
{
- // legacy behavior is the default, and m_wrapNonExceptionThrows is implicitly
+ // legacy behavior is the default, and WrapNonExceptionThrows is implicitly
// false thanks to the CLR's guarantee of zeroed memory.
}
- // properties
-
// If a non-CLSCompliant exception (i.e. one that doesn't derive from System.Exception) is
// thrown, should it be wrapped up in a System.Runtime.CompilerServices.RuntimeWrappedException
// instance when presented to catch handlers?
- public bool WrapNonExceptionThrows
- {
- get
- {
- return m_wrapNonExceptionThrows;
- }
- set
- {
- m_wrapNonExceptionThrows = value;
- }
- }
+ public bool WrapNonExceptionThrows { get; set; }
}
}
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/StateMachineAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/StateMachineAttribute.cs
similarity index 65%
rename from src/mscorlib/src/System/Runtime/CompilerServices/StateMachineAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/StateMachineAttribute.cs
index 7c84009e1f2c..94ed5b5c749e 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/StateMachineAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/StateMachineAttribute.cs
@@ -2,19 +2,19 @@
// 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
{
- [Serializable, AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
+ [Serializable]
+ [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public class StateMachineAttribute : Attribute
{
- public Type StateMachineType { get; private set; }
-
public StateMachineAttribute(Type stateMachineType)
{
- this.StateMachineType = stateMachineType;
+ StateMachineType = stateMachineType;
}
+
+ public Type StateMachineType { get; }
}
}
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedFromAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/TypeForwardedFromAttribute.cs
similarity index 54%
rename from src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedFromAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/TypeForwardedFromAttribute.cs
index 47ce32fdeb38..c4a855824388 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedFromAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/TypeForwardedFromAttribute.cs
@@ -2,35 +2,16 @@
// 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
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false, AllowMultiple = false)]
public sealed class TypeForwardedFromAttribute : Attribute
{
- private string assemblyFullName;
-
- private TypeForwardedFromAttribute()
- {
- // Disallow default constructor
- }
-
-
public TypeForwardedFromAttribute(string assemblyFullName)
{
- if (String.IsNullOrEmpty(assemblyFullName))
- {
- throw new ArgumentNullException(nameof(assemblyFullName));
- }
- this.assemblyFullName = assemblyFullName;
+ AssemblyFullName = assemblyFullName;
}
- public string AssemblyFullName
- {
- get
- {
- return assemblyFullName;
- }
- }
+ public string AssemblyFullName { get; }
}
}
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedToAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/TypeForwardedToAttribute.cs
similarity index 65%
rename from src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedToAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/TypeForwardedToAttribute.cs
index dca96c53b23d..85d5c030c19b 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedToAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/TypeForwardedToAttribute.cs
@@ -2,32 +2,16 @@
// 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.Reflection;
-
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)]
public sealed class TypeForwardedToAttribute : Attribute
{
- private Type _destination;
-
public TypeForwardedToAttribute(Type destination)
{
- _destination = destination;
+ Destination = destination;
}
- public Type Destination
- {
- get
- {
- return _destination;
- }
- }
+ public Type Destination { get; }
}
}
-
-
-
-
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs
similarity index 96%
rename from src/mscorlib/src/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs
rename to src/mscorlib/shared/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs
index df71e7e10c77..162676efe8ec 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs
@@ -2,8 +2,6 @@
// 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
{
[Serializable]
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/CallingConvention.cs b/src/mscorlib/shared/System/Runtime/InteropServices/CallingConvention.cs
similarity index 68%
rename from src/mscorlib/src/System/Runtime/InteropServices/CallingConvention.cs
rename to src/mscorlib/shared/System/Runtime/InteropServices/CallingConvention.cs
index a4c12c14249f..3b18fdee3a8b 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/CallingConvention.cs
+++ b/src/mscorlib/shared/System/Runtime/InteropServices/CallingConvention.cs
@@ -2,15 +2,9 @@
// 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.InteropServices
{
- // Used for the CallingConvention named argument to the DllImport attribute
- [Serializable]
+ // Used for the CallingConvention named argument to the DllImport and NativeCallable attribute
public enum CallingConvention
{
Winapi = 1,
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/CharSet.cs b/src/mscorlib/shared/System/Runtime/InteropServices/CharSet.cs
similarity index 70%
rename from src/mscorlib/src/System/Runtime/InteropServices/CharSet.cs
rename to src/mscorlib/shared/System/Runtime/InteropServices/CharSet.cs
index 426296c5c004..d587ec006bbb 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/CharSet.cs
+++ b/src/mscorlib/shared/System/Runtime/InteropServices/CharSet.cs
@@ -2,25 +2,20 @@
// 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.InteropServices
{
- // Use this in P/Direct function prototypes to specify
+ // Use this in P/Invoke function prototypes to specify
// which character set to use when marshalling Strings.
// Using Ansi will marshal the strings as 1 byte char*'s.
// Using Unicode will marshal the strings as 2 byte wchar*'s.
// Generally you probably want to use Auto, which does the
// right thing 99% of the time.
- [Serializable]
+
public enum CharSet
{
None = 1, // User didn't specify how to marshal strings.
Ansi = 2, // Strings should be marshalled as ANSI 1 byte chars.
- Unicode = 3, // Strings should be marshalled as Unicode 2 byte chars.
+ Unicode = 3, // Strings should be marshalled as Unicode 2 byte chars.
Auto = 4, // Marshal Strings in the right way for the target system.
}
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ExternalException.cs b/src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs
similarity index 73%
rename from src/mscorlib/src/System/Runtime/InteropServices/ExternalException.cs
rename to src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs
index bd6b2f81b674..d7bde79c4301 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/ExternalException.cs
+++ b/src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs
@@ -12,7 +12,6 @@
**
=============================================================================*/
-
using System;
using System.Globalization;
using System.Runtime.Serialization;
@@ -31,25 +30,26 @@ public ExternalException()
HResult = __HResults.E_FAIL;
}
- public ExternalException(String message)
+ public ExternalException(string message)
: base(message)
{
HResult = __HResults.E_FAIL;
}
- public ExternalException(String message, Exception inner)
+ public ExternalException(string message, Exception inner)
: base(message, inner)
{
HResult = __HResults.E_FAIL;
}
- public ExternalException(String message, int errorCode)
+ public ExternalException(string message, int errorCode)
: base(message)
{
HResult = errorCode;
}
- protected ExternalException(SerializationInfo info, StreamingContext context) : base(info, context)
+ protected ExternalException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
{
}
@@ -61,26 +61,25 @@ public virtual int ErrorCode
}
}
- public override String ToString()
+ public override string ToString()
{
- String message = Message;
- String s;
- String _className = GetType().ToString();
- s = _className + " (0x" + HResult.ToString("X8", CultureInfo.InvariantCulture) + ")";
+ string message = Message;
+ string className = GetType().ToString();
+
+ string s = className + " (0x" + HResult.ToString("X8", CultureInfo.InvariantCulture) + ")";
if (!(String.IsNullOrEmpty(message)))
{
s = s + ": " + message;
}
- Exception _innerException = InnerException;
+ Exception innerException = InnerException;
- if (_innerException != null)
+ if (innerException != null)
{
- s = s + " ---> " + _innerException.ToString();
+ s = s + " ---> " + innerException.ToString();
}
-
if (StackTrace != null)
s += Environment.NewLine + StackTrace;
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/LayoutKind.cs b/src/mscorlib/shared/System/Runtime/InteropServices/LayoutKind.cs
similarity index 52%
rename from src/mscorlib/src/System/Runtime/InteropServices/LayoutKind.cs
rename to src/mscorlib/shared/System/Runtime/InteropServices/LayoutKind.cs
index 7a170d421373..dbd7ec62d546 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/LayoutKind.cs
+++ b/src/mscorlib/shared/System/Runtime/InteropServices/LayoutKind.cs
@@ -2,19 +2,13 @@
// 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.InteropServices
{
// Used in the StructLayoutAttribute class
- [Serializable]
public enum LayoutKind
{
- Sequential = 0, // 0x00000008,
- Explicit = 2, // 0x00000010,
- Auto = 3, // 0x00000000,
+ Sequential = 0,
+ Explicit = 2,
+ Auto = 3,
}
}
diff --git a/src/mscorlib/shared/System/Runtime/Serialization/IFormatterConverter.cs b/src/mscorlib/shared/System/Runtime/Serialization/IFormatterConverter.cs
new file mode 100644
index 000000000000..c173144854c0
--- /dev/null
+++ b/src/mscorlib/shared/System/Runtime/Serialization/IFormatterConverter.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.
+
+namespace System.Runtime.Serialization
+{
+ [CLSCompliant(false)]
+ public interface IFormatterConverter
+ {
+ object Convert(object value, Type type);
+ object Convert(object value, TypeCode typeCode);
+ bool ToBoolean(object value);
+ char ToChar(object value);
+ sbyte ToSByte(object value);
+ byte ToByte(object value);
+ short ToInt16(object value);
+ ushort ToUInt16(object value);
+ int ToInt32(object value);
+ uint ToUInt32(object value);
+ long ToInt64(object value);
+ ulong ToUInt64(object value);
+ float ToSingle(object value);
+ double ToDouble(object value);
+ decimal ToDecimal(object value);
+ DateTime ToDateTime(object value);
+ string ToString(object value);
+ }
+}
diff --git a/src/mscorlib/shared/System/Runtime/Serialization/IObjectReference.cs b/src/mscorlib/shared/System/Runtime/Serialization/IObjectReference.cs
new file mode 100644
index 000000000000..d41bc50dde4e
--- /dev/null
+++ b/src/mscorlib/shared/System/Runtime/Serialization/IObjectReference.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.Runtime.Serialization
+{
+ public interface IObjectReference
+ {
+ object GetRealObject(StreamingContext context);
+ }
+}
diff --git a/src/mscorlib/shared/System/Runtime/Serialization/ISerializable.cs b/src/mscorlib/shared/System/Runtime/Serialization/ISerializable.cs
new file mode 100644
index 000000000000..383b3f07af35
--- /dev/null
+++ b/src/mscorlib/shared/System/Runtime/Serialization/ISerializable.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.Runtime.Serialization
+{
+ public interface ISerializable
+ {
+ void GetObjectData(SerializationInfo info, StreamingContext context);
+ }
+}
diff --git a/src/mscorlib/src/System/Runtime/Versioning/TargetFrameworkAttribute.cs b/src/mscorlib/shared/System/Runtime/Versioning/TargetFrameworkAttribute.cs
similarity index 99%
rename from src/mscorlib/src/System/Runtime/Versioning/TargetFrameworkAttribute.cs
rename to src/mscorlib/shared/System/Runtime/Versioning/TargetFrameworkAttribute.cs
index 59fc15aa37ac..54ccdf2c8154 100644
--- a/src/mscorlib/src/System/Runtime/Versioning/TargetFrameworkAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/Versioning/TargetFrameworkAttribute.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-//
/*============================================================
**
**
diff --git a/src/mscorlib/src/System/Security/SafeBSTRHandle.cs b/src/mscorlib/shared/System/Security/SafeBSTRHandle.cs
similarity index 100%
rename from src/mscorlib/src/System/Security/SafeBSTRHandle.cs
rename to src/mscorlib/shared/System/Security/SafeBSTRHandle.cs
diff --git a/src/mscorlib/src/System/Security/VerificationException.cs b/src/mscorlib/shared/System/Security/VerificationException.cs
similarity index 80%
rename from src/mscorlib/src/System/Security/VerificationException.cs
rename to src/mscorlib/shared/System/Security/VerificationException.cs
index 0cea0ecc055d..9641e1aa465a 100644
--- a/src/mscorlib/src/System/Security/VerificationException.cs
+++ b/src/mscorlib/shared/System/Security/VerificationException.cs
@@ -2,10 +2,6 @@
// 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.Security;
-using System;
using System.Runtime.Serialization;
namespace System.Security
@@ -19,19 +15,20 @@ public VerificationException()
HResult = __HResults.COR_E_VERIFICATION;
}
- public VerificationException(String message)
+ public VerificationException(string message)
: base(message)
{
HResult = __HResults.COR_E_VERIFICATION;
}
- public VerificationException(String message, Exception innerException)
+ public VerificationException(string message, Exception innerException)
: base(message, innerException)
{
HResult = __HResults.COR_E_VERIFICATION;
}
- protected VerificationException(SerializationInfo info, StreamingContext context) : base(info, context)
+ protected VerificationException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
{
}
}
diff --git a/src/mscorlib/src/System/ValueTuple.cs b/src/mscorlib/shared/System/ValueTuple.cs
similarity index 99%
rename from src/mscorlib/src/System/ValueTuple.cs
rename to src/mscorlib/shared/System/ValueTuple.cs
index abe119a83701..e0cd02e9144e 100644
--- a/src/mscorlib/src/System/ValueTuple.cs
+++ b/src/mscorlib/shared/System/ValueTuple.cs
@@ -535,7 +535,7 @@ public bool Equals(ValueTuple other)
///
/// The implementation is called only if other is not ,
/// and if it can be successfully cast (in C#) or converted (in Visual Basic) to a
- /// whose components are of the same types as those of the current instance. The IStructuralEquatable.Equals(Object, IEqualityComparer) method
+ /// whose components are of the same types as those of the current instance. The IStructuralEquatable.Equals(Object, IEqualityComparer) method
/// first passes the values of the objects to be compared to the
/// implementation. If this method call returns , the method is
/// called again and passed the values of the two instances.
@@ -2117,12 +2117,12 @@ public override int GetHashCode()
if (rest == null)
{
return ValueTuple.CombineHashCodes(Item1?.GetHashCode() ?? 0,
- Item2?.GetHashCode() ?? 0,
- Item3?.GetHashCode() ?? 0,
- Item4?.GetHashCode() ?? 0,
- Item5?.GetHashCode() ?? 0,
- Item6?.GetHashCode() ?? 0,
- Item7?.GetHashCode() ?? 0);
+ Item2?.GetHashCode() ?? 0,
+ Item3?.GetHashCode() ?? 0,
+ Item4?.GetHashCode() ?? 0,
+ Item5?.GetHashCode() ?? 0,
+ Item6?.GetHashCode() ?? 0,
+ Item7?.GetHashCode() ?? 0);
}
int size = rest.Length;
diff --git a/src/mscorlib/src/System/Version.cs b/src/mscorlib/shared/System/Version.cs
similarity index 97%
rename from src/mscorlib/src/System/Version.cs
rename to src/mscorlib/shared/System/Version.cs
index 9c31786fef18..54b2052ddb89 100644
--- a/src/mscorlib/src/System/Version.cs
+++ b/src/mscorlib/shared/System/Version.cs
@@ -2,23 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-**
-**
-** Purpose:
-**
-**
-===========================================================*/
+using System.Globalization;
+using System.Diagnostics;
+using System.Diagnostics.Contracts;
+using System.Text;
namespace System
{
- using System.Diagnostics;
- using System.Diagnostics.Contracts;
- using System.Text;
- using CultureInfo = System.Globalization.CultureInfo;
- using NumberStyles = System.Globalization.NumberStyles;
-
// A Version object contains four hierarchical numeric components: major, minor,
// build and revision. Build and revision may be unspecified, which is represented
// internally as a -1. By definition, an unspecified component matches anything
@@ -112,6 +102,11 @@ private Version(Version version)
_Revision = version._Revision;
}
+ public object Clone()
+ {
+ return new Version(this);
+ }
+
// Properties for setting and getting version numbers
public int Major
{
@@ -143,11 +138,6 @@ public short MinorRevision
get { return (short)(_Revision & 0xFFFF); }
}
- public Object Clone()
- {
- return new Version(this);
- }
-
public int CompareTo(Object version)
{
if (version == null)
diff --git a/src/mscorlib/src/System/Diagnostics/CodeAnalysis/SuppressMessageAttribute.cs b/src/mscorlib/src/System/Diagnostics/CodeAnalysis/SuppressMessageAttribute.cs
deleted file mode 100644
index 59125dd07415..000000000000
--- a/src/mscorlib/src/System/Diagnostics/CodeAnalysis/SuppressMessageAttribute.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-// 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.
-
-/*============================================================
-**
-**
-**
-** An attribute to suppress violation messages/warnings
-** by static code analysis tools.
-**
-**
-===========================================================*/
-
-using System;
-
-namespace System.Diagnostics.CodeAnalysis
-{
- [AttributeUsage(
- AttributeTargets.All,
- Inherited = false,
- AllowMultiple = true
- )
- ]
- [Conditional("CODE_ANALYSIS")]
- public sealed class SuppressMessageAttribute : Attribute
- {
- private string category;
- private string justification;
- private string checkId;
- private string scope;
- private string target;
- private string messageId;
-
- public SuppressMessageAttribute(string category, string checkId)
- {
- this.category = category;
- this.checkId = checkId;
- }
-
- public string Category
- {
- get { return category; }
- }
-
- public string CheckId
- {
- get { return checkId; }
- }
-
- public string Scope
- {
- get { return scope; }
- set { scope = value; }
- }
-
- public string Target
- {
- get { return target; }
- set { target = value; }
- }
-
- public string MessageId
- {
- get { return messageId; }
- set { messageId = value; }
- }
-
- public string Justification
- {
- get { return justification; }
- set { justification = value; }
- }
- }
-}
diff --git a/src/mscorlib/src/System/ICloneable.cs b/src/mscorlib/src/System/ICloneable.cs
deleted file mode 100644
index d50ba3beee5a..000000000000
--- a/src/mscorlib/src/System/ICloneable.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// 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.
-
-/*============================================================
-**
-**
-** This interface is implemented by classes that support cloning.
-**
-===========================================================*/
-
-using System;
-
-namespace System
-{
- // Defines an interface indicating that an object may be cloned. Only objects
- // that implement ICloneable may be cloned. The interface defines a single
- // method which is called to create a clone of the object. Object defines a method
- // MemberwiseClone to support default clone operations.
- //
- public interface ICloneable
- {
- // Interface does not need to be marked with the serializable attribute
- // Make a new object which is a copy of the object instanced. This object may be either
- // deep copy or a shallow copy depending on the implementation of clone. The default
- // Object support for clone does a shallow copy.
- //
- Object Clone();
- }
-}
diff --git a/src/mscorlib/src/System/Resources/NeutralResourcesLanguageAttribute.cs b/src/mscorlib/src/System/Resources/NeutralResourcesLanguageAttribute.cs
deleted file mode 100644
index d124389b0295..000000000000
--- a/src/mscorlib/src/System/Resources/NeutralResourcesLanguageAttribute.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-// 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: Tells the ResourceManager what language your main
-** assembly's resources are written in. The
-** ResourceManager won't try loading a satellite
-** assembly for that culture, which helps perf.
-**
-**
-** NOTE:
-**
-** This custom attribute is no longer implemented in managed code. As part of a perf optimization,
-** it is now read in Module::GetNeutralResourcesLanguage, accessed from ManifestBasedResourceGroveler
-** through an internal runtime call.
-===========================================================*/
-
-using System;
-using System.Diagnostics.Contracts;
-
-namespace System.Resources
-{
- [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
- public sealed class NeutralResourcesLanguageAttribute : Attribute
- {
- private String _culture;
- private UltimateResourceFallbackLocation _fallbackLoc;
-
- public NeutralResourcesLanguageAttribute(String cultureName)
- {
- if (cultureName == null)
- throw new ArgumentNullException(nameof(cultureName));
- Contract.EndContractBlock();
-
- _culture = cultureName;
- _fallbackLoc = UltimateResourceFallbackLocation.MainAssembly;
- }
-
- public NeutralResourcesLanguageAttribute(String cultureName, UltimateResourceFallbackLocation location)
- {
- if (cultureName == null)
- throw new ArgumentNullException(nameof(cultureName));
- if (!Enum.IsDefined(typeof(UltimateResourceFallbackLocation), location))
- throw new ArgumentException(SR.Format(SR.Arg_InvalidNeutralResourcesLanguage_FallbackLoc, location));
- Contract.EndContractBlock();
-
- _culture = cultureName;
- _fallbackLoc = location;
- }
-
- public String CultureName
- {
- get { return _culture; }
- }
-
- public UltimateResourceFallbackLocation Location
- {
- get { return _fallbackLoc; }
- }
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/IFormatterConverter.cs b/src/mscorlib/src/System/Runtime/Serialization/IFormatterConverter.cs
deleted file mode 100644
index 1f6f682ee230..000000000000
--- a/src/mscorlib/src/System/Runtime/Serialization/IFormatterConverter.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// 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 interface provides the connection between an
-** instance of SerializationInfo and the formatter-provided
-** class which knows how to parse the data inside the
-** SerializationInfo.
-**
-**
-============================================================*/
-
-using System;
-
-namespace System.Runtime.Serialization
-{
- [CLSCompliant(false)]
- public interface IFormatterConverter
- {
- Object Convert(Object value, Type type);
- Object Convert(Object value, TypeCode typeCode);
- bool ToBoolean(Object value);
- char ToChar(Object value);
- sbyte ToSByte(Object value);
- byte ToByte(Object value);
- short ToInt16(Object value);
- ushort ToUInt16(Object value);
- int ToInt32(Object value);
- uint ToUInt32(Object value);
- long ToInt64(Object value);
- ulong ToUInt64(Object value);
- float ToSingle(Object value);
- double ToDouble(Object value);
- Decimal ToDecimal(Object value);
- DateTime ToDateTime(Object value);
- String ToString(Object value);
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/IObjectReference.cs b/src/mscorlib/src/System/Runtime/Serialization/IObjectReference.cs
deleted file mode 100644
index b07f26fe0961..000000000000
--- a/src/mscorlib/src/System/Runtime/Serialization/IObjectReference.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// 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: IObjectReference
-**
-**
-** Purpose: Implemented by objects that are actually references
-** to a different object which can't be discovered until
-** this one is completely restored. During the fixup stage,
-** any object implementing IObjectReference is asked for it's
-** "real" object and that object is inserted into the graph.
-**
-**
-===========================================================*/
-
-using System;
-
-namespace System.Runtime.Serialization
-{
- // Interface does not need to be marked with the serializable attribute
- public interface IObjectReference
- {
- Object GetRealObject(StreamingContext context);
- }
-}
-
-
diff --git a/src/mscorlib/src/System/Runtime/Serialization/ISerializable.cs b/src/mscorlib/src/System/Runtime/Serialization/ISerializable.cs
deleted file mode 100644
index 4e5873b81754..000000000000
--- a/src/mscorlib/src/System/Runtime/Serialization/ISerializable.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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: ISerializable
-**
-**
-** Purpose: Implemented by any object that needs to control its
-** own serialization.
-**
-**
-===========================================================*/
-
-using System.Runtime.Remoting;
-using System.Runtime.Serialization;
-using System;
-using System.Reflection;
-
-namespace System.Runtime.Serialization
-{
- public interface ISerializable
- {
- void GetObjectData(SerializationInfo info, StreamingContext context);
- }
-}
-
-
-
-