Delete FormatterConverter from CoreLib (dotnet/coreclr#18336)
authorStephen Toub <stoub@microsoft.com>
Thu, 7 Jun 2018 07:04:30 +0000 (03:04 -0400)
committerJan Kotas <jkotas@microsoft.com>
Thu, 7 Jun 2018 07:04:30 +0000 (00:04 -0700)
It's not used in the library.  The type is implemented/exposed from corefx.

Commit migrated from https://github.com/dotnet/coreclr/commit/16a8fb3a707014ddebfb5ef34f1c7750f643f1c2

src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Serialization/FormatterConverter.cs [deleted file]

index f23d5eb..a6536c0 100644 (file)
     <Compile Include="$(BclSourcesRoot)\System\Runtime\Loader\AssemblyLoadContext.cs" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="$(BclSourcesRoot)\System\Runtime\Serialization\FormatterConverter.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Runtime\Serialization\FormatterServices.cs" />
   </ItemGroup>
   <ItemGroup>
diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Serialization/FormatterConverter.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Serialization/FormatterConverter.cs
deleted file mode 100644 (file)
index a6e03e7..0000000
+++ /dev/null
@@ -1,185 +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: A base implementation of the IFormatterConverter
-**          interface that uses the Convert class and the 
-**          IConvertible interface.
-**
-**
-============================================================*/
-
-using System;
-using System.Globalization;
-
-namespace System.Runtime.Serialization
-{
-    internal class FormatterConverter : IFormatterConverter
-    {
-        public FormatterConverter()
-        {
-        }
-
-        public Object Convert(Object value, Type type)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ChangeType(value, type, CultureInfo.InvariantCulture);
-        }
-
-        public Object Convert(Object value, TypeCode typeCode)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ChangeType(value, typeCode, CultureInfo.InvariantCulture);
-        }
-
-        public bool ToBoolean(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToBoolean(value, CultureInfo.InvariantCulture);
-        }
-
-        public char ToChar(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToChar(value, CultureInfo.InvariantCulture);
-        }
-
-        [CLSCompliant(false)]
-        public sbyte ToSByte(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToSByte(value, CultureInfo.InvariantCulture);
-        }
-
-        public byte ToByte(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToByte(value, CultureInfo.InvariantCulture);
-        }
-
-        public short ToInt16(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToInt16(value, CultureInfo.InvariantCulture);
-        }
-
-        [CLSCompliant(false)]
-        public ushort ToUInt16(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToUInt16(value, CultureInfo.InvariantCulture);
-        }
-
-        public int ToInt32(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToInt32(value, CultureInfo.InvariantCulture);
-        }
-
-        [CLSCompliant(false)]
-        public uint ToUInt32(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToUInt32(value, CultureInfo.InvariantCulture);
-        }
-
-        public long ToInt64(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToInt64(value, CultureInfo.InvariantCulture);
-        }
-
-        [CLSCompliant(false)]
-        public ulong ToUInt64(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToUInt64(value, CultureInfo.InvariantCulture);
-        }
-
-        public float ToSingle(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToSingle(value, CultureInfo.InvariantCulture);
-        }
-
-        public double ToDouble(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToDouble(value, CultureInfo.InvariantCulture);
-        }
-
-        public Decimal ToDecimal(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToDecimal(value, CultureInfo.InvariantCulture);
-        }
-
-        public DateTime ToDateTime(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToDateTime(value, CultureInfo.InvariantCulture);
-        }
-
-        public String ToString(Object value)
-        {
-            if (value == null)
-            {
-                throw new ArgumentNullException(nameof(value));
-            }
-            return System.Convert.ToString(value, CultureInfo.InvariantCulture);
-        }
-    }
-}
-