Remove dead files from System.Private.DataContractSerialization (#41646)
authorEric Erhardt <eric.erhardt@microsoft.com>
Tue, 1 Sep 2020 04:59:44 +0000 (23:59 -0500)
committerGitHub <noreply@github.com>
Tue, 1 Sep 2020 04:59:44 +0000 (21:59 -0700)
These files have been moved to System.Runtime.Serialization.Primitives and were left over here. They aren't part of any .csproj, so they are not being compiled.

src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContractAttribute.cs [deleted file]
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ContractNamespaceAttribute.cs [deleted file]
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContractAttribute.cs [deleted file]
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataMemberAttribute.cs [deleted file]
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/EnumMemberAttribute.cs [deleted file]
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/IgnoreDataMemberAttribute.cs [deleted file]
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/InvalidDataContract.cs [deleted file]
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/InvalidDataContractException.cs [deleted file]
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/KnownTypeAttribute.cs [deleted file]

diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContractAttribute.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContractAttribute.cs
deleted file mode 100644 (file)
index 7617e62..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.Serialization
-{
-    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
-    public sealed class CollectionDataContractAttribute : Attribute
-    {
-        private string _name;
-        private string _ns;
-        private string _itemName;
-        private string _keyName;
-        private string _valueName;
-        private bool _isReference;
-        private bool _isNameSetExplicitly;
-        private bool _isNamespaceSetExplicitly;
-        private bool _isReferenceSetExplicitly;
-        private bool _isItemNameSetExplicitly;
-        private bool _isKeyNameSetExplicitly;
-        private bool _isValueNameSetExplicitly;
-
-        public CollectionDataContractAttribute()
-        {
-        }
-
-        public string Namespace
-        {
-            get { return _ns; }
-            set
-            {
-                _ns = value;
-                _isNamespaceSetExplicitly = true;
-            }
-        }
-
-        public bool IsNamespaceSetExplicitly
-        {
-            get { return _isNamespaceSetExplicitly; }
-        }
-
-        public string Name
-        {
-            get { return _name; }
-            set
-            {
-                _name = value;
-                _isNameSetExplicitly = true;
-            }
-        }
-
-        public bool IsNameSetExplicitly
-        {
-            get { return _isNameSetExplicitly; }
-        }
-
-        public string ItemName
-        {
-            get { return _itemName; }
-            set
-            {
-                _itemName = value;
-                _isItemNameSetExplicitly = true;
-            }
-        }
-
-        public bool IsItemNameSetExplicitly
-        {
-            get { return _isItemNameSetExplicitly; }
-        }
-
-        public string KeyName
-        {
-            get { return _keyName; }
-            set
-            {
-                _keyName = value;
-                _isKeyNameSetExplicitly = true;
-            }
-        }
-
-        public bool IsReference
-        {
-            get { return _isReference; }
-            set
-            {
-                _isReference = value;
-                _isReferenceSetExplicitly = true;
-            }
-        }
-
-        public bool IsReferenceSetExplicitly
-        {
-            get { return _isReferenceSetExplicitly; }
-        }
-
-        public bool IsKeyNameSetExplicitly
-        {
-            get { return _isKeyNameSetExplicitly; }
-        }
-
-        public string ValueName
-        {
-            get { return _valueName; }
-            set
-            {
-                _valueName = value;
-                _isValueNameSetExplicitly = true;
-            }
-        }
-
-        public bool IsValueNameSetExplicitly
-        {
-            get { return _isValueNameSetExplicitly; }
-        }
-    }
-}
diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ContractNamespaceAttribute.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ContractNamespaceAttribute.cs
deleted file mode 100644 (file)
index aa52ed6..0000000
+++ /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.
-
-using System;
-
-
-namespace System.Runtime.Serialization
-{
-    [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module, Inherited = false, AllowMultiple = true)]
-    public sealed class ContractNamespaceAttribute : Attribute
-    {
-        private string _clrNamespace;
-        private string _contractNamespace;
-
-        public ContractNamespaceAttribute(string contractNamespace)
-        {
-            _contractNamespace = contractNamespace;
-        }
-
-        public string ClrNamespace
-        {
-            get { return _clrNamespace; }
-            set { _clrNamespace = value; }
-        }
-
-        public string ContractNamespace
-        {
-            get { return _contractNamespace; }
-        }
-    }
-}
diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContractAttribute.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContractAttribute.cs
deleted file mode 100644 (file)
index acabf40..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.Serialization
-{
-    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum, Inherited = false, AllowMultiple = false)]
-    public sealed class DataContractAttribute : Attribute
-    {
-        private string _name;
-        private string _ns;
-        private bool _isNameSetExplicitly;
-        private bool _isNamespaceSetExplicitly;
-        private bool _isReference;
-        private bool _isReferenceSetExplicitly;
-
-        public DataContractAttribute()
-        {
-        }
-
-        public bool IsReference
-        {
-            get { return _isReference; }
-            set
-            {
-                _isReference = value;
-                _isReferenceSetExplicitly = true;
-            }
-        }
-
-        public bool IsReferenceSetExplicitly
-        {
-            get { return _isReferenceSetExplicitly; }
-        }
-
-        public string Namespace
-        {
-            get { return _ns; }
-            set
-            {
-                _ns = value;
-                _isNamespaceSetExplicitly = true;
-            }
-        }
-
-        public bool IsNamespaceSetExplicitly
-        {
-            get { return _isNamespaceSetExplicitly; }
-        }
-
-        public string Name
-        {
-            get { return _name; }
-            set
-            {
-                _name = value;
-                _isNameSetExplicitly = true;
-            }
-        }
-
-        public bool IsNameSetExplicitly
-        {
-            get { return _isNameSetExplicitly; }
-        }
-    }
-}
diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataMemberAttribute.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataMemberAttribute.cs
deleted file mode 100644 (file)
index 49a98bd..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.Serialization
-{
-    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
-    public sealed class DataMemberAttribute : Attribute
-    {
-        private string _name;
-        private bool _isNameSetExplicitly;
-        private int _order = -1;
-        private bool _isRequired;
-        private bool _emitDefaultValue = Globals.DefaultEmitDefaultValue;
-
-        public DataMemberAttribute()
-        {
-        }
-
-        public string Name
-        {
-            get { return _name; }
-            set { _name = value; _isNameSetExplicitly = true; }
-        }
-
-        public bool IsNameSetExplicitly
-        {
-            get { return _isNameSetExplicitly; }
-        }
-
-        public int Order
-        {
-            get { return _order; }
-            set
-            {
-                if (value < 0)
-                    throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.OrderCannotBeNegative));
-                _order = value;
-            }
-        }
-
-        public bool IsRequired
-        {
-            get { return _isRequired; }
-            set { _isRequired = value; }
-        }
-
-        public bool EmitDefaultValue
-        {
-            get { return _emitDefaultValue; }
-            set { _emitDefaultValue = value; }
-        }
-    }
-}
diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/EnumMemberAttribute.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/EnumMemberAttribute.cs
deleted file mode 100644 (file)
index 03524ba..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.Serialization
-{
-    [AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
-    public sealed class EnumMemberAttribute : Attribute
-    {
-        private string _value;
-        private bool _isValueSetExplicitly;
-
-        public EnumMemberAttribute()
-        {
-        }
-
-        public string Value
-        {
-            get { return _value; }
-            set { _value = value; _isValueSetExplicitly = true; }
-        }
-
-        public bool IsValueSetExplicitly
-        {
-            get { return _isValueSetExplicitly; }
-        }
-    }
-}
diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/IgnoreDataMemberAttribute.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/IgnoreDataMemberAttribute.cs
deleted file mode 100644 (file)
index 36edb2f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.Serialization
-{
-    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
-    public sealed class IgnoreDataMemberAttribute : Attribute
-    {
-        public IgnoreDataMemberAttribute()
-        {
-        }
-    }
-}
diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/InvalidDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/InvalidDataContract.cs
deleted file mode 100644 (file)
index 73d06a1..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.Serialization;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml;
-
-namespace System.Runtime.Serialization
-{
-
-    // InvalidDataContract is used to create a DataContract that will throw
-    // an exception if used to serialize or deserialize.
-    public sealed class InvalidDataContract : DataContract
-    {
-        public InvalidDataContract()
-            : base(new InvalidDataContractCriticalHelper())
-        {
-        }
-
-        public InvalidDataContract(Type type, string errorMessage)
-            : base(new InvalidDataContractCriticalHelper(type))
-        {
-            ErrorMessage = errorMessage;
-        }
-
-        public string ErrorMessage { get; set; }
-
-        public override void PrepareToRead(XmlReaderDelegator xmlReader)
-        {
-            throw CreateInvalidDataContractException();
-        }
-
-        public override object ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)
-        {
-            throw CreateInvalidDataContractException();
-        }
-
-        public override void WriteXmlValue(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context)
-        {
-            throw CreateInvalidDataContractException();
-        }
-
-        private InvalidDataContractException CreateInvalidDataContractException()
-        {
-            return new InvalidDataContractException(ErrorMessage);
-        }
-
-        private class InvalidDataContractCriticalHelper : DataContract.DataContractCriticalHelper
-        {
-            private XmlDictionary _xmlDictionary;
-
-            public InvalidDataContractCriticalHelper()
-            {
-            }
-
-            public InvalidDataContractCriticalHelper(Type type)
-                : base(type)
-            {
-                StableName = DataContract.GetStableName(type);
-                _xmlDictionary = new XmlDictionary(2);
-                this.Name = this.TopLevelElementName = _xmlDictionary.Add(StableName.Name);
-                this.Namespace = this.TopLevelElementNamespace = _xmlDictionary.Add(StableName.Namespace);
-            }
-        }
-    }
-}
diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/InvalidDataContractException.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/InvalidDataContractException.cs
deleted file mode 100644 (file)
index e7a2d46..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-
-namespace System.Runtime.Serialization
-{
-    [Serializable]
-    [System.Runtime.CompilerServices.TypeForwardedFrom("System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
-    public partial class InvalidDataContractException : Exception
-    {
-        public InvalidDataContractException()
-            : base()
-        {
-        }
-
-        public InvalidDataContractException(string message)
-            : base(message)
-        {
-        }
-
-        public InvalidDataContractException(string message, Exception innerException)
-            : base(message, innerException)
-        {
-        }
-
-        protected InvalidDataContractException(SerializationInfo info, StreamingContext context)
-            : base(info, context)
-        {
-        }
-    }
-}
diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/KnownTypeAttribute.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/KnownTypeAttribute.cs
deleted file mode 100644 (file)
index 08c53f7..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.Serialization
-{
-    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = true, AllowMultiple = true)]
-    public sealed class KnownTypeAttribute : Attribute
-    {
-        private string _methodName;
-        private Type _type;
-
-        private KnownTypeAttribute()
-        {
-            // Disallow default constructor
-        }
-
-        public KnownTypeAttribute(Type type)
-        {
-            _type = type;
-        }
-
-        public KnownTypeAttribute(string methodName)
-        {
-            _methodName = methodName;
-        }
-
-        public string MethodName
-        {
-            get { return _methodName; }
-        }
-
-        public Type Type
-        {
-            get { return _type; }
-        }
-    }
-}