Remove unused System.Runtime.Serialization code.
authorAtsushi Eno <atsushieno@gmail.com>
Thu, 7 May 2015 16:13:32 +0000 (01:13 +0900)
committerAtsushi Eno <atsushieno@gmail.com>
Thu, 7 May 2015 16:13:32 +0000 (01:13 +0900)
System.ServiceModel.Web/System.Runtime.Serialization.Json is left as is
because they seem to be used by System.Json build...

74 files changed:
mcs/class/System.Runtime.Serialization.Json/Assembly/AssemblyInfo.cs [deleted file]
mcs/class/System.Runtime.Serialization.Json/Makefile [deleted file]
mcs/class/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json.dll.sources [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ChangeLog [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DataContractSerializerSection.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DeclaredTypeElement.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DeclaredTypeElementCollection.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ParameterElement.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ParameterElementCollection.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/SerializationSectionGroup.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/TypeElement.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/TypeElementCollection.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ChangeLog [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractResolver.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializerSettings.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataMemberAttribute.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DateTimeFormat.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/EmitTypeInformation.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/EnumMemberAttribute.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ExportOptions.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ExtensionDataObject.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IDataContractSurrogate.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IExtensibleDataObject.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IgnoreDataMemberAttribute.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ImportOptions.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/InvalidDataContractException.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeAttribute.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/NetDataContractSerializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.XsdExporter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlObjectSerializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlSerializableServices.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XsdDataContractExporter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XsdDataContractImporter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/ChangeLog [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IFragmentCapableXmlDictionaryWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IStreamProvider.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlBinaryReaderInitializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlBinaryWriterInitializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlDictionary.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlMtomReaderInitializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlMtomWriterInitializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlUTF8ReaderInitializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlUTF8WriterInitializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/OnXmlDictionaryReaderClose.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/UniqueId.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryReader.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriterAutoGen.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryFormat.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryReaderSession.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryWriterSession.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlC14NWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlCanonicalWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionary.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReader.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReaderAutoGen.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReaderQuotas.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryString.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriterAutoGen.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlMtomDictionaryReader.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlMtomDictionaryWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryReader.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/binary-writer-method-gen.cs [deleted file]
mcs/class/System.Runtime.Serialization/net_4_0_System.Runtime.Serialization.dll.sources [deleted file]
mcs/class/System.Runtime.Serialization/reader-method-gen.cs [deleted file]
mcs/class/System.Runtime.Serialization/resources/mstypes.schema [deleted file]
mcs/class/System.Runtime.Serialization/writer-method-gen.cs [deleted file]

diff --git a/mcs/class/System.Runtime.Serialization.Json/Assembly/AssemblyInfo.cs b/mcs/class/System.Runtime.Serialization.Json/Assembly/AssemblyInfo.cs
deleted file mode 100644 (file)
index 9ef66ef..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// AssemblyInfo.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2003 Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Diagnostics;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about the System.Runtime.Serialization.Json assembly
-// v2.1 Assembly
-
-[assembly: AssemblyTitle ("System.Runtime.Serialization.Json.dll")]
-[assembly: AssemblyDescription ("System.Runtime.Serialization.Json.dll")]
-[assembly: AssemblyDefaultAlias ("System.Runtime.Serialization.Json.dll")]
-
-[assembly: AssemblyCompany (Consts.MonoCompany)]
-[assembly: AssemblyProduct (Consts.MonoProduct)]
-[assembly: AssemblyCopyright (Consts.MonoCopyright)]
-[assembly: AssemblyVersion (Consts.FxVersion)]
-[assembly: SatelliteContractVersion (Consts.FxVersion)]
-[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
-[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
-
-[assembly: NeutralResourcesLanguage ("en-US")]
-[assembly: CLSCompliant (true)]
-[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
-[assembly: AssemblyKeyFile ("../silverlight.pub")]
-#else
-[assembly: AssemblyKeyFile ("../ecma.pub")]
-#endif
-
-[assembly: ComVisible (false)]
-[assembly: AllowPartiallyTrustedCallers]
-
-[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
diff --git a/mcs/class/System.Runtime.Serialization.Json/Makefile b/mcs/class/System.Runtime.Serialization.Json/Makefile
deleted file mode 100644 (file)
index cf3d387..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-thisdir = class/System.Runtime.Serialization.Json
-SUBDIRS = 
-include ../../build/rules.make
-
-LIBRARY = System.Runtime.Serialization.Json.dll
-LIB_REFS = System System.Xml System.Runtime.Serialization System.Core
-LIB_MCS_FLAGS =
-
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
-
-EXTRA_DISTFILES = $(RESOURCE_FILES)
-
-VALID_PROFILE := $(filter 2.1, $(FRAMEWORK_VERSION))
-ifndef VALID_PROFILE
-LIBRARY_NAME = dummy-System.Runtime.Serialization.Json.dll
-NO_INSTALL = yes
-NO_SIGN_ASSEMBLY = yes
-endif
-
-include ../../build/library.make
diff --git a/mcs/class/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json.dll.sources b/mcs/class/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json.dll.sources
deleted file mode 100644 (file)
index 74425b6..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-../../build/common/MonoTODOAttribute.cs
-Assembly/AssemblyInfo.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonReaderInitializer.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonWriterInitializer.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReader.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReaderWriterFactory.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonWriter.cs
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ChangeLog b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ChangeLog
deleted file mode 100644 (file)
index 5d445cd..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-2010-03-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * TypeElementCollection.cs : more corcompare fixes.
-
-2010-03-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * TypeElement.cs, DeclaredTypeElement.cs,
-         ParameterElementCollection.cs, DataContractSerializerSection.cs,
-         ParameterElement.cs :
-         Looks like MSDN pages are quite incorrect. updated to match what
-         status page tells.
-
-2010-03-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializerSection.cs : new.
-       * XmlFormatterSection.cs : remove.
-       * DeclaredTypeElementCollection.cs
-         TypeElement.cs
-         DeclaredTypeElement.cs
-         SerializationSectionGroup.cs
-         ParameterElementCollection.cs
-         TypeElementCollection.cs
-         ParameterElement.cs : implement.
-
-2005-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DeclaredTypeElementCollection.cs, TypeElement.cs,
-         DeclaredTypeElement.cs, SerializationSectionGroup.cs,
-         ParameterElementCollection.cs, TypeElementCollection.cs,
-         XmlFormatterSection.cs, ParameterElement.cs : new files.
-
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DataContractSerializerSection.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DataContractSerializerSection.cs
deleted file mode 100644 (file)
index 617894f..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// DataContractSerializerSection.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       public sealed class DataContractSerializerSection : ConfigurationSection
-       {
-               // Static Fields
-               static ConfigurationPropertyCollection properties;
-               static ConfigurationProperty declared_types;
-
-               static DataContractSerializerSection ()
-               {
-                       properties = new ConfigurationPropertyCollection ();
-                       declared_types = new ConfigurationProperty ("declaredTypes",
-                               typeof (DeclaredTypeElementCollection), null, null, null,
-                               ConfigurationPropertyOptions.None);
-
-                       properties.Add (declared_types);
-               }
-
-               public DataContractSerializerSection ()
-               {
-               }
-
-               [ConfigurationPropertyAttribute ("declaredTypes", DefaultValue = null)]
-               public DeclaredTypeElementCollection DeclaredTypes {
-                       get { return (DeclaredTypeElementCollection) base [declared_types]; }
-               }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DeclaredTypeElement.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DeclaredTypeElement.cs
deleted file mode 100644 (file)
index d4b9054..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// DeclaredTypeElement.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005,2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       [MonoTODO]
-       public sealed class DeclaredTypeElement : ConfigurationElement
-       {
-               // Static Fields
-               static ConfigurationPropertyCollection properties;
-               static ConfigurationProperty known_types;
-               static ConfigurationProperty type;
-
-               static DeclaredTypeElement ()
-               {
-                       properties = new ConfigurationPropertyCollection ();
-                       known_types = new ConfigurationProperty ("",
-                               typeof (TypeElementCollection), null, null, null,
-                               ConfigurationPropertyOptions.IsDefaultCollection);
-                       type = new ConfigurationProperty ("type",
-                               typeof (string), "", null, null,
-                               ConfigurationPropertyOptions.None);
-
-                       properties.Add (known_types);
-                       properties.Add (type);
-               }
-
-               public DeclaredTypeElement ()
-               {
-               }
-
-               public DeclaredTypeElement (string typeName)
-               {
-                       Type = typeName;
-               }
-
-               [ConfigurationProperty ("", DefaultValue = null, Options = ConfigurationPropertyOptions.IsDefaultCollection)]
-               public TypeElementCollection KnownTypes {
-                       get { return (TypeElementCollection) base [known_types]; }
-               }
-
-               [ConfigurationProperty ("type", DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)]
-               public string Type {
-                       get { return (string) base [type]; }
-                       set { base [type] = value; }
-               }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
-
-               protected override void PostDeserialize ()
-               {
-                       // what to do here?
-                       base.PostDeserialize ();
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DeclaredTypeElementCollection.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DeclaredTypeElementCollection.cs
deleted file mode 100644 (file)
index d902478..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// DeclaredTypeElementCollection.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       [ConfigurationCollection (typeof (DeclaredTypeElement))]
-       public sealed class DeclaredTypeElementCollection : ConfigurationElementCollection
-       {
-               public DeclaredTypeElementCollection ()
-               {
-               }
-
-               public DeclaredTypeElement this [int index] {
-                       get { return (DeclaredTypeElement) BaseGet (index); }
-                       set {
-                               RemoveAt (index);
-                               Add (value);
-                       }
-               }
-
-               public new DeclaredTypeElement this [string typeName] {
-                       get { return (DeclaredTypeElement) BaseGet (typeName); }
-                       set {
-                               Remove (typeName);
-                               Add (value);
-                       }
-               }
-
-               public void Add (DeclaredTypeElement element)
-               {
-                       BaseAdd (element);
-               }
-
-               public void Clear ()
-               {
-                       BaseClear ();
-               }
-
-               public bool Contains (string typeName)
-               {
-                       return BaseGet (typeName) != null;
-               }
-
-               public int IndexOf (DeclaredTypeElement element)
-               {
-                       return BaseIndexOf (element);
-               }
-
-               public void Remove (DeclaredTypeElement element)
-               {
-                       Remove ((string) GetElementKey (element));
-               }
-
-               public void Remove (string typeName)
-               {
-                       BaseRemove (typeName);
-               }
-
-               public void RemoveAt (int index)
-               {
-                       BaseRemoveAt (index);
-               }
-
-               protected override ConfigurationElement CreateNewElement ()
-               {
-                       return new DeclaredTypeElement ();
-               }
-
-               protected override Object GetElementKey (
-                       ConfigurationElement element)
-               {
-                       return ((DeclaredTypeElement) element).Type;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ParameterElement.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ParameterElement.cs
deleted file mode 100644 (file)
index fcfaf5f..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// ParameterElement.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005,2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-using System.Xml;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       public sealed class ParameterElement : ConfigurationElement
-       {
-               // Static Fields
-               static ConfigurationPropertyCollection properties;
-               static ConfigurationProperty index;
-               static ConfigurationProperty parameters;
-               static ConfigurationProperty type;
-
-               static ParameterElement ()
-               {
-                       properties = new ConfigurationPropertyCollection ();
-                       index = new ConfigurationProperty ("index",
-                               typeof (int), "", null, null,
-                               ConfigurationPropertyOptions.None);
-                       parameters = new ConfigurationProperty ("",
-                               typeof (ParameterElementCollection), null, null, null,
-                               ConfigurationPropertyOptions.IsDefaultCollection);
-                       type = new ConfigurationProperty ("type",
-                               typeof (string), "", null, null,
-                               ConfigurationPropertyOptions.None);
-
-                       properties.Add (index);
-                       properties.Add (parameters);
-                       properties.Add (type);
-               }
-
-               public ParameterElement ()
-               {
-               }
-
-               public ParameterElement (int index)
-               {
-                       Index = index;
-               }
-
-               public ParameterElement (string typeName)
-               {
-                       Type = typeName;
-               }
-
-               [IntegerValidator (MinValue = 0)]
-               [ConfigurationProperty ("index", DefaultValue = 0)]
-               public int Index {
-                       get { return (int) base [index]; }
-                       set { base [index] = value; }
-               }
-
-               [ConfigurationProperty ("", DefaultValue = null, Options = ConfigurationPropertyOptions.IsDefaultCollection)]
-               public ParameterElementCollection Parameters {
-                       get { return (ParameterElementCollection) base [parameters]; }
-               }
-
-               [StringValidator (MinLength = 0)]
-               [ConfigurationProperty ("type", DefaultValue = "")]
-               public string Type {
-                       get { return (string) base [type]; }
-                       set { base [type] = value; }
-               }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
-
-               protected override void PreSerialize (XmlWriter writer)
-               {
-                       // what to do here?
-                       base.PreSerialize (writer);
-               }
-
-               protected override void PostDeserialize ()
-               {
-                       // what to do here?
-                       base.PostDeserialize ();
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ParameterElementCollection.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ParameterElementCollection.cs
deleted file mode 100644 (file)
index ef44ceb..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// ParameterElementCollection.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005,2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       [ConfigurationCollection (typeof (ParameterElement), AddItemName = "parameter", CollectionType = ConfigurationElementCollectionType.BasicMap)]
-       public sealed class ParameterElementCollection : ConfigurationElementCollection
-       {
-               public ParameterElementCollection ()
-               {
-               }
-
-               public override ConfigurationElementCollectionType CollectionType {
-                       get { return ConfigurationElementCollectionType.BasicMap; }
-               }
-
-               // FIXME: not very sure, just had a look at http://msdn.microsoft.com/en-us/library/ms731806.aspx
-               protected override string ElementName {
-                       get { return String.Empty; }
-               }
-
-               public ParameterElement this [int index] {
-                       get { return (ParameterElement) BaseGet (index); }
-                       set {
-                               BaseRemoveAt (index);
-                               Add (value);
-                       }
-               }
-
-               public void Add (ParameterElement element)
-               {
-                       BaseAdd (element);
-               }
-
-               public void Clear ()
-               {
-                       BaseClear ();
-               }
-
-               public bool Contains (string typeName)
-               {
-                       return BaseGet (typeName) != null;
-               }
-
-               public int IndexOf (ParameterElement element)
-               {
-                       return BaseIndexOf (element);
-               }
-
-               public void Remove (ParameterElement element)
-               {
-                       BaseRemove ((string) GetElementKey (element));
-               }
-
-               public void RemoveAt (int index)
-               {
-                       BaseRemoveAt (index);
-               }
-
-               protected override ConfigurationElement CreateNewElement ()
-               {
-                       return new ParameterElement ();
-               }
-
-               protected override object GetElementKey (
-                       ConfigurationElement element)
-               {
-                       return ((ParameterElement) element).Type;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/SerializationSectionGroup.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/SerializationSectionGroup.cs
deleted file mode 100644 (file)
index b2101cf..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// SerializationSectionGroup.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005,2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-using ConfigurationType = System.Configuration.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       public sealed class SerializationSectionGroup : ConfigurationSectionGroup
-       {
-               public static SerializationSectionGroup GetSectionGroup (ConfigurationType config)
-               {
-                       var ret = (SerializationSectionGroup) config.GetSectionGroup ("system.runtime.serialization");
-                       if (ret == null)
-                               throw new SystemException ("Internal configuration error: section 'system.runtime.serialization' was not found.");
-                       return ret;
-               }
-
-               public SerializationSectionGroup ()
-               {
-               }
-
-               public DataContractSerializerSection DataContractSerializer {
-                       get { return (DataContractSerializerSection) Sections ["dataContractSerializer"]; }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/TypeElement.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/TypeElement.cs
deleted file mode 100644 (file)
index 4057b04..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// TypeElement.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005,2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       public sealed class TypeElement : ConfigurationElement
-       {
-               // Static Fields
-               static ConfigurationPropertyCollection properties;
-               static ConfigurationProperty index;
-               static ConfigurationProperty parameters;
-               static ConfigurationProperty type;
-
-               static TypeElement ()
-               {
-                       properties = new ConfigurationPropertyCollection ();
-                       index = new ConfigurationProperty ("index",
-                               typeof (int), "", null, null,
-                               ConfigurationPropertyOptions.None);
-                       parameters = new ConfigurationProperty ("",
-                               typeof (ParameterElementCollection), null, null, null,
-                               ConfigurationPropertyOptions.IsDefaultCollection);
-                       type = new ConfigurationProperty ("type",
-                               typeof (string), "", null, null,
-                               ConfigurationPropertyOptions.None);
-
-                       properties.Add (index);
-                       properties.Add (parameters);
-                       properties.Add (type);
-               }
-
-               public TypeElement ()
-               {
-               }
-               
-               public TypeElement (string typeName)
-               {
-               }
-
-               [ConfigurationProperty ("index", DefaultValue = 0)]
-               [IntegerValidator (MinValue = 0)]
-               public int Index {
-                       get { return (int) base [index]; }
-                       set { base [index] = value; }
-               }
-
-               [ConfigurationProperty ("", DefaultValue = null, Options = ConfigurationPropertyOptions.IsDefaultCollection)]
-               public ParameterElementCollection Parameters {
-                       get { return (ParameterElementCollection) base [parameters]; }
-               }
-
-               [ConfigurationProperty ("type", DefaultValue = "")]
-               [StringValidator (MinLength = 0)]
-               public string Type {
-                       get { return (string) base [type]; }
-                       set { base [type] = value; }
-               }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
-
-               protected override void Reset (ConfigurationElement parentElement)
-               {
-                       base.Reset (parentElement);
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/TypeElementCollection.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/TypeElementCollection.cs
deleted file mode 100644 (file)
index 3055c6e..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// TypeElementCollection.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       [ConfigurationCollection (typeof (TypeElement), CollectionType = ConfigurationElementCollectionType.BasicMap)]
-       public sealed class TypeElementCollection : ConfigurationElementCollection
-       {
-               public TypeElementCollection ()
-               {
-               }
-
-               public override ConfigurationElementCollectionType CollectionType {
-                       get { return ConfigurationElementCollectionType.BasicMap; }
-               }
-
-               // It is undocumented.
-               protected override string ElementName {
-                       get { return "knownType"; }
-               }
-
-               public TypeElement this [int index] {
-                       get { return (TypeElement) BaseGet (index); }
-                       set {
-                               BaseRemoveAt (index);
-                               Add (value);
-                       }
-               }
-
-               public void Add (TypeElement element)
-               {
-                       BaseAdd (element);
-               }
-
-               public void Clear ()
-               {
-                       BaseClear ();
-               }
-
-               public int IndexOf (TypeElement element)
-               {
-                       return BaseIndexOf (element);
-               }
-
-               public void Remove (TypeElement element)
-               {
-                       BaseRemove ((string) GetElementKey (element));
-               }
-
-               public void RemoveAt (int index)
-               {
-                       BaseRemoveAt (index);
-               }
-
-               protected override ConfigurationElement CreateNewElement ()
-               {
-                       return new TypeElement ();
-               }
-
-               protected override Object GetElementKey (
-                       ConfigurationElement element)
-               {
-                       return ((TypeElement) element).Type;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ChangeLog b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ChangeLog
deleted file mode 100755 (executable)
index 5efe584..0000000
+++ /dev/null
@@ -1,856 +0,0 @@
-2010-07-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : add OnDeserializing/OnDeserialized support.
-
-2010-06-23  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * XmlFormatterDeserializer.cs: Fix some issues in Moonlight when 
-       some referenced assemblies cannot be found or loaded
-
-2010-06-03  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * SerializationMap.cs: NET_2_1 needs cast too
-
-2010-06-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : fix PeerNodeAddress serialization regression.
-
-2010-06-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : for IXmlSerializable it uses CreateInstance()
-         instead of GetUninitializedObject(). Fixed bug #601785.
-
-2010-05-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, XmlFormatterSerializer.cs,
-         DataContractSerializer.cs :
-         support DataContractSerializer.PreserveObjectReferences. z:Ref
-         attributes are used not only for objects with IsReference=true.
-         Fixed bug #610036.
-
-2010-05-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs : contract namespace
-         should be still considered even if contract (local) name is null.
-         Fix crash for generic derived type of dictionary. Fixed the
-         primary (crasher) part of bug #610036.
-
-2010-05-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs : Array of something with non-default
-         namespace should be deserialized as well. Required for fixing
-         PeerResolvers ResolveResponseInfo serialization test case.
-
-2010-05-19  Andreia Gaita  <avidigal@novell.com>
-
-       * SerializationMap.cs: when deserializing, it is possible that the
-       DataMemberInfo objects being matched against the xml don't have
-       a set namespace because they were created from
-       DefaultTypeMap.GetDataMembers(), so only use the namespace for
-       comparison if it's not null (fixes part of #599667)
-
-2010-04-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : support DataContractNamespaceAttribute.
-         Fixed bug #599889.
-
-2010-04-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractExporter-new.cs : do not expect contract attribute on
-         dictionary map. Non-contract type also uses this.
-
-2010-04-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.XsdExporter.cs, DataContractExporter-new.cs :
-         handle schema export for SharedTypeMap.
-
-2010-04-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs, SerializationMap.cs : split SharedTypeMap
-         .ctor() and initialization. Fixed infinite loop for some
-         [Serializable] types (such as Assembly).
-
-2010-04-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer : implement IsStartObject().
-
-2010-03-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs, SerializationMap.cs :
-         some refactoring to implement MessageDescription.XmlName.
-
-2010-03-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : return array instance if the runtime type is
-         an array (it used to return ArrayList without conveting to array).
-
-2010-03-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.XsdExporter.cs, XsdDataContractExporter-new.cs:
-         refresh implementation to reflect the latest WCF impl.
-       * SerializationMap.cs : make types partial.
-
-2010-02-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter.cs : fix extension type name (and comment).
-
-2010-02-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter.cs : added dictionary support.
-
-2010-02-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter-new.cs, XsdDataContractImporter.cs :
-         replaced implementation.
-       * ImportOptions.cs : add correct MonoTODOs.
-
-2010-02-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter-new.cs : output [KnownType] to expose
-         base/derived type relationship.
-
-2010-02-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter-new.cs : fix GenerateInternal.
-
-2010-02-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter-new.cs : refresh implementation that is
-         not based on xml serialization. Not enabled yet.
-       * KnownTypeCollection.cs : add cosmetic comment.
-
-2010-02-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter.cs : add appropriate code namespaces
-         imported from xsd namespace.
-
-2010-02-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter.cs : do not add primitive ArrayOfxxx types.
-
-2010-02-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter.cs : some generated attributes are put
-         on enums too.
-
-2010-01-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : allow readonly field as data member.
-         Fixed bug #560155.
-
-2010-01-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs : differentiate
-         [DataContract(Namespace=null)] and [DataContract(Namespace="")].
-         Fixed bug #568763.
-
-2009-12-01  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * DataContractSerializer.cs: Add two missing methods for FX3.0 
-       and SL2/SL3.
-
-2009-10-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : partly revert previous sorting fix in
-         Sep.28th. Do not sort and mix members in base and derived types.
-         Fixed bug #546238.
-
-2009-10-21  Jb Evain  <jbevain@novell.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs: avoid using LINQ
-       on arrays as MonoTouch has issues with them.
-
-2009-09-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs :
-         There were some places that ignored possible whitespace nodes.
-         Fixed sorting of ordered members so that it does not give
-         incomplete sorting among base/derived types. (should fix #539563.)
-         Give xml error details in some places.
-
-2009-09-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : (the previous one didn't fix #539563.)
-         Consider attempts to register the same collection type as it did
-         before.
-
-2009-09-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs : nested use of type
-         in its members resulted in infinite loop. This hopefully fixes
-         bug #539563.
-
-2009-09-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * IgnoreDataMemberAttribute.cs : add missing type.
-       * SerializationMap.cs : support above.
-
-2009-07-23  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * SerializationMap.cs : Ensure Dictionary is still deserialized
-       correctly (wrt previous change). Fix moonlight isolated storage
-       settings.
-
-2009-07-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : for empty element, do not try to consume
-         children. Fixed bug #524086.
-         For enum, it is always error when the enum is not flags, and
-         is always default value for flags.
-
-2009-07-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs : when reading empty primitive value,
-         make sure to consume the reader. Fixed bug #524083.
-
-2009-07-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : call MoveToContent() before examining
-         the reader node type.
-
-2009-07-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : Find KnownTypeAttributes in base types
-         too. Patch by Rolf Bjarne Kvinge. Fixed bug #524088.
-
-2009-07-21  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : it does not write dictionary string
-         when it was not created with it.
-
-2009-07-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs, SerializationMap.cs : IXmlSerializable
-         were not deserialized correctly as it has mismatch on wrapper
-         element. This fixes PeerNodeAddress.EndpointAddress deserialization.
-
-2009-06-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs : verifyObjectName rather blocked
-         correct names provided as the root names.
-
-2009-06-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterSerializer.cs, KnownTypeCollection.cs : collection
-         types does not emit xsi:type when the actual type is different
-         from the nominal serilaization type. To achieve this, introduced
-         the idea of the actual serialization type.
-
-2009-05-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : for default / shared type map, members are
-         serialized in alphabetical order.
-
-2009-05-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : generic interface search has to be more
-         complicated. Give kind error message on setting deserialized value.
-
-2009-05-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs: collection interface cannot be instantiated,
-         so create List<T> (generic) or ArrayList (non-generic) instead.
-
-2009-05-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, XmlFormatterSerializer.cs :
-         collection types should not output xsi:type e.g. IList<T> should
-         not exposed xsi:type as xsi:type=List`1.
-
-2009-05-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, XmlFormatterDeserializer.cs,
-         KnownTypeCollection.cs : Support for array of some primitive types
-         in the deserializer was missing, which resulted in peer resolver
-         RegisterInfo deserialization failure.
-
-2009-05-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs : remove type lookup optimization
-         (since .NET 3.5 introduced system types with DC) and fix
-         serialization of system types (ISerializable types were not
-         resolved in previous code).
-
-2009-05-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : it was only about 2.1. Fix build.
-
-2009-05-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : It is not possible to get schema without
-         IXmlSerializable instance.
-
-2009-05-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : write dictionary string directly for
-         root name/ns (root only, so far).
-
-2009-05-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs: interface collection failed to serialize as
-         it was calling inappropriate GetInterfaceMap().
-
-2009-04-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs : more hack to handle empty
-         element nicely.
-
-2009-03-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, XmlFormatterDeserializer.cs:
-         empty collection deserialization resulted in extra
-         consumption of the next xml node.
-
-2009-03-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs, XmlFormatterDeserializer.cs :
-         to infer type from xml qname, consider DataContractAttribute
-         names.
-
-2009-03-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : make generic type parsing sloppy.
-         because we don't know some cryptic hash algorithm:
-         http://jeffbarnes.net/portal/blogs/jeff_barnes/archive/2007/05/10/wcf-serialization-and-generics.aspx
-
-2009-03-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs :
-         support CollectionDataContract-based dictionary too.
-
-2009-03-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs :
-         added support for dictionary serialization (not for
-         CollectionDataContract-attributed dictionary yet).
-
-2009-03-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : cosmetic !NET_2_1 fix (no effect).
-       * KnownTypeCollection.cs : use ICollection<> and IList instead of
-         IEnumerable. This causes confusion for dictionary.
-
-2009-03-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterSerializer.cs, XmlObjectSerializer.cs,
-         XmlFormatterDeserializer.cs, KnownTypeCollection.cs :
-         add more xsi:type to cover collection items.
-
-2009-03-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : fix generic argument names in xml.
-         They should use xmlized names instead of raw type name.
-       * XmlFormatterDeserializer.cs : remove extra Console.WriteLine.
-
-2009-03-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : eliminate whitespace misuses.
-
-2009-03-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : actually it could just be ICollection<T>.
-
-2009-03-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : implemented generic IList deserialization.
-
-2009-03-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : fix for generic serialization.
-
-2009-02-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : look for unordered members first, in
-         different iteration. Got SL OpenStreetMap working.
-
-2009-02-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : remove use of non-2.1 CreateInstance().
-       * XmlFormatterDeserializer.cs : allow empty element.
-
-2009-02-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, DataContractSerializer.cs,
-         KnownTypeCollection.cs : now .NET 3.5/SP1 supports non-contract
-         type serialization.
-
-2009-02-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs : couple of refactoring
-         to simplify code base and handle CollectionDataContract namespace.
-
-2009-02-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : oops, remove debug lines.
-
-2009-02-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : remove extra writexmlns.
-       * SerializationMap.cs : allow DataMember of collection contract type
-         as read-only.
-       * KnownTypeCollection.cs : it was not iterating interfaces to find
-         IEnumerable<T> correctly.
-
-2009-02-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : a bit more detailed error message.
-
-2009-01-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : similar fix to the previous one,
-         on uint16.
-
-2009-01-22  Alan McGovern  <amcgovern@novell.com>
-
-       * KnownTypeCollection.cs : The byte overload doesn't exist in
-       Silverlight, so cast the byte to an int instead.
-
-2008-11-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractAttribute.cs : remove MonoTODO.
-
-2008-11-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, XmlFormatterSerializer.cs,
-         XmlFormatterDeserializer.cs, DataContractAttribute.cs,
-         CollectionDataContractAttribute.cs, KnownTypeCollection.cs :
-         support IsReference (new in 3.5 SP1).
-
-2008-11-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : remove extra type validity check.
-
-2008-11-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterSerializer.cs : one object could not be serialized
-         twice in non-circular situation.
-
-2008-09-09  Atsushi Enomoto  <atsushi@ximian.com>
-                       Jb Evain  <jbevain@novell.com>
-
-       * IDataContractSurrogater.cs, SerializationMap.cs:
-       add support to build on the net_2_1 profile.
-
-2008-06-19  Noam Lampert <noaml@mainsoft.com>
-       
-       * KnownTypeCollection.cs: Support anyUri type
-
-2008-06-05  Noam Lampert <noaml@mainsoft.com>
-       
-       * KnownTypeCollection.cs: Support XmlRoot attribute
-
-2008-06-01  Noam Lampert <noaml@mainsoft.com>
-       
-       * KnownTypeCollection.cs: Implement byte[] serialization.
-
-2008-05-19  Noam Lampert <noaml@mainsoft.com>
-       
-       * KnownTypeCollection.cs: Implement char serialization.
-          
-2008-05-19  Noam Lampert <noaml@mainsoft.com>
-       
-       * KnownTypeCollection.cs, XmlFormatterDeserializer.cs: Imporve support for 
-          Nullable types in contracts.
-          
-2008-04-29  Eyal Alaluf <eyala@mainsoft.com>
-
-       * KnownTypeCollection.cs: Fixed a typo in long conversion.
-
-2008-04-17  Eyal Alaluf <eyala@mainsoft.com>
-
-       * SerializationMap.cs: Implement partially collections deserialization.
-         Supports arrays and types derived from IList. Needs support for calling
-         'Add' method and for dictionaries.
-       * SerializationMap.cs XmlFormatterSerializer.cs DataContractSerializer.cs:
-         Serialize namespaces for base members according to base class namespace.
-
-2008-04-14  Eyal Alaluf <eyala@mainsoft.com>
-
-       * SerializationMap.cs: Use FormatterServices.GetUninitializedObject instead
-         of Activator.CreateInstance.
-
-2008-04-10  Eyal Alaluf <eyala@mainsoft.com>
-
-       * DataContractSerializer.cs: Write and register the current type namespace
-         within the writer.
-       * XmlObjectSerializer.cs: ReadObject verifies by default.
-       * XmlFormatterSerializer.cs: Write and register XML namespaces.
-       * XmlFormatterDeserializer.cs: Refactored so Deserialize instance method can
-         be used from SerializationMap deserialization logic recursively.
-       * SerializationMap.cs: Reimplemented main deserialization logic. Now it
-         handles better missing entries, consumes the XmlReader until the end
-         element and handles XML namespaces correctly.
-         Enabled checks for required fields.
-
-2008-02-27  Eyal Alaluf <eyala@mainsoft.com>
-
-       * SerializationMap.cs: Fix namespace logic at least in simple case where
-         there are several unknown elements before the current element.
-       * ContractNamespaceAttribute.cs: The ClrNamespace is not set by the ctor.
-       * XmlObjectSerializer.cs: Dispose the XmlWriter created in WriteObject
-         to a stream.
-       * DataMemberAttribute.cs: Added the EmitDefaultValue property.
-       * XsdDataContractImporter.cs: Handle null arguments in Import methods.
-       * KnownTypeCollection.cs: Use XmlConvert.ToDateTime with roundtrip style.
-
-2007-12-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlObjectSerializer.cs : some methods became virtual (in Redbits).
-       * DataContractSerializer.cs : added some overriden methods in Redbits.
-         knownTypes can be null in .ctor().
-
-2007-08-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : for void it cannot be instantiated. Return
-         null instead.
-
-2007-08-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs DataContractSerializer.cs :
-         uhoh, the semantic of bool parameter in ReadObject() has
-         changed in the RTM. Implemented it as verifyObjectName.
-
-2007-03-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs
-         XmlFormatterSerializer.cs
-         DataContractSerializer.cs :
-         now it needs some mess to handle serialization namespaces.
-         Collection items are serialized in its own xml namespace. Others,
-         (including the collection member itself) is serialized in its
-         parent xml namespace. Collection items are serialized with its
-         wrapping element.
-       * XsdDataContractImporter.cs : use constant.
-
-2007-03-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : added support for Guid serialization.
-
-2006-10-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : (RemoveItem) don't remove items while 
-         iterating.
-
-2006-09-06  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.GetSequence): Set minOccurs = 0
-
-2006-09-05  Ankit Jain  <jankit@novell.com>
-
-       * XsdDataContractExporter.cs (XsdDataContractExporter.MSTypesSchema):
-       Load resource mstypes.schema
-       (XsdDataContractExporter.Schemas): Add MSTypesSchema by default.
-
-2006-09-05  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.AddImport): New.
-       (SerializationMap.GetSequence): Use AddImport.
-
-2006-09-04  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.GetSchemaSet): Remove.
-       (SerializationMap.GetSchemaType):
-       (SerializationMap.GetSequence):
-       (SerializationMap.GetSchema): Change XmlSchemas param to XmlSchemaSet.
-       Call XmlSchemaSet.Reprocess whenever an existing schema is modified.
-       * XsdDataContractExporter.cs (XsdDataContractExporter.Export): Update to
-       changes in SerializationMap.
-       (XsdDataContractExporter.CanExport): Implement.
-       (XsdDataContractExporter.GetSchemaType): Implement.
-       (XsdDataContractExporter.GetSchemaTypeName): Implement.
-       (XsdDataContractExporter.KnownTypes): New.
-       (XsdDataContractExporter.GeneratedTypes): New.
-
-2006-09-01  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.GetSchemaSet): New.
-       (SerializationMap.IsPrimitive): New.
-       (SerializationMap.GetSchemaType): New.
-       (SerializationMap.GetSequence): New.
-       (SerializationMap.GetMembers): New.
-       (SerializationMap.GetSchemaElement): New.
-       (SerializationMap.GetSchema): New.
-       (SerializationMap.GetQualifiedName): New.
-       New methods for exporting schema for the type.
-
-       (SharedContractMap.ctor): Move code for building Members list to ..
-       (SharedContractMap.GetMembers): .. here.
-
-       (CollectionTypeMap.Serialize): Mark 'override'.
-       (CollectionTypeMap.GetMembers): 'override' and throw
-       NotImplementedException.
-       (CollectionTypeMap.GetSchemaType): Implement.
-
-       (SharedTypeMap..ctor): Move code to ..
-       (SharedTypeMap.GetMembers): .. here.
-       (EnumMap.GetSchemaType): Implement.
-
-       * XsdDataContractExporter.cs (XsdDataContractExporter.Export):
-       Implement.
-       * KnownTypeCollection.cs (KnownTypeCollection.GetCollectionQName): Use
-       GetQName instead of GetXmlName. Set Namespace for collections of
-       primitive types to MSArraysNamespace
-
-2006-08-31  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (EnumMap): New. For de/serializing enums.
-       (EnumMemberInfo): New.
-       (SerializationMap.DeserializeContent): Made protected virtual from private.
-       * DataContractSerializer.cs (WriteStartObject):
-       Ensure that "i:type" is not emitted for enums.
-       * KnownTypeCollection.cs (GetPrimitiveTypeName): Don't treat enum as a
-       primitive type.
-       (GetQName): Likewise. Use GetEnumQName for enums.
-       (GetEnumQName): New.
-       (IsPrimitiveNotEnum): New.
-       (TryRegister): Add support for enums.
-       (RegisterEnum): New.
-
-2006-08-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterSerializer.cs : (contd from my previous change)
-         ... and don't complain at WriteObject(). It is somehow required
-         in S.SM.D.WSTrustContract (soon to be committed).
-
-2006-07-27  Ankit Jain  <jankit@novell.com>
-
-       * XsdDataContractImporter.cs (Compile): Remove, thanks to eno
-       XmlSchemaSet.Compile () works now.
-       Update to directly use XmlSchemaSet.Compile ()
-
-2006-07-27  Ankit Jain  <jankit@novell.com>
-
-       * XsdDataContractImporter.cs (ImportInternal): New.
-       Update various overloads of Import to use this.
-       (ImportFromTypeMapping): New. Emits code for a DataContract from a
-       XmlTypeMapping. Code is duplicate of
-       ServiceContractGenerator.ExportDataContract .
-       (GetNamespace): New. Duplicate like above.
-       (Compile): New. Temporary hack, will XmlSchemaSet.Compile is not
-       working.
-
-2006-07-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterSerializer.cs, KnownTypeCollection.cs :
-         don't raise an error at DataContractSerializer..ctor(). Raise
-         InvalidDataContractException on WriteObject().
-
-2006-07-12  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (XmlSerializableMap): New. Map for classes which
-       implement IXmlSerializable interface.
-       * KnownTypeCollection.cs (KnownTypeCollection.GetQName): Add support for
-       types which implement IXmlSerializable interface. Change the order in
-       which DataContractAttribute/IXmlSerializable/SerializableAttribute get
-       selected.
-       (KnownTypeCollection.TryRegister): Change the order like above.
-       (KnownTypeCollection.RegisterIXmlSerializable): New.
-
-2006-07-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractExporter.cs, XmlObjectSerializer.cs,
-         InvalidDataContractException.cs : some June CTP updates.
-
-2006-07-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * IDataContractSurrogate.cs, ExportOptions.cs,
-         DataContractSerializer.cs, KnownTypeCollection.cs :
-         June CTP updates.
-
-2006-05-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : null knownTypes argument is allowed.
-       * KnownTypeCollection.cs : Type.Namespace could be null.
-
-2006-05-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : for nested classes, treat localName of
-         the QName as "Parent.Child", not "Child".
-         Don't encode name here (to pass ".").
-
-2006-05-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs :
-         Added maxObjectsInGraph range check.
-         interface type has BaseType as null, so end base type check when
-         it is null (I don't think this check is required btw).
-
-2006-04-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : xmlns:xsi is not written when the
-         target type is string.
-
-2006-03-22  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (CheckDataContractEqual): Remove.
-       (Deserialize): Allows expected type to be a derived one from actual
-       type.
-       (DeserializeInternal): Handle DataMember of type 'object'.
-       * XmlFormatterSerializer.cs (SerializeNonPrimitive): Serialize types not
-       already known.
-       * DataContractSerializer.cs (.ctor): Use KnownTypeCollection.GetQName
-       instead of doing it manually.
-       (PopulateTypes): Change return type from KnownTypeCollection to void.
-       Scan the base types to ensure that all have DataContract or Serializable
-       attributes.
-       Add all (including inherited) KnownTypeAttribute values to the
-       collection.
-
-2006-03-18  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.GetEmptyInstance): Rename to ..
-       (SerializationMap.GetInstance): .. this. Gets the instance or null if nil=true.
-       (SerializationMap.DeserializeInternal): New. Renamed from .. 
-       (SerializationMap.Deserialize): .. this. Check DataContract equivalence, and use new
-       DeserializeInternal for rest of the work.
-       (DeserializeContent): Cleanup and handle various "null" cases.
-       * XmlFormatterSerializer.cs (Write_i_type): New. Write i:type=".."
-       (SerializeNonPrimitive): Update to use Write_i_type.
-       * DataContractSerializer.cs (WriteStartObject): Add rootType to known_types.
-
-2006-03-16  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.Deserialize): Use NameTable.Get
-       before reader.LookupNamespace.
-       (DataMemberInfo.Compare): Use String.CompareOrdinal instead of
-       String.Compare.
-
-2006-03-16  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.GetEmptyInstance): New.
-       (SerializationMap.Deserialize): Refactor, handle primitive types and nils.
-       (SerializationMap.DeserializeContent): Handle nils and nested DataContracts.
-       (SharedContractMap.ctor): Include inherited properties and fields, in
-       the correct order.
-
-2006-03-15  Ankit Jain  <jankit@novell.com>
-
-       * KnownTypeCollection.cs (IsPrimitiveType): New.
-       * SerializationMap.cs (Deserialize): Handle primitive types.
-
-2006-03-15  Ankit Jain  <jankit@novell.com>
-
-       * DataContractSerializer.cs (WriteObjectContent): Handle null.
-       (WriteStartObject): Rewritten.
-       * KnownTypeCollection.cs (GetQName): New. Return QName for a given type.        
-       (GetContractQName):
-       (GetSerializableQName):
-       (GetCollectionQName): New.
-       (RegisterContract):
-       (RegisterSerializable):
-       (RegisterCollection): Update to use new Get* methods.
-       * SerializationMap.cs (CheckDataContractEqual): New.
-       (Deserialize): Split into this and ..
-       (DeserializeContent): .. this.
-       * XmlDictionaryWriter.cs (CreateTextWriter): Use UTF8Encoding.
-
-2006-03-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : xmlns output should be done at
-         WriteStartObject().
-
-2006-03-08  Ankit Jain  <jankit@novell.com>
-
-       * DataContractSerializer.cs (.ctor): Use name & namespace specified (if any) 
-       with the DataContractAttribute for non-primitive types.
-       (DataContractSerializer.WriteStartObject): DataContractAttribute.Name
-       cannot be "".
-
-2006-03-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : Handle primitive type name rather than
-         raw type name in constructors that don't receive root QName.
-         In case the actual graph is not of root type, write xsi:type.
-
-2006-03-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : default namespace contains common MS base
-         URI fragment.
-       * XmlObjectSerializer.cs : added internal common utility field.
-       * DataContractSerializer.cs : Fixed constructors to fill fields and
-         make it work.
-       * NetDataContractSerializer.cs : just leave it unimplemented until
-         we find how it works. It looks different from what
-         DataContractSerializer does.
-
-2006-01-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatter.cs : extra namespaces are not written in Dec.CTP.
-
-2005-11-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : override.
-
-2005-11-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, XmlFormatterSerializer.cs, XmlFormatter.cs
-         XmlFormatterDeserializer.cs, KnownTypeCollection.cs :
-         several changes. Partial support for collection serialization.
-         SerializationMap now contains its own Deserialize()/Serialize()
-         methods.
-
-2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs : new file.
-       * SerializationMap.cs, XmlFormatter.cs, KnownTypeCollection.cs :
-         several changes for pretty primitive Deserialize() implementation.
-
-2005-10-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       Added hacky serialization feature. Actually it should be rewritten to
-       be based on IDataContractSurrogate.
-       * SerializationMap.cs, XmlFormatterSerializer.cs :
-         new files for Serialize() implementation.
-       * KnownTypeCollection.cs : use serialization maps to check contracts.
-       * XmlFormatter.cs : implemented hacky Serialize().
-       * DataMemberAttribute.cs : default Order is -1.
-       * DataContractAttribute.cs : added tiny comment.
-
-2005-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatter.cs : Added implementation switch between
-         BinaryFormatter and internal DataContractFormatter.
-       * XmlSerializableServices.cs : WriteNodes() impl.
-
-2005-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSerializableServices.cs : ReadNodes() impl.
-
-2005-09-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeAttribute.cs : fixed attribute usage.
-
-2005-09-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * IDataContractSurrogate.cs, ContractNamespaceAttribute.cs,
-         XsdDataContractExporter.cs, KnownTypeAttribute.cs,
-         SerializationMode.cs, XmlFormatter.cs, DataMemberAttribute.cs,
-         ImportOptions.cs, UnknownSerializationData.cs,
-         SerializationFactoryMethodAttribute.cs, XmlSerializableServices.cs,
-         DataContractAttribute.cs, ExportOptions.cs,
-         InvalidDataContractException.cs, IUnknownSerializationData.cs,
-         CollectionDataContractAttribute.cs, XsdDataContractImporter.cs,
-         KnownTypeCollection.cs :
-         #if NET_2_0. coding style was updated.
-
-2005-09-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * CollectionDataContractAttribute.cs
-         ContractNamespaceAttribute.cs
-         DataContractAttribute.cs
-         DataMemberAttribute.cs
-         ExportOptions.cs
-         IDataContractSurrogate.cs
-         InvalidDataContractException.cs
-         IUnknownSerializationData.cs
-         ImportOptions.cs
-         KnownTypeAttribute.cs
-         KnownTypeCollection.cs
-         SerializationFactoryMethodAttribute.cs
-         SerializationMode.cs
-         UnknownSerializationData.cs
-         XmlFormatter.cs
-         XmlSerializableServices.cs
-         XsdDataContractExporter.cs
-         XsdDataContractImporter.cs : new files.
-
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractResolver.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractResolver.cs
deleted file mode 100644 (file)
index 5a6dc28..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// DataContractResolver.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Xml;
-
-namespace System.Runtime.Serialization
-{
-       // See http://msdn.microsoft.com/en-us/library/ee358759.aspx
-       public
-       abstract class DataContractResolver
-       {
-               public abstract Type ResolveName (string typeName, string typeNamespace, Type declaredType, DataContractResolver knownTypeResolver);
-
-               public abstract bool TryResolveType (Type type, Type declaredType, DataContractResolver knownTypeResolver, out XmlDictionaryString typeName, out XmlDictionaryString typeNamespace);
-       }
-
-       internal class DefaultDataContractResolver : DataContractResolver
-       {
-               public DefaultDataContractResolver (DataContractSerializer serializer)
-               {
-                       this.serializer = serializer;
-               }
-
-               DataContractSerializer serializer;
-               XmlDictionary dictionary;
-
-               public override Type ResolveName (string typeName, string typeNamespace, Type declaredType, DataContractResolver knownTypeResolver)
-               {
-                       var map = serializer.InternalKnownTypes.FindUserMap (new XmlQualifiedName (typeName, typeNamespace));
-                       if (map == null)
-                               serializer.InternalKnownTypes.Add (declaredType);
-                       if (map != null)
-                               return map.RuntimeType;
-                       return null;
-               }
-
-               public override bool TryResolveType (Type type, Type declaredType, DataContractResolver knownTypeResolver, out XmlDictionaryString typeName, out XmlDictionaryString typeNamespace)
-               {
-                       var map = serializer.InternalKnownTypes.FindUserMap (type);
-                       if (map == null) {
-                               typeName = null;
-                               typeNamespace = null;
-                               return false;
-                       } else {
-                               dictionary = dictionary ?? new XmlDictionary ();
-                               typeName = dictionary.Add (map.XmlName.Name);
-                               typeNamespace = dictionary.Add (map.XmlName.Namespace);
-                               return true;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs
deleted file mode 100755 (executable)
index 8a33e29..0000000
+++ /dev/null
@@ -1,565 +0,0 @@
-//
-// DataContractSerializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005-2007 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Reflection;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Xml;
-using System.Xml.Schema;
-using System.Xml.Serialization;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       public sealed class DataContractSerializer : XmlObjectSerializer
-       {
-               const string xmlns = "http://www.w3.org/2000/xmlns/";
-
-               Type type;
-               bool ignore_ext, preserve_refs;
-
-               // This is only for compatible mode.
-               StreamingContext context;
-               ReadOnlyCollection<Type> returned_known_types;
-               KnownTypeCollection known_types;
-               List<Type> specified_known_types;
-               IDataContractSurrogate surrogate;
-               DataContractResolver resolver, default_resolver;
-
-               int max_items = 0x10000; // FIXME: could be from config.
-
-               bool names_filled;
-               XmlDictionaryString root_name, root_ns;
-
-               public DataContractSerializer (Type type)
-                       : this (type, Type.EmptyTypes)
-               {
-                       // nothing to do here.
-               }
-
-               public DataContractSerializer (Type type,
-                       IEnumerable<Type> knownTypes)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       this.type = type;
-                       PopulateTypes (knownTypes);
-                       known_types.Add (type);
-                       QName qname = known_types.GetQName (type);
-
-                       FillDictionaryString (qname.Name, qname.Namespace);
-
-               }
-
-               public DataContractSerializer (Type type, string rootName,
-                       string rootNamespace)
-                       : this (type, rootName, rootNamespace, Type.EmptyTypes)
-               {
-                       // nothing to do here.
-               }
-
-               public DataContractSerializer (Type type,
-                       XmlDictionaryString rootName,
-                       XmlDictionaryString rootNamespace)
-                       : this (type, rootName, rootNamespace, Type.EmptyTypes)
-               {
-                       // nothing to do here.
-               }
-
-               public DataContractSerializer (Type type, string rootName,
-                       string rootNamespace, IEnumerable<Type> knownTypes)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       if (rootName == null)
-                               throw new ArgumentNullException ("rootName");
-                       if (rootNamespace == null)
-                               throw new ArgumentNullException ("rootNamespace");
-                       this.type = type;
-                       PopulateTypes (knownTypes);
-                       FillDictionaryString (rootName, rootNamespace);
-               }
-
-               public DataContractSerializer (Type type,
-                       XmlDictionaryString rootName,
-                       XmlDictionaryString rootNamespace,
-                       IEnumerable<Type> knownTypes)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       if (rootName == null)
-                               throw new ArgumentNullException ("rootName");
-                       if (rootNamespace == null)
-                               throw new ArgumentNullException ("rootNamespace");
-                       this.type = type;
-                       PopulateTypes (knownTypes);
-                       root_name = rootName;
-                       root_ns = rootNamespace;
-               }
-
-               public DataContractSerializer (Type type,
-                       IEnumerable<Type> knownTypes,
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate)
-                       : this (type, knownTypes)
-               {
-                       Initialize (maxObjectsInGraph,
-                               ignoreExtensionDataObject,
-                               preserveObjectReferences,
-                               dataContractSurrogate);
-               }
-
-               public DataContractSerializer (Type type,
-                       string rootName,
-                       string rootNamespace,
-                       IEnumerable<Type> knownTypes,
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate)
-                       : this (type, rootName, rootNamespace, knownTypes)
-               {
-                       Initialize (maxObjectsInGraph,
-                               ignoreExtensionDataObject,
-                               preserveObjectReferences,
-                               dataContractSurrogate);
-               }
-
-               public DataContractSerializer (Type type,
-                       XmlDictionaryString rootName,
-                       XmlDictionaryString rootNamespace,
-                       IEnumerable<Type> knownTypes,
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate)
-                       : this (type, rootName, rootNamespace, knownTypes)
-               {
-                       Initialize (maxObjectsInGraph,
-                               ignoreExtensionDataObject,
-                               preserveObjectReferences,
-                               dataContractSurrogate);
-               }
-
-               public DataContractSerializer (Type type,
-                       IEnumerable<Type> knownTypes,
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate,
-                       DataContractResolver dataContractResolver)
-                       : this (type, knownTypes, maxObjectsInGraph, ignoreExtensionDataObject, preserveObjectReferences, dataContractSurrogate)
-               {
-                       DataContractResolver = dataContractResolver;
-               }
-
-               public DataContractSerializer (Type type,
-                       string rootName,
-                       string rootNamespace,
-                       IEnumerable<Type> knownTypes,
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate,
-                       DataContractResolver dataContractResolver)
-                       : this (type, rootName, rootNamespace, knownTypes, maxObjectsInGraph, ignoreExtensionDataObject, preserveObjectReferences, dataContractSurrogate)
-               {
-                       DataContractResolver = dataContractResolver;
-               }
-
-               public DataContractSerializer (Type type,
-                       XmlDictionaryString rootName,
-                       XmlDictionaryString rootNamespace,
-                       IEnumerable<Type> knownTypes,
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate,
-                       DataContractResolver dataContractResolver)
-                       : this (type, rootName, rootNamespace, knownTypes, maxObjectsInGraph, ignoreExtensionDataObject, preserveObjectReferences, dataContractSurrogate)
-               {
-                       DataContractResolver = dataContractResolver;
-               }
-
-               public DataContractSerializer (Type type, DataContractSerializerSettings settings)
-                       : this (type, settings.RootName, settings.RootNamespace, settings.KnownTypes,
-                               settings.MaxItemsInObjectGraph, settings.IgnoreExtensionDataObject,
-                               settings.PreserveObjectReferences, settings.DataContractSurrogate,
-                               settings.DataContractResolver)
-               {
-               }
-
-               void PopulateTypes (IEnumerable<Type> knownTypes)
-               {
-                       if (known_types == null)
-                               known_types = new KnownTypeCollection ();
-
-                       if (specified_known_types == null)
-                               specified_known_types = new List<Type> ();
-
-                       if (knownTypes != null) {
-                               foreach (Type t in knownTypes) {
-                                       known_types.Add (t);
-                                       specified_known_types.Add (t);
-                               }
-                       }
-
-                       RegisterTypeAsKnown (type);
-               }
-
-               void RegisterTypeAsKnown (Type type)
-               {
-                       if (known_types.Contains (type))
-                               return;
-
-                       Type elementType = type;
-                       if (type.HasElementType) {
-                               known_types.Add (type);
-                               elementType = type.GetElementType ();
-                       }
-
-                       known_types.Add (elementType);
-
-                       /* Get all KnownTypeAttribute-s, including inherited ones */
-                       object [] attrs = elementType.GetCustomAttributes (typeof (KnownTypeAttribute), true);
-                       for (int i = 0; i < attrs.Length; i ++) {
-                               KnownTypeAttribute kt = (KnownTypeAttribute) attrs [i];
-                               foreach (var t in kt.GetTypes (elementType))
-                                       RegisterTypeAsKnown (t);
-                       }
-               }
-
-               void FillDictionaryString (string name, string ns)
-               {
-                       XmlDictionary d = new XmlDictionary ();
-                       root_name = d.Add (name);
-                       root_ns = d.Add (ns);
-                       names_filled = true;
-               }
-
-               void Initialize (
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate)
-               {
-                       if (maxObjectsInGraph < 0)
-                               throw new ArgumentOutOfRangeException ("maxObjectsInGraph must not be negative.");
-                       max_items = maxObjectsInGraph;
-                       ignore_ext = ignoreExtensionDataObject;
-                       preserve_refs = preserveObjectReferences;
-                       surrogate = dataContractSurrogate;
-               }
-
-               public
-               DataContractResolver DataContractResolver {
-                       get { return resolver; }
-                       private set {
-                               resolver = value;
-                               default_resolver = default_resolver ?? new DefaultDataContractResolver (this);
-                       }
-               }
-
-               public bool IgnoreExtensionDataObject {
-                       get { return ignore_ext; }
-               }
-
-               public ReadOnlyCollection<Type> KnownTypes {
-                       get {
-                               if (returned_known_types == null)
-                                       returned_known_types = new ReadOnlyCollection<Type> (specified_known_types);
-                               return returned_known_types;
-                       }
-               }
-
-               internal KnownTypeCollection InternalKnownTypes {
-                       get { return known_types; }
-               }
-
-               public IDataContractSurrogate DataContractSurrogate {
-                       get { return surrogate; }
-               }
-
-               public int MaxItemsInObjectGraph {
-                       get { return max_items; }
-               }
-
-               public bool PreserveObjectReferences {
-                       get { return preserve_refs; }
-               }
-
-               public override bool IsStartObject (XmlDictionaryReader reader)
-               {
-                       if (reader == null)
-                               throw new ArgumentNullException ("reader");
-                       reader.MoveToContent ();
-                       return reader.IsStartElement (root_name, root_ns);
-               }
-
-               // SP1
-               public override bool IsStartObject (XmlReader reader)
-               {
-                       return IsStartObject (XmlDictionaryReader.CreateDictionaryReader (reader));
-               }
-
-               // SP1
-               public override object ReadObject (XmlReader reader)
-               {
-                       return ReadObject (XmlDictionaryReader.CreateDictionaryReader (reader));
-               }
-
-               public override object ReadObject (XmlReader reader, bool verifyObjectName)
-               {
-                       return ReadObject (XmlDictionaryReader.CreateDictionaryReader (reader), verifyObjectName);
-               }
-
-               public override object ReadObject (XmlDictionaryReader reader, bool verifyObjectName)
-               {
-                       int startTypeCount = known_types.Count;
-                       known_types.Add (type);
-
-                       bool isEmpty = reader.IsEmptyElement;
-
-                       object ret = XmlFormatterDeserializer.Deserialize (reader, type,
-                               known_types, surrogate, DataContractResolver, default_resolver, root_name.Value, root_ns.Value, verifyObjectName);
-
-                       // remove temporarily-added known types for
-                       // rootType and object graph type.
-                       while (known_types.Count > startTypeCount)
-                               known_types.RemoveAt (startTypeCount);
-
-                       return ret;
-               }
-
-               public object ReadObject (XmlDictionaryReader reader, bool verifyObjectName, DataContractResolver resolver)
-               {
-                       var bak = DataContractResolver;
-                       try {
-                               DataContractResolver = resolver;
-                               return ReadObject (reader, verifyObjectName);
-                       } finally {
-                               DataContractResolver = bak;
-                       }
-               }
-
-               // SP1
-               public override void WriteObject (XmlWriter writer, object graph)
-               {
-                       XmlDictionaryWriter w = XmlDictionaryWriter.CreateDictionaryWriter (writer);
-                       WriteObject (w, graph);
-               }
-
-               public void WriteObject (XmlDictionaryWriter writer, object graph, DataContractResolver resolver)
-               {
-                       var bak = DataContractResolver;
-                       try {
-                               DataContractResolver = resolver;
-                               WriteObject (writer, graph);
-                       } finally {
-                               DataContractResolver = bak;
-                       }
-               }
-
-               [MonoTODO ("use DataContractSurrogate")]
-               /*
-                       when writeContentOnly is true, then the input XmlWriter
-                       must be at element state. This is to write possible
-                       xsi:nil.
-
-                       rootType determines the top-level element QName (thus
-                       it is ignored when writeContentOnly is true).
-
-                       preserveObjectReferences indicates that whether the
-                       output should contain ms:Id or not.
-                       (http://schemas.microsoft.com/2003/10/Serialization/)
-               */
-               public override void WriteObjectContent (XmlDictionaryWriter writer, object graph)
-               {
-                       if (graph == null)
-                               return;
-
-                       int startTypeCount = known_types.Count;
-
-                       XmlFormatterSerializer.Serialize (writer, graph,
-                               type, known_types,
-                               ignore_ext, max_items, root_ns.Value, preserve_refs, DataContractResolver, default_resolver);
-
-                       // remove temporarily-added known types for
-                       // rootType and object graph type.
-                       while (known_types.Count > startTypeCount)
-                               known_types.RemoveAt (startTypeCount);
-               }
-
-               public override void WriteObjectContent (XmlWriter writer, object graph)
-               {
-                       XmlDictionaryWriter w = XmlDictionaryWriter.CreateDictionaryWriter (writer);
-                       WriteObjectContent (w, graph);
-               }
-
-               // SP1
-               public override void WriteStartObject (
-                       XmlWriter writer, object graph)
-               {
-                       WriteStartObject (XmlDictionaryWriter.CreateDictionaryWriter (writer), graph);
-               }
-
-               public override void WriteStartObject (
-                       XmlDictionaryWriter writer, object graph)
-               {
-                       Type rootType = type;
-
-                       if (IsAny())
-                               return;
-
-                       if (root_name.Value == "")
-                               throw new InvalidDataContractException ("Type '" + type.ToString () +
-                                       "' cannot have a DataContract attribute Name set to null or empty string.");
-
-                       if (graph == null) {
-                               if (names_filled)
-                                       writer.WriteStartElement (root_name.Value, root_ns.Value);
-                               else
-                                       writer.WriteStartElement (root_name, root_ns);
-                               writer.WriteAttributeString ("i", "nil", XmlSchema.InstanceNamespace, "true");
-                               return;
-                       }
-
-                       QName rootQName = null;
-                       XmlDictionaryString name, ns;
-                       var graphType = graph.GetType ();
-                       if (DataContractResolver != null && DataContractResolver.TryResolveType (graphType, type, default_resolver, out name, out ns))
-                               rootQName = new QName (name.Value, ns.Value);
-
-                       // It is error unless 1) TypeResolver resolved the type name, 2) the object is the exact type, 3) the object is known or 4) the type is primitive.
-
-                       QName collectionQName;
-                       if (KnownTypeCollection.IsInterchangeableCollectionType (type, graphType, out collectionQName)) {
-                               graphType = type;
-                               rootQName = collectionQName;
-                       } else if (graphType != type && rootQName == null && IsUnknownType (type, graphType))
-                               throw new SerializationException (String.Format ("Type '{0}' is unexpected. The type should either be registered as a known type, or DataContractResolver should be used.", graphType));
-
-                       QName instName = rootQName;
-                       rootQName = rootQName ?? known_types.GetQName (rootType);
-                       QName graph_qname = known_types.GetQName (graphType);
-
-                       known_types.Add (graphType);
-
-                       if (names_filled)
-                               writer.WriteStartElement (root_name.Value, root_ns.Value);
-                       else
-                               writer.WriteStartElement (root_name, root_ns);
-
-                       if (rootQName != graph_qname || rootQName.Namespace != KnownTypeCollection.MSSimpleNamespace && !rootType.IsEnum)
-                               //FIXME: Hack, when should the "i:type" be written?
-                               //Not used in case of enums
-                               writer.WriteXmlnsAttribute ("i", XmlSchema.InstanceNamespace);
-
-                       if (root_ns.Value != rootQName.Namespace)
-                               if (rootQName.Namespace != KnownTypeCollection.MSSimpleNamespace)
-                                       writer.WriteXmlnsAttribute (null, rootQName.Namespace);
-
-                       if (rootQName == graph_qname)
-                               return;
-
-                       /* Different names */
-                       known_types.Add (rootType);
-
-                       instName = instName ?? KnownTypeCollection.GetPredefinedTypeName (graphType);
-                       if (instName == QName.Empty)
-                               /* Not a primitive type */
-                               instName = graph_qname;
-                       else
-                               /* FIXME: Hack, .. see test WriteObject7 () */
-                               instName = new QName (instName.Name, XmlSchema.Namespace);
-
-/* // disabled as it now generates extraneous i:type output.
-                       // output xsi:type as rootType is not equivalent to the graph's type.
-                       writer.WriteStartAttribute ("i", "type", XmlSchema.InstanceNamespace);
-                       writer.WriteQualifiedName (instName.Name, instName.Namespace);
-                       writer.WriteEndAttribute ();
-*/
-               }
-
-               bool IsUnknownType (Type contractType, Type type)
-               {
-                       if (type.IsArray) {
-                               if (KnownTypeCollection.GetAttribute<CollectionDataContractAttribute> (contractType) != null ||
-                                   KnownTypeCollection.GetAttribute<DataContractAttribute> (contractType) != null)
-                                       return true;
-                       }
-                       return IsUnknownType (type);
-               }
-
-               bool IsUnknownType (Type type)
-               {
-                       if (known_types.Contains (type) ||
-                           KnownTypeCollection.GetPrimitiveTypeName (type) != QName.Empty)
-                               return false;
-                       if (type.IsArray)
-                               return IsUnknownType (type.GetElementType ());
-                       return true;
-               }
-
-               public override void WriteEndObject (XmlDictionaryWriter writer)
-               {
-                       if (IsAny())
-                               return;
-
-                       writer.WriteEndElement ();
-               }
-
-               // SP1
-               public override void WriteEndObject (XmlWriter writer)
-               {
-                       WriteEndObject (XmlDictionaryWriter.CreateDictionaryWriter (writer));
-               }
-
-               [MonoTODO]
-               public bool SerializeReadOnlyTypes {
-                       get { throw new NotImplementedException (); }
-               }
-
-               private bool IsAny ()
-               {
-                       var xpa = type.GetCustomAttribute<XmlSchemaProviderAttribute> (true);
-
-                       if (xpa != null)
-                               return xpa.IsAny;
-
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializerSettings.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializerSettings.cs
deleted file mode 100644 (file)
index 18a78e1..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// DataContractJsonSerializerSettings.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Xml;
-using System.Collections.Generic;
-
-namespace System.Runtime.Serialization {
-       public class DataContractSerializerSettings {
-               public DataContractResolver DataContractResolver { get; set; }
-               public IDataContractSurrogate DataContractSurrogate { get; set; }
-               public bool IgnoreExtensionDataObject { get; set; }
-               public IEnumerable<Type> KnownTypes { get; set; }
-               public int MaxItemsInObjectGraph { get; set; }
-               public bool PreserveObjectReferences { get; set; }
-               public XmlDictionaryString RootName { get; set; }
-               public XmlDictionaryString RootNamespace { get; set; }
-               public bool SerializeReadOnlyTypes { get; set; }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataMemberAttribute.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataMemberAttribute.cs
deleted file mode 100644 (file)
index be38301..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// DataMemberAttribute.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.Serialization
-{
-       [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field,
-               Inherited = false, AllowMultiple = false)]
-       public sealed class DataMemberAttribute : Attribute
-       {
-               bool is_required;
-               bool emit_default = true;
-               string name;
-               int order = -1;
-
-               public DataMemberAttribute ()
-               {
-               }
-
-               public bool EmitDefaultValue {
-                       get { return emit_default; }
-                       set { emit_default = value; }
-               }
-
-               public bool IsRequired {
-                       get { return is_required; }
-                       set { is_required = value; }
-               }
-
-               public string Name {
-                       get { return name; }
-                       set { name = value; }
-               }
-
-               public int Order {
-                       get { return order; }
-                       set { order = value; }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DateTimeFormat.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DateTimeFormat.cs
deleted file mode 100644 (file)
index a6dc358..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-// Authors:
-//      Martin Baulig (martin.baulig@xamarin.com)
-//
-// Copyright 2012 Xamarin Inc. (http://www.xamarin.com)
-//
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Globalization;
-
-namespace System.Runtime.Serialization {
-       [MonoTODO]
-       public class DateTimeFormat {
-               public DateTimeFormat (string formatString)
-               {
-                       throw new InvalidOperationException ();
-               }
-               
-               public DateTimeFormat (string formatString, IFormatProvider formatProvider)
-               {
-                       throw new InvalidOperationException ();
-               }
-               
-               public DateTimeStyles DateTimeStyles {
-                       get { throw new InvalidOperationException (); }
-                       set { throw new InvalidOperationException (); }
-               }
-
-               public IFormatProvider FormatProvider {
-                       get { throw new InvalidOperationException (); }
-               }
-
-               public string FormatString {
-                       get { throw new InvalidOperationException (); }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/EmitTypeInformation.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/EmitTypeInformation.cs
deleted file mode 100644 (file)
index 289dd5e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// IgnoreList.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-namespace System.Runtime.Serialization {
-       public enum EmitTypeInformation {
-               AsNeeded,
-               Always,
-               Never
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/EnumMemberAttribute.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/EnumMemberAttribute.cs
deleted file mode 100644 (file)
index 491eefb..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// EnumMemberAttribute.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.Serialization
-{
-       [AttributeUsage (AttributeTargets.Field,
-               Inherited = false, AllowMultiple = false)]
-       public sealed class EnumMemberAttribute : Attribute
-       {
-               string value;
-
-               public EnumMemberAttribute ()
-               {
-               }
-
-               public string Value {
-                       get { return value; }
-                       set { this.value = value; }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ExportOptions.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ExportOptions.cs
deleted file mode 100644 (file)
index 1067da2..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// ExportOptions.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Collections.ObjectModel;
-
-namespace System.Runtime.Serialization
-{
-       public class ExportOptions
-       {
-               IDataContractSurrogate surrogate;
-               const KnownTypeCollection known_types = null;
-
-               public ExportOptions ()
-               {
-               }
-
-               public IDataContractSurrogate DataContractSurrogate {
-                       get { return surrogate; }
-                       set { surrogate = value; }
-               }
-
-               [MonoTODO]
-               public Collection<Type> KnownTypes {
-                       get { return known_types; }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ExtensionDataObject.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ExtensionDataObject.cs
deleted file mode 100644 (file)
index faf07ef..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// ExtensionDataObject.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.ObjectModel;
-
-namespace System.Runtime.Serialization
-{
-       public sealed class ExtensionDataObject
-       {
-               object target;
-
-               internal ExtensionDataObject (object target)
-               {
-                       this.target = target;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IDataContractSurrogate.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IDataContractSurrogate.cs
deleted file mode 100644 (file)
index 94ae63d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// IDataContractSurrogate.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.CodeDom;
-using System.Collections.ObjectModel;
-using System.Reflection;
-
-namespace System.Runtime.Serialization
-{
-       public interface IDataContractSurrogate
-       {
-               object GetCustomDataToExport (MemberInfo memberInfo,
-                       Type dataContractType);
-               object GetCustomDataToExport (Type clrType,
-                       Type dataContractType);
-
-               Type GetDataContractType (Type type);
-
-               object GetDeserializedObject (object obj, Type targetType);
-
-               void GetKnownCustomDataTypes (Collection<Type> customDataTypes);
-
-               object GetObjectToSerialize (object obj, Type targetType);
-#if !NET_2_1
-               Type GetReferencedTypeOnImport (string typeName,
-                       string typeNamespace, object customData);
-
-               CodeTypeDeclaration ProcessImportedType (
-                       CodeTypeDeclaration typeDeclaration,
-                       CodeCompileUnit compileUnit);
-#endif
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IExtensibleDataObject.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IExtensibleDataObject.cs
deleted file mode 100644 (file)
index bc1b0f5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// IExtensibleDataObject.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Runtime.Serialization
-{
-       public interface IExtensibleDataObject
-       {
-               ExtensionDataObject ExtensionData { get; set; }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IgnoreDataMemberAttribute.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IgnoreDataMemberAttribute.cs
deleted file mode 100644 (file)
index 9302632..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// IgnoreDataMemberAttribute.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2009 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.Serialization
-{
-       [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field,
-               Inherited = false, AllowMultiple = false)]
-       public sealed class IgnoreDataMemberAttribute : Attribute
-       {
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ImportOptions.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ImportOptions.cs
deleted file mode 100644 (file)
index 6ddc6e3..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// ImportOptions.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.CodeDom.Compiler;
-using System.Collections.Generic;
-
-namespace System.Runtime.Serialization
-{
-       public class ImportOptions
-       {
-               IDataContractSurrogate surrogate;
-               ICollection<Type> referenced_collection_types =
-                       new List<Type> ();
-               ICollection<Type> referenced_types = new List<Type> ();
-               bool enable_data_binding;
-               bool generate_internal;
-               bool generate_serializable;
-               bool import_xml_type;
-               IDictionary<string, string> namespaces =
-                       new Dictionary<string, string> ();
-               CodeDomProvider code_provider;
-
-               public ImportOptions ()
-               {
-               }
-
-               public CodeDomProvider CodeProvider {
-                       get { return code_provider; }
-                       set { code_provider = value; }
-               }
-
-               [MonoTODO]
-               public IDataContractSurrogate DataContractSurrogate {
-                       get { return surrogate; }
-                       set { surrogate = value; }
-               }
-
-               [MonoTODO]
-               public bool EnableDataBinding {
-                       get { return enable_data_binding; }
-                       set { enable_data_binding = value; }
-               }
-
-               public bool GenerateInternal {
-                       get { return generate_internal; }
-                       set { generate_internal = value; }
-               }
-
-               public bool GenerateSerializable {
-                       get { return generate_serializable; }
-                       set { generate_serializable = value; }
-               }
-
-               [MonoTODO]
-               public bool ImportXmlType {
-                       get { return import_xml_type; }
-                       set { import_xml_type = value; }
-               }
-
-               public IDictionary<string, string> Namespaces {
-                       get { return namespaces; }
-               }
-
-               [MonoTODO]
-               public ICollection<Type> ReferencedCollectionTypes {
-                       get { return referenced_collection_types; }
-               }
-
-               [MonoTODO]
-               public ICollection<Type> ReferencedTypes {
-                       get { return referenced_types; }
-               }
-       }
-}
-
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/InvalidDataContractException.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/InvalidDataContractException.cs
deleted file mode 100644 (file)
index bbd9e11..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// InvalidDataContractException.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Xml;
-
-namespace System.Runtime.Serialization
-{
-       [Serializable]
-       public class InvalidDataContractException : Exception
-       {
-               public InvalidDataContractException ()
-                       : base ()
-               {
-               }
-
-               public InvalidDataContractException (string message)
-                       : base (message)
-               {
-               }
-
-               protected InvalidDataContractException (SerializationInfo info,
-                       StreamingContext context)
-                       : base (info, context)
-               {
-               }
-
-               public InvalidDataContractException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeAttribute.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeAttribute.cs
deleted file mode 100644 (file)
index 4ab8d1f..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// KnownTypeAttribute.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-namespace System.Runtime.Serialization
-{
-       [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct,
-               Inherited = true, AllowMultiple = true)]
-       public sealed class KnownTypeAttribute : Attribute
-       {
-               string method_name;
-               Type type;
-
-               public KnownTypeAttribute (string methodName)
-               {
-                       if (methodName == null)
-                               throw new ArgumentNullException ("methodName");
-                       method_name = methodName;
-               }
-
-               public KnownTypeAttribute (Type type)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       this.type = type;
-               }
-
-               public string MethodName {
-                       get { return method_name; }
-               }
-
-               public Type Type {
-                       get { return type; }
-               }
-
-               MethodInfo method_cache;
-
-               internal IEnumerable<Type> GetTypes (Type type)
-               {
-                       if (method_cache != null)
-                               return (IEnumerable<Type>) method_cache.Invoke (null, new object [0]);
-
-                       if (Type != null)
-                               return new Type [] {Type};
-                       else {
-                               var mi = type.GetMethod (MethodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static, null, Type.EmptyTypes, null);
-                               if (mi == null)
-                                       throw new InvalidDataContractException (String.Format ("KnownTypeAttribute on {0} specifies '{1}' method, but that does not exist. The methos must be static.", type, MethodName));
-                               if (!typeof (IEnumerable<Type>).IsAssignableFrom (mi.ReturnType))
-                                       throw new InvalidDataContractException (String.Format ("KnownTypeAttribute on {0} specifies '{1}' method, but it returns {2} which cannot be assignable from IEnumerable<Type>.", type, MethodName, mi.ReturnType));
-                               method_cache = mi;
-                               return GetTypes (type);
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs
deleted file mode 100755 (executable)
index 702e7f3..0000000
+++ /dev/null
@@ -1,1067 +0,0 @@
-//
-// KnownTypeCollection.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Reflection;
-using System.Xml;
-using System.Xml.Schema;
-
-using QName = System.Xml.XmlQualifiedName;
-using System.Xml.Serialization;
-
-namespace System.Runtime.Serialization
-{
-/*
-       XmlFormatter implementation design inference:
-
-       type definitions:
-       - No XML Schema types are directly used. There are some maps from
-         xs:blahType to ms:blahType where the namespaceURI for prefix "ms" is
-         "http://schemas.microsoft.com/2003/10/Serialization/" .
-
-       serializable types:
-       - An object being serialized 1) must be of type System.Object, or
-         2) must be null, or 3) must have either a [DataContract] attribute
-         or a [Serializable] attribute to be serializable.
-       - When the object is either of type System.Object or null, then the
-         XML type is "anyType".
-       - When the object is [Serializable], then the runtime-serialization
-         compatible object graph is written.
-       - Otherwise the serialization is based on contract attributes.
-         ([Serializable] takes precedence).
-
-       type derivation:
-       - For type A to be serializable, the base type B of A must be
-         serializable.
-       - If a type which is [Serializable] and whose base type has a
-         [DataContract], then for base type members [DataContract] is taken.
-       - It is vice versa i.e. if the base type is [Serializable] and the
-         derived type has a [DataContract], then [Serializable] takes place
-         for base members.
-
-       known type collection:
-       - It internally manages mapping store keyed by contract QNames.
-         KnownTypeCollection.Add() checks if the same QName contract already
-         exists (and raises InvalidOperationException if required).
-
-*/
-
-       internal static class TypeExtensions
-       {
-               public static IEnumerable<Type> GetInterfacesOrSelfInterface (this Type type)
-               {
-                       if (type.IsInterface)
-                               yield return type;
-                       foreach (var t in type.GetInterfaces ())
-                               yield return t;
-               }
-
-               public static bool ImplementsInterface (this Type type, Type iface)
-               {
-                       foreach (var t in type.GetInterfacesOrSelfInterface ()) {
-                               if (t == iface)
-                                       return true;
-                       }
-
-                       var baseType = type.BaseType;
-                       if (baseType != null)
-                               return baseType.ImplementsInterface (iface);
-                       
-                       return false;
-               }
-       }
-
-       internal sealed class KnownTypeCollection : Collection<Type>
-       {
-               internal const string MSSimpleNamespace =
-                       "http://schemas.microsoft.com/2003/10/Serialization/";
-               internal const string MSArraysNamespace =
-                       "http://schemas.microsoft.com/2003/10/Serialization/Arrays";
-               internal const string DefaultClrNamespaceBase =
-                       "http://schemas.datacontract.org/2004/07/";
-               internal const string DefaultClrNamespaceSystem =
-                       "http://schemas.datacontract.org/2004/07/System";
-
-
-               static QName any_type, bool_type,
-                       byte_type, date_type, decimal_type, double_type,
-                       float_type, string_type,
-                       short_type, int_type, long_type,
-                       ubyte_type, ushort_type, uint_type, ulong_type,
-                       // non-TypeCode
-                       any_uri_type, base64_type, duration_type, qname_type,
-                       // custom in ms nsURI schema
-                       char_type, guid_type,
-                       // not in ms nsURI schema
-                       dbnull_type, date_time_offset_type;
-
-               // XmlSchemaType.GetBuiltInPrimitiveType() does not exist in moonlight, so I had to explicitly add them. And now that we have it, it does not make much sense to use #if MOONLIGHT ... #endif for XmlSchemaType anymore :-(
-               static Dictionary<string,Type> xs_predefined_types = new Dictionary<string,Type> ();
-
-               static KnownTypeCollection ()
-               {
-                       string s = MSSimpleNamespace;
-                       any_type = new QName ("anyType", s);
-                       any_uri_type = new QName ("anyURI", s);
-                       bool_type = new QName ("boolean", s);
-                       base64_type = new QName ("base64Binary", s);
-                       date_type = new QName ("dateTime", s);
-                       duration_type = new QName ("duration", s);
-                       qname_type = new QName ("QName", s);
-                       decimal_type = new QName ("decimal", s);
-                       double_type = new QName ("double", s);
-                       float_type = new QName ("float", s);
-                       byte_type = new QName ("byte", s);
-                       short_type = new QName ("short", s);
-                       int_type = new QName ("int", s);
-                       long_type = new QName ("long", s);
-                       ubyte_type = new QName ("unsignedByte", s);
-                       ushort_type = new QName ("unsignedShort", s);
-                       uint_type = new QName ("unsignedInt", s);
-                       ulong_type = new QName ("unsignedLong", s);
-                       string_type = new QName ("string", s);
-                       guid_type = new QName ("guid", s);
-                       char_type = new QName ("char", s);
-
-                       dbnull_type = new QName ("DBNull", DefaultClrNamespaceBase + "System");
-                       date_time_offset_type = new QName ("DateTimeOffset", DefaultClrNamespaceBase + "System");
-
-                       xs_predefined_types.Add ("string", typeof (string));
-                       xs_predefined_types.Add ("boolean", typeof (bool));
-                       xs_predefined_types.Add ("float", typeof (float));
-                       xs_predefined_types.Add ("double", typeof (double));
-                       xs_predefined_types.Add ("decimal", typeof (decimal));
-                       xs_predefined_types.Add ("duration", typeof (TimeSpan));
-                       xs_predefined_types.Add ("dateTime", typeof (DateTime));
-                       xs_predefined_types.Add ("date", typeof (DateTime));
-                       xs_predefined_types.Add ("time", typeof (DateTime));
-                       xs_predefined_types.Add ("gYearMonth", typeof (DateTime));
-                       xs_predefined_types.Add ("gYear", typeof (DateTime));
-                       xs_predefined_types.Add ("gMonthDay", typeof (DateTime));
-                       xs_predefined_types.Add ("gDay", typeof (DateTime));
-                       xs_predefined_types.Add ("gMonth", typeof (DateTime));
-                       xs_predefined_types.Add ("hexBinary", typeof (byte []));
-                       xs_predefined_types.Add ("base64Binary", typeof (byte []));
-                       xs_predefined_types.Add ("anyURI", typeof (Uri));
-                       xs_predefined_types.Add ("QName", typeof (QName));
-                       xs_predefined_types.Add ("NOTATION", typeof (string));
-
-                       xs_predefined_types.Add ("normalizedString", typeof (string));
-                       xs_predefined_types.Add ("token", typeof (string));
-                       xs_predefined_types.Add ("language", typeof (string));
-                       xs_predefined_types.Add ("IDREFS", typeof (string []));
-                       xs_predefined_types.Add ("ENTITIES", typeof (string []));
-                       xs_predefined_types.Add ("NMTOKEN", typeof (string));
-                       xs_predefined_types.Add ("NMTOKENS", typeof (string []));
-                       xs_predefined_types.Add ("Name", typeof (string));
-                       xs_predefined_types.Add ("NCName", typeof (string));
-                       xs_predefined_types.Add ("ID", typeof (string));
-                       xs_predefined_types.Add ("IDREF", typeof (string));
-                       xs_predefined_types.Add ("ENTITY", typeof (string));
-
-                       xs_predefined_types.Add ("integer", typeof (decimal));
-                       xs_predefined_types.Add ("nonPositiveInteger", typeof (int));
-                       xs_predefined_types.Add ("negativeInteger", typeof (int));
-                       xs_predefined_types.Add ("long", typeof (long));
-                       xs_predefined_types.Add ("int", typeof (int));
-                       xs_predefined_types.Add ("short", typeof (short));
-                       xs_predefined_types.Add ("byte", typeof (sbyte));
-                       xs_predefined_types.Add ("nonNegativeInteger", typeof (decimal));
-                       xs_predefined_types.Add ("unsignedLong", typeof (ulong));
-                       xs_predefined_types.Add ("unsignedInt", typeof (uint));
-                       xs_predefined_types.Add ("unsignedShort", typeof (ushort));
-                       xs_predefined_types.Add ("unsignedByte", typeof (byte));
-                       xs_predefined_types.Add ("positiveInteger", typeof (decimal));
-
-                       xs_predefined_types.Add ("anyType", typeof (object));
-               }
-
-               // FIXME: find out how QName and guid are processed
-
-               internal QName GetXmlName (Type type)
-               {
-                       SerializationMap map = FindUserMap (type);
-                       if (map != null)
-                               return map.XmlName;
-                       return GetPredefinedTypeName (type);
-               }
-
-               internal static QName GetPredefinedTypeName (Type type)
-               {
-                       QName name = GetPrimitiveTypeName (type);
-                       if (name != QName.Empty)
-                               return name;
-                       if (type == typeof (DBNull))
-                               return dbnull_type;
-                       return QName.Empty;
-               }
-
-               internal static QName GetPrimitiveTypeName (Type type)
-               {
-                       if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>))
-                               return GetPrimitiveTypeName (type.GetGenericArguments () [0]);
-
-                       if (type.IsEnum)
-                               return QName.Empty;
-
-                       switch (Type.GetTypeCode (type)) {
-                       case TypeCode.Object: // other than System.Object
-                       case TypeCode.DBNull: // it is natively mapped, but not in ms serialization namespace.
-                       case TypeCode.Empty:
-                       default:
-                               if (type == typeof (object))
-                                       return any_type;
-                               if (type == typeof (Guid))
-                                       return guid_type;
-                               if (type == typeof (TimeSpan))
-                                       return duration_type;
-                               if (type == typeof (byte []))
-                                       return base64_type;
-                               if (type == typeof (Uri))
-                                       return any_uri_type;
-                               if (type == typeof (DateTimeOffset))
-                                       return date_time_offset_type;
-                               return QName.Empty;
-                       case TypeCode.Boolean:
-                               return bool_type;
-                       case TypeCode.Byte:
-                               return ubyte_type;
-                       case TypeCode.Char:
-                               return char_type;
-                       case TypeCode.DateTime:
-                               return date_type;
-                       case TypeCode.Decimal:
-                               return decimal_type;
-                       case TypeCode.Double:
-                               return double_type;
-                       case TypeCode.Int16:
-                               return short_type;
-                       case TypeCode.Int32:
-                               return int_type;
-                       case TypeCode.Int64:
-                               return long_type;
-                       case TypeCode.SByte:
-                               return byte_type;
-                       case TypeCode.Single:
-                               return float_type;
-                       case TypeCode.String:
-                               return string_type;
-                       case TypeCode.UInt16:
-                               return ushort_type;
-                       case TypeCode.UInt32:
-                               return uint_type;
-                       case TypeCode.UInt64:
-                               return ulong_type;
-                       }
-               }
-
-               internal static string PredefinedTypeObjectToString (object obj)
-               {
-                       Type type = obj.GetType ();
-                       switch (Type.GetTypeCode (type)) {
-                       case TypeCode.Object: // other than System.Object
-                       case TypeCode.Empty:
-                       default:
-                               if (type == typeof (object))
-                                       return String.Empty;
-                               if (type == typeof (Guid))
-                                       return XmlConvert.ToString ((Guid) obj);
-                               if (type == typeof (TimeSpan))
-                                       return XmlConvert.ToString ((TimeSpan) obj);
-                               if (type == typeof (byte []))
-                                       return Convert.ToBase64String ((byte []) obj);
-                               if (type == typeof (Uri))
-                                       return ((Uri) obj).ToString ();
-                               throw new Exception ("Internal error: missing predefined type serialization for type " + type.FullName);
-                       case TypeCode.DBNull: // predefined, but not primitive
-                               return String.Empty;
-                       case TypeCode.Boolean:
-                               return XmlConvert.ToString ((bool) obj);
-                       case TypeCode.Byte:
-                               return XmlConvert.ToString ((int)((byte) obj));
-                       case TypeCode.Char:
-                               return XmlConvert.ToString ((uint) (char) obj);
-                       case TypeCode.DateTime:
-                               return XmlConvert.ToString ((DateTime) obj, XmlDateTimeSerializationMode.RoundtripKind);
-                       case TypeCode.Decimal:
-                               return XmlConvert.ToString ((decimal) obj);
-                       case TypeCode.Double:
-                               return XmlConvert.ToString ((double) obj);
-                       case TypeCode.Int16:
-                               return XmlConvert.ToString ((short) obj);
-                       case TypeCode.Int32:
-                               return XmlConvert.ToString ((int) obj);
-                       case TypeCode.Int64:
-                               return XmlConvert.ToString ((long) obj);
-                       case TypeCode.SByte:
-                               return XmlConvert.ToString ((sbyte) obj);
-                       case TypeCode.Single:
-                               return XmlConvert.ToString ((float) obj);
-                       case TypeCode.String:
-                               return (string) obj;
-                       case TypeCode.UInt16:
-                               return XmlConvert.ToString ((int) (ushort) obj);
-                       case TypeCode.UInt32:
-                               return XmlConvert.ToString ((uint) obj);
-                       case TypeCode.UInt64:
-                               return XmlConvert.ToString ((ulong) obj);
-                       }
-               }
-
-               internal static Type GetPrimitiveTypeFromName (QName name)
-               {
-                       switch (name.Namespace) {
-                       case DefaultClrNamespaceSystem:
-                               switch (name.Name) {
-                               case "DBNull":
-                                       return typeof (DBNull);
-                               case "DateTimeOffset":
-                                       return typeof (DateTimeOffset);
-                               }
-                               break;
-                       case XmlSchema.Namespace:
-                               return xs_predefined_types.FirstOrDefault (p => p.Key == name.Name).Value;
-                       case MSSimpleNamespace:
-                               switch (name.Name) {
-                               case "anyURI":
-                                       return typeof (Uri);
-                               case "boolean":
-                                       return typeof (bool);
-                               case "base64Binary":
-                                       return typeof (byte []);
-                               case "dateTime":
-                                       return typeof (DateTime);
-                               case "duration":
-                                       return typeof (TimeSpan);
-                               case "QName":
-                                       return typeof (QName);
-                               case "decimal":
-                                       return typeof (decimal);
-                               case "double":
-                                       return typeof (double);
-                               case "float":
-                                       return typeof (float);
-                               case "byte":
-                                       return typeof (sbyte);
-                               case "short":
-                                       return typeof (short);
-                               case "int":
-                                       return typeof (int);
-                               case "long":
-                                       return typeof (long);
-                               case "unsignedByte":
-                                       return typeof (byte);
-                               case "unsignedShort":
-                                       return typeof (ushort);
-                               case "unsignedInt":
-                                       return typeof (uint);
-                               case "unsignedLong":
-                                       return typeof (ulong);
-                               case "string":
-                                       return typeof (string);
-                               case "anyType":
-                                       return typeof (object);
-                               case "guid":
-                                       return typeof (Guid);
-                               case "char":
-                                       return typeof (char);
-                               }
-                               break;
-                       }
-                       return null;
-               }
-
-
-               internal static object PredefinedTypeStringToObject (string s,
-                       string name, XmlReader reader)
-               {
-                       switch (name) {
-                       case "anyURI":
-                               return new Uri(s,UriKind.RelativeOrAbsolute);
-                       case "boolean":
-                               return XmlConvert.ToBoolean (s);
-                       case "base64Binary":
-                               return Convert.FromBase64String (s);
-                       case "dateTime":
-                               return XmlConvert.ToDateTime (s, XmlDateTimeSerializationMode.RoundtripKind);
-                       case "duration":
-                               return XmlConvert.ToTimeSpan (s);
-                       case "QName":
-                               int idx = s.IndexOf (':');
-                               string l = idx < 0 ? s : s.Substring (idx + 1);
-                               return idx < 0 ? new QName (l) :
-                                       new QName (l, reader.LookupNamespace (
-                                               s.Substring (0, idx)));
-                       case "decimal":
-                               return XmlConvert.ToDecimal (s);
-                       case "double":
-                               return XmlConvert.ToDouble (s);
-                       case "float":
-                               return XmlConvert.ToSingle (s);
-                       case "byte":
-                               return XmlConvert.ToSByte (s);
-                       case "short":
-                               return XmlConvert.ToInt16 (s);
-                       case "int":
-                               return XmlConvert.ToInt32 (s);
-                       case "long":
-                               return XmlConvert.ToInt64 (s);
-                       case "unsignedByte":
-                               return XmlConvert.ToByte (s);
-                       case "unsignedShort":
-                               return XmlConvert.ToUInt16 (s);
-                       case "unsignedInt":
-                               return XmlConvert.ToUInt32 (s);
-                       case "unsignedLong":
-                               return XmlConvert.ToUInt64 (s);
-                       case "string":
-                               return s;
-                       case "guid":
-                               return XmlConvert.ToGuid (s);
-                       case "anyType":
-                               return s;
-                       case "char":
-                               return (char) XmlConvert.ToUInt32 (s);
-                       default:
-                               throw new Exception ("Unanticipated primitive type: " + name);
-                       }
-               }
-
-               List<SerializationMap> contracts = new List<SerializationMap> ();
-
-               public KnownTypeCollection ()
-               {
-               }
-
-               protected override void ClearItems ()
-               {
-                       base.Clear ();
-               }
-
-               protected override void InsertItem (int index, Type type)
-               {
-                       if (ShouldNotRegister (type))
-                               return;
-                       if (!Contains (type)) {
-                               TryRegister (type);
-                               base.InsertItem (index, type);
-                       }
-               }
-
-               // FIXME: it could remove other types' dependencies.
-               protected override void RemoveItem (int index)
-               {
-                       lock (this)
-                               DoRemoveItem (index);
-               }
-
-               void DoRemoveItem (int index)
-               {
-                       Type t = base [index];
-                       List<SerializationMap> l = new List<SerializationMap> ();
-                       foreach (SerializationMap m in contracts) {
-                               if (m.RuntimeType == t)
-                                       l.Add (m);
-                       }
-                       foreach (SerializationMap m in l) {
-                               contracts.Remove (m);
-                               base.RemoveItem (index);
-                       }
-               }
-
-               protected override void SetItem (int index, Type type)
-               {
-                       if (ShouldNotRegister (type))
-                               return;
-
-                       // Since this collection is not assured to be ordered, it ignores the whole Set operation if the type already exists.
-                       if (Contains (type))
-                               return;
-
-                       if (index != Count)
-                               RemoveItem (index);
-                       if (TryRegister (type))
-                               base.InsertItem (index - 1, type);
-               }
-
-               internal SerializationMap FindUserMap (Type type)
-               {
-                       lock (this) {
-                               for (int i = 0; i < contracts.Count; i++)
-                                       if (type == contracts [i].RuntimeType)
-                                               return contracts [i];
-                               return null;
-                       }
-               }
-
-               internal SerializationMap FindUserMap (QName qname)
-               {
-                       lock (this)
-                               return contracts.FirstOrDefault (c => c.XmlName == qname);
-               }
-
-               internal SerializationMap FindUserMap (QName qname, Type type)
-               {
-                       lock (this)
-                               return contracts.FirstOrDefault (c => c.XmlName == qname && c.RuntimeType == type);
-               }
-
-               internal Type GetSerializedType (Type type)
-               {
-                       if (IsPrimitiveNotEnum (type))
-                               return type;
-                       Type element = GetCollectionElementType (type);
-                       if (element == null)
-                               return type;
-                       QName name = GetQName (type);
-                       var map = FindUserMap (name, type);
-                       if (map != null)
-                               return map.RuntimeType;
-                       return type;
-               }
-
-               internal QName GetQName (Type type)
-               {
-                       SerializationMap map = FindUserMap (type);
-                       if (map != null)
-                               // already mapped.
-                               return map.XmlName;
-                       return GetStaticQName (type);
-               }
-
-               public static QName GetStaticQName (Type type)
-               {
-                       if (IsPrimitiveNotEnum (type))
-                               return GetPrimitiveTypeName (type);
-
-                       if (type.IsEnum)
-                               return GetEnumQName (type);
-
-                       QName qname = GetContractQName (type);
-                       if (qname != null)
-                               return qname;
-
-                       if (type.GetInterface ("System.Xml.Serialization.IXmlSerializable") != null)
-                               //FIXME: Reusing GetSerializableQName here, since we just
-                               //need name of the type..
-                               return GetSerializableQName (type);
-
-                       qname = GetCollectionContractQName (type);
-                       if (qname != null)
-                               return qname;
-
-                       Type element = GetCollectionElementType (type);
-                       if (element != null) {
-                               if (type.IsInterface || IsCustomCollectionType (type, element))
-                                       return GetCollectionQName (element);
-                       }
-
-                       if (GetAttribute<SerializableAttribute> (type) != null)
-                               return GetSerializableQName (type);
-
-                       // default type map - still uses GetContractQName().
-                       return GetContractQName (type, null, null);
-               }
-
-               internal static QName GetContractQName (Type type)
-               {
-                       var a = GetAttribute<DataContractAttribute> (type);
-                       return a == null ? null : GetContractQName (type, a.Name, a.Namespace);
-               }
-
-               static QName GetCollectionContractQName (Type type)
-               {
-                       var a = GetAttribute<CollectionDataContractAttribute> (type);
-                       return a == null ? null : GetContractQName (type, a.Name, a.Namespace);
-               }
-
-               static QName GetContractQName (Type type, string name, string ns)
-               {
-                       if (name == null)
-                               name = GetDefaultName (type);
-                       else if (type.IsGenericType) {
-                               var args = type.GetGenericArguments ();
-                               for (int i = 0; i < args.Length; i++)
-                                       name = name.Replace ("{" + i + "}", GetStaticQName (args [i]).Name);
-                       }
-
-                       if (ns == null)
-                               ns = GetDefaultNamespace (type);
-                       return new QName (name, ns);
-               }
-
-               static QName GetEnumQName (Type type)
-               {
-                       string name = null, ns = null;
-
-                       if (!type.IsEnum)
-                               return null;
-
-                       var dca = GetAttribute<DataContractAttribute> (type);
-
-                       if (dca != null) {
-                               ns = dca.Namespace;
-                               name = dca.Name;
-                       }
-
-                       if (ns == null)
-                               ns = GetDefaultNamespace (type);
-
-                       if (name == null)
-                               name = type.Namespace == null ? type.Name : type.FullName.Substring (type.Namespace.Length + 1).Replace ('+', '.');
-
-                       return new QName (name, ns);
-               }
-
-               internal static string GetDefaultName (Type type)
-               {
-                       // FIXME: there could be decent ways to get
-                       // the same result...
-                       string name = type.Namespace == null || type.Namespace.Length == 0 ? type.Name : type.FullName.Substring (type.Namespace.Length + 1).Replace ('+', '.');
-                       if (type.IsGenericType) {
-                               name = name.Substring (0, name.IndexOf ('`')) + "Of";
-                               foreach (var t in type.GetGenericArguments ())
-                                       name += t.Name; // FIXME: check namespaces too
-                       }
-                       return name;
-               }
-
-               internal static string GetDefaultNamespace (Type type)
-               {
-                       foreach (ContractNamespaceAttribute a in type.Assembly.GetCustomAttributes (typeof (ContractNamespaceAttribute), true))
-                               if (a.ClrNamespace == type.Namespace)
-                                       return a.ContractNamespace;
-                       return DefaultClrNamespaceBase + type.Namespace;
-               }
-
-               static QName GetCollectionQName (Type element)
-               {
-                       QName eqname = GetStaticQName (element);
-
-                       string ns = eqname.Namespace;
-                       if (eqname.Namespace == MSSimpleNamespace)
-                               //Arrays of Primitive types
-                               ns = MSArraysNamespace;
-
-                       return new QName (
-                               "ArrayOf" + XmlConvert.EncodeLocalName (eqname.Name),
-                               ns);
-               }
-
-               static QName GetSerializableQName (Type type)
-               {
-                       // First, check XmlSchemaProviderAttribute and try GetSchema() to see if it returns a schema in the expected format.
-                       var xpa = type.GetCustomAttribute<XmlSchemaProviderAttribute> (true);
-                       if (xpa != null) {
-                               if (xpa.IsAny)
-                                       return XmlQualifiedName.Empty;
-                               var mi = type.GetMethod (xpa.MethodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
-                               if (mi != null) {
-                                       try {
-                                               var xss = new XmlSchemaSet ();
-                                               return (XmlQualifiedName) mi.Invoke (null, new object [] {xss});
-                                       } catch {
-                                               // ignore.
-                                       }
-                               }
-                       }
-
-                       string xmlName = type.Name;
-                       if (type.IsGenericType) {
-                               xmlName = xmlName.Substring (0, xmlName.IndexOf ('`')) + "Of";
-                               foreach (var t in type.GetGenericArguments ())
-                                       xmlName += GetStaticQName (t).Name; // FIXME: check namespaces too
-                       }
-                       string xmlNamespace = GetDefaultNamespace (type);
-                       var x = GetAttribute<XmlRootAttribute> (type);
-                       if (x != null) {
-                               xmlName = x.ElementName;
-                               xmlNamespace = x.Namespace;
-                       }
-                       return new QName (XmlConvert.EncodeLocalName (xmlName), xmlNamespace);
-               }
-
-               static bool IsPrimitiveNotEnum (Type type)
-               {
-                       if (type.IsEnum)
-                               return false;
-                       if (Type.GetTypeCode (type) != TypeCode.Object) // explicitly primitive
-                               return true;
-                       if (type == typeof (Guid) || type == typeof (object) || type == typeof(TimeSpan) || type == typeof(byte[]) || type == typeof(Uri) || type == typeof(DateTimeOffset)) // special primitives
-                               return true;
-                       // DOM nodes
-                       if (type == typeof (XmlElement) || type == typeof (XmlNode []))
-                               return true;
-                       // nullable
-                       if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>))
-                               return IsPrimitiveNotEnum (type.GetGenericArguments () [0]);
-                       return false;
-               }
-
-               bool ShouldNotRegister (Type type)
-               {
-                       return IsPrimitiveNotEnum (type);
-               }
-
-               internal bool TryRegister (Type type)
-               {
-                       lock (this) {
-                               return DoTryRegister (type);
-                       }
-               }
-
-               bool DoTryRegister (Type type)
-               {
-                       // exclude predefined maps
-                       if (ShouldNotRegister (type))
-                               return false;
-
-                       if (FindUserMap (type) != null)
-                               return false;
-
-                       if (RegisterEnum (type) != null)
-                               return true;
-
-                       if (RegisterDictionary (type) != null)
-                               return true;
-
-                       if (RegisterCollectionContract (type) != null)
-                               return true;
-
-                       if (RegisterContract (type) != null)
-                               return true;
-
-                       if (RegisterIXmlSerializable (type) != null)
-                               return true;
-
-                       if (RegisterCollection (type) != null)
-                               return true;
-
-                       if (GetAttribute<SerializableAttribute> (type) != null) {
-                               RegisterSerializable (type);
-                               return true;
-                       }
-
-                       RegisterDefaultTypeMap (type);
-                       return true;
-               }
-
-               static Type GetCollectionElementType (Type type)
-               {
-                       if (type.IsArray)
-                               return type.GetElementType ();
-                       var ifaces = type.GetInterfacesOrSelfInterface ();
-                       foreach (Type i in ifaces)
-                               if (i.IsGenericType && i.GetGenericTypeDefinition ().Equals (typeof (IEnumerable<>)))
-                                       return i.GetGenericArguments () [0];
-                       foreach (Type i in ifaces)
-                               if (i == typeof (IEnumerable))
-                                       return typeof (object);
-                       return null;
-               }
-
-               internal static T GetAttribute<T> (ICustomAttributeProvider ap) where T : Attribute
-               {
-                       object [] atts = ap.GetCustomAttributes (typeof (T), false);
-                       return atts.Length == 0 ? null : (T) atts [0];
-               }
-
-               private CollectionContractTypeMap RegisterCollectionContract (Type type)
-               {
-                       var cdca = GetAttribute<CollectionDataContractAttribute> (type);
-                       if (cdca == null)
-                               return null;
-
-                       Type element = GetCollectionElementType (type);
-                       if (element == null)
-                               throw new InvalidDataContractException (String.Format ("Type '{0}' is marked as collection contract, but it is not a collection", type));
-                       if (type.GetMethod ("Add", new Type[] { element }) == null)
-                               throw new InvalidDataContractException (String.Format ("Type '{0}' is marked as collection contract, but missing a public \"Add\" method", type));
-
-                       TryRegister (element); // must be registered before the name conflict check.
-
-                       QName qname = GetCollectionContractQName (type);
-                       CheckStandardQName (qname);
-                       var map = FindUserMap (qname, type);
-                       if (map != null) {
-                               var cmap = map as CollectionContractTypeMap;
-                               if (cmap == null) // The runtime type may still differ (between array and other IList; see bug #670560)
-                                       throw new InvalidOperationException (String.Format ("Failed to add type {0} to known type collection. There already is a registered type for XML name {1}", type, qname));
-                       }
-
-                       var ret = new CollectionContractTypeMap (type, cdca, element, qname, this);
-                       contracts.Add (ret);
-                       return ret;
-               }
-
-               private CollectionTypeMap RegisterCollection (Type type)
-               {
-                       Type element = GetCollectionElementType (type);
-                       if (element == null)
-                               return null;
-
-                       TryRegister (element);
-
-                       /*
-                        * To qualify as a custom collection type, a type must have
-                        * a public parameterless constructor and an "Add" method
-                        * with the correct parameter type in addition to implementing
-                        * one of the collection interfaces.
-                        * 
-                        */
-
-                       if (!type.IsArray && type.IsClass && !IsCustomCollectionType (type, element))
-                               return null;
-
-                       QName qname = GetCollectionQName (element);
-
-                       var map = FindUserMap (qname, element);
-                       if (map != null) {
-                               var cmap = map as CollectionTypeMap;
-                               if (cmap == null) // The runtime type may still differ (between array and other IList; see bug #670560)
-                                       throw new InvalidOperationException (String.Format ("Failed to add type {0} to known type collection. There already is a registered type for XML name {1}", type, qname));
-                               return cmap;
-                       }
-
-                       CollectionTypeMap ret =
-                               new CollectionTypeMap (type, element, qname, this);
-                       contracts.Add (ret);
-                       return ret;
-               }
-
-               static bool IsCustomCollectionType (Type type, Type elementType)
-               {
-                       if (!type.IsClass)
-                               return false;
-                       if (type.GetConstructor (new Type [0]) == null)
-                               return false;
-                       if (type.GetMethod ("Add", new Type[] { elementType }) == null)
-                               return false;
-
-                       return true;
-               }
-
-               internal static bool IsInterchangeableCollectionType (Type contractType, Type graphType,
-                                                                     out QName collectionQName)
-               {
-                       collectionQName = null;
-                       if (GetAttribute<CollectionDataContractAttribute> (contractType) != null)
-                               return false;
-
-                       var type = contractType;
-                       if (type.IsGenericType)
-                               type = type.GetGenericTypeDefinition ();
-
-                       var elementType = GetCollectionElementType (contractType);
-                       if (elementType == null)
-                               return false;
-                       
-                       if (contractType.IsArray) {
-                               if (!graphType.IsArray || !elementType.Equals (graphType.GetElementType ()))
-                                       throw new InvalidCastException (String.Format ("Type '{0}' cannot be converted into '{1}'.", graphType.GetElementType (), elementType));
-                       } else if (!contractType.IsInterface) {
-                               if (GetAttribute<SerializableAttribute> (contractType) == null)
-                                       return false;
-
-                               var graphElementType = GetCollectionElementType (graphType);
-                               if (elementType != graphElementType)
-                                       return false;
-
-                               if (!IsCustomCollectionType (contractType, elementType))
-                                       return false;
-                       } else if (type.Equals (typeof (IEnumerable)) || type.Equals (typeof (IList)) ||
-                                  type.Equals (typeof (ICollection))) {
-                               if (!graphType.ImplementsInterface (contractType))
-                                       return false;
-                       } else if (type.Equals (typeof (IEnumerable<>)) || type.Equals (typeof (IList<>)) ||
-                                  type.Equals (typeof (ICollection<>))) {
-                               var graphElementType = GetCollectionElementType (graphType);
-                               if (graphElementType != elementType)
-                                       throw new InvalidCastException (String.Format (
-                                               "Cannot convert type '{0}' into '{1}'.", graphType, contractType));
-
-                               if (!graphType.ImplementsInterface (contractType))
-                                       return false;
-                       } else {
-                               return false;
-                       }
-
-                       collectionQName = GetCollectionQName (elementType);
-                       return true;
-               }
-
-               static bool ImplementsInterface (Type type, Type iface)
-               {
-                       foreach (var i in type.GetInterfacesOrSelfInterface ())
-                               if (iface == i)
-                                       return true;
-                                       
-                       return false;
-               }
-
-
-               static bool TypeImplementsIEnumerable (Type type)
-               {
-                       foreach (var iface in type.GetInterfacesOrSelfInterface ())
-                               if (iface == typeof (IEnumerable) || (iface.IsGenericType && iface.GetGenericTypeDefinition () == typeof (IEnumerable<>)))
-                                       return true;
-                       
-                       return false;
-               }
-
-               static bool TypeImplementsIDictionary (Type type)
-               {
-                       foreach (var iface in type.GetInterfacesOrSelfInterface ())
-                               if (iface == typeof (IDictionary) || (iface.IsGenericType && iface.GetGenericTypeDefinition () == typeof (IDictionary<,>)))
-                                       return true;
-
-                       return false;
-               }
-
-               // it also supports contract-based dictionary.
-               private DictionaryTypeMap RegisterDictionary (Type type)
-               {
-                       if (!TypeImplementsIDictionary (type))
-                               return null;
-
-                       var cdca = GetAttribute<CollectionDataContractAttribute> (type);
-
-                       DictionaryTypeMap ret =
-                               new DictionaryTypeMap (type, cdca, this);
-
-                       TryRegister (ret.KeyType);
-                       TryRegister (ret.ValueType);
-
-                       var map = FindUserMap (ret.XmlName, type);
-                       if (map != null) {
-                               var dmap = map as DictionaryTypeMap;
-                               if (dmap == null) // The runtime type may still differ (between array and other IList; see bug #670560)
-                                       throw new InvalidOperationException (String.Format ("Failed to add type {0} to known type collection. There already is a registered type for XML name {1}", type, ret.XmlName));
-                       }
-                       contracts.Add (ret);
-
-                       return ret;
-               }
-
-               private SerializationMap RegisterSerializable (Type type)
-               {
-                       QName qname = GetSerializableQName (type);
-
-                       if (FindUserMap (qname, type) != null)
-                               throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname));
-
-                       SharedTypeMap ret = new SharedTypeMap (type, qname, this);
-                       contracts.Add (ret);
-                       ret.Initialize ();
-                       return ret;
-               }
-
-               private SerializationMap RegisterIXmlSerializable (Type type)
-               {
-                       if (type.GetInterface ("System.Xml.Serialization.IXmlSerializable") == null)
-                               return null;
-
-                       QName qname = GetSerializableQName (type);
-
-                       if (!QName.Empty.Equals (qname) && FindUserMap (qname, type) != null)
-                               throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname));
-
-                       XmlSerializableMap ret = new XmlSerializableMap (type, qname, this);
-                       contracts.Add (ret);
-
-                       return ret;
-               }
-
-               void CheckStandardQName (QName qname)
-               {
-                       switch (qname.Namespace) {
-                       case XmlSchema.Namespace:
-                       case XmlSchema.InstanceNamespace:
-                       case MSSimpleNamespace:
-                       case MSArraysNamespace:
-                               throw new InvalidOperationException (String.Format ("Namespace {0} is reserved and cannot be used for user serialization", qname.Namespace));
-                       }
-
-               }
-
-               private SharedContractMap RegisterContract (Type type)
-               {
-                       QName qname = GetContractQName (type);
-                       if (qname == null)
-                               return null;
-                       CheckStandardQName (qname);
-                       if (FindUserMap (qname, type) != null)
-                               throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname));
-
-                       SharedContractMap ret = new SharedContractMap (type, qname, this);
-                       contracts.Add (ret);
-                       ret.Initialize ();
-
-                       if (type.BaseType != typeof (object)) {
-                               TryRegister (type.BaseType);
-                               if (!FindUserMap (type.BaseType).IsContractAllowedType)
-                                       throw new InvalidDataContractException (String.Format ("To be serializable by data contract, type '{0}' cannot inherit from non-contract and non-Serializable type '{1}'", type, type.BaseType));
-                       }
-
-                       object [] attrs = type.GetCustomAttributes (typeof (KnownTypeAttribute), true);
-                       for (int i = 0; i < attrs.Length; i++) {
-                               KnownTypeAttribute kt = (KnownTypeAttribute) attrs [i];
-                               foreach (var t in kt.GetTypes (type))
-                                       TryRegister (t);
-                       }
-
-                       return ret;
-               }
-
-               DefaultTypeMap RegisterDefaultTypeMap (Type type)
-               {
-                       DefaultTypeMap ret = new DefaultTypeMap (type, this);
-                       contracts.Add (ret);
-                       ret.Initialize ();
-                       return ret;
-               }
-
-               private EnumMap RegisterEnum (Type type)
-               {
-                       QName qname = GetEnumQName (type);
-                       if (qname == null)
-                               return null;
-
-                       if (FindUserMap (qname, type) != null)
-                               throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname));
-
-                       EnumMap ret =
-                               new EnumMap (type, qname, this);
-                       contracts.Add (ret);
-                       return ret;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/NetDataContractSerializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/NetDataContractSerializer.cs
deleted file mode 100644 (file)
index 68f6bea..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-//
-// NetDataContractSerializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.IO;
-using System.Reflection;
-using System.Runtime.Serialization.Formatters;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Xml;
-using System.Xml.Schema;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       public sealed class NetDataContractSerializer
-               : XmlObjectSerializer, IFormatter
-       {
-               const string xmlns = "http://www.w3.org/2000/xmlns/";
-               const string default_ns = "http://schemas.datacontract.org/2004/07/";
-
-               // This is only for compatible mode.
-               StreamingContext context;
-//             KnownTypeCollection known_types;
-//             IDataContractSurrogate surrogate;
-
-               SerializationBinder binder;
-               ISurrogateSelector selector;
-
-               int max_items = 0x10000; // FIXME: could be from config.
-               bool ignore_extensions;
-               FormatterAssemblyStyle ass_style;
-
-               XmlDictionaryString root_name, root_ns;
-
-               public NetDataContractSerializer ()
-               {
-               }
-
-               public NetDataContractSerializer (StreamingContext context)
-               {
-                       this.context = context;
-               }
-
-               public NetDataContractSerializer (string rootName,
-                       string rootNamespace)
-               {
-                       FillDictionaryString (rootName, rootNamespace);
-               }
-
-               public NetDataContractSerializer (XmlDictionaryString rootName,
-                       XmlDictionaryString rootNamespace)
-               {
-                       if (rootName == null)
-                               throw new ArgumentNullException ("rootName");
-                       if (rootNamespace == null)
-                               throw new ArgumentNullException ("rootNamespace");
-                       root_name = rootName;
-                       root_ns = rootNamespace;
-               }
-
-               public NetDataContractSerializer (StreamingContext context, 
-                       int maxItemsInObjectGraph,
-                       bool ignoreExtensibleDataObject,
-                       FormatterAssemblyStyle assemblyFormat,
-                       ISurrogateSelector surrogateSelector)
-               {
-                       this.context = context;
-                       max_items = maxItemsInObjectGraph;
-                       ignore_extensions = ignoreExtensibleDataObject;
-                       ass_style = assemblyFormat;
-                       selector = surrogateSelector;
-               }
-
-               public NetDataContractSerializer (
-                       string rootName, string rootNamespace,
-                       StreamingContext context, 
-                       int maxItemsInObjectGraph,
-                       bool ignoreExtensibleDataObject,
-                       FormatterAssemblyStyle assemblyFormat,
-                       ISurrogateSelector surrogateSelector)
-                       : this (context, maxItemsInObjectGraph,
-                               ignoreExtensibleDataObject, assemblyFormat,
-                               surrogateSelector)
-               {
-                       FillDictionaryString (rootName, rootNamespace);
-               }
-
-               public NetDataContractSerializer (
-                       XmlDictionaryString rootName,
-                       XmlDictionaryString rootNamespace,
-                       StreamingContext context,
-                       int maxItemsInObjectGraph,
-                       bool ignoreExtensibleDataObject,
-                       FormatterAssemblyStyle assemblyFormat,
-                       ISurrogateSelector surrogateSelector)
-                       : this (context, maxItemsInObjectGraph,
-                               ignoreExtensibleDataObject, assemblyFormat,
-                               surrogateSelector)
-               {
-                       if (rootName == null)
-                               throw new ArgumentNullException ("rootName");
-                       if (rootNamespace == null)
-                               throw new ArgumentNullException ("rootNamespace");
-                       root_name = rootName;
-                       root_ns = rootNamespace;
-               }
-
-               void FillDictionaryString (string rootName, string rootNamespace)
-               {
-                       if (rootName == null)
-                               throw new ArgumentNullException ("rootName");
-                       if (rootNamespace == null)
-                               throw new ArgumentNullException ("rootNamespace");
-                       XmlDictionary d = new XmlDictionary ();
-                       root_name = d.Add (rootName);
-                       root_ns = d.Add (rootNamespace);
-               }
-
-               public FormatterAssemblyStyle AssemblyFormat {
-                       get { return ass_style; }
-                       set { ass_style = value; }
-               }
-
-               public SerializationBinder Binder {
-                       get { return binder; }
-                       set { binder = value; }
-               }
-
-               public bool IgnoreExtensionDataObject {
-                       get { return ignore_extensions; }
-               }
-
-               public ISurrogateSelector SurrogateSelector {
-                       get { return selector; }
-                       set { selector = value; }
-               }
-
-               public StreamingContext Context {
-                       get { return context; }
-                       set { context = value; }
-               }
-
-               public int MaxItemsInObjectGraph {
-                       get { return max_items; }
-               }
-
-               public object Deserialize (Stream stream)
-               {
-                       return ReadObject (stream);
-               }
-
-               [MonoTODO]
-               public override bool IsStartObject (XmlDictionaryReader reader)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override object ReadObject (XmlDictionaryReader reader, bool readContentOnly)
-               {
-                       /*
-                       int startTypeCount = known_types.Count;
-
-                       object ret = XmlFormatterDeserializer.Deserialize (
-                               // FIXME: remove this second param.
-                               reader, null, known_types, surrogate, readContentOnly);
-
-                       if (!readContentOnly && reader.NodeType == XmlNodeType.EndElement)
-                               reader.Read ();
-
-                       // remove temporarily-added known types for
-                       // rootType and object graph type.
-                       while (known_types.Count > startTypeCount)
-                               known_types.RemoveAt (startTypeCount);
-
-                       return ret;
-                       */
-                       throw new NotImplementedException ();
-               }
-
-               public void Serialize (Stream stream, Object graph)
-               {
-                       using (XmlWriter w = XmlWriter.Create (stream)) {
-                               WriteObject (w, graph);
-                       }
-               }
-
-               [MonoTODO ("support arrays; support Serializable; support SharedType; use DataContractSurrogate")]
-               /*
-                       when writeContentOnly is true, then the input XmlWriter
-                       must be at element state. This is to write possible
-                       xsi:nil.
-
-                       rootType determines the top-level element QName (thus
-                       it is ignored when writeContentOnly is true).
-
-                       preserveObjectReferences indicates that whether the
-                       output should contain ms:Id or not.
-                       (http://schemas.microsoft.com/2003/10/Serialization/)
-               */
-               public override void WriteObjectContent (
-                       XmlDictionaryWriter writer, object graph)
-               {
-                       /*
-                       int startTypeCount = known_types.Count;
-
-                       string ns = default_ns;
-
-                       //writer.WriteAttributeString ("xmlns", "i", xmlns, XmlSchema.InstanceNamespace);
-                       //writer.WriteAttributeString ("xmlns", "x", xmlns, XmlSchema.Namespace);
-                       if (ns != null)
-                               writer.WriteAttributeString ("xmlns", xmlns, ns);
-
-                       XmlFormatterSerializer.Serialize (writer, graph,
-                               known_types,
-                               ignore_extensions, max_items);
-
-                       // remove temporarily-added known types for
-                       // rootType and object graph type.
-                       while (known_types.Count > startTypeCount)
-                               known_types.RemoveAt (startTypeCount);
-                       */
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteStartObject (
-                       XmlDictionaryWriter writer, object graph)
-               {
-                       /*
-                       Type rootType = graph.GetType ();
-                       known_types.Add (rootType);
-                       SerializationMap map =
-                               known_types.FindUserMap (rootType);
-                       QName name = map != null ? map.XmlName :
-                               KnownTypeCollection.GetPredefinedTypeName (rootType);
-                       writer.WriteStartElement (
-                               name.Name, name.Namespace);
-                       */
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEndObject (XmlDictionaryWriter writer)
-               {
-                       writer.WriteEndElement ();
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.XsdExporter.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.XsdExporter.cs
deleted file mode 100644 (file)
index 47fc17c..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// SerializationMap.XsdExporter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Xml;
-using System.Xml.Schema;
-using System.Xml.Serialization;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       internal abstract partial class SerializationMap
-       {
-               public abstract void ExportSchemaType (XsdDataContractExporter exporter);
-       }
-       
-       internal partial class XmlSerializableMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       // .NET also expects a default constructor.
-                       var ixs = (IXmlSerializable) Activator.CreateInstance (RuntimeType, true);
-                       var xs = ixs.GetSchema ();
-                       if (xs != null)
-                               exporter.Schemas.Add (xs);
-               }
-       }
-       
-       internal partial class SharedContractMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportStandardComplexType (RuntimeType.GetCustomAttribute<DataContractAttribute> (false), this, Members);
-               }
-       }
-       
-       internal partial class DefaultTypeMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportStandardComplexType (null, this, Members);
-               }
-       }
-       
-       internal partial class CollectionContractTypeMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportListContractType (a, this);
-               }
-       }
-       
-       internal partial class CollectionTypeMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportListContractType (null, this);
-               }
-       }
-       
-       internal partial class DictionaryTypeMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportDictionaryContractType (a, this, GetGenericDictionaryInterface (RuntimeType));
-               }
-       }
-       
-       internal partial class SharedTypeMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportStandardComplexType (null, this, Members);
-               }
-       }
-       
-       internal partial class EnumMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportEnumContractType (RuntimeType.GetCustomAttribute<DataContractAttribute> (false), this);
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs
deleted file mode 100644 (file)
index 48b121e..0000000
+++ /dev/null
@@ -1,1122 +0,0 @@
-//
-// SerializationMap.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//     Ankit Jain <JAnkit@novell.com>
-//     Duncan Mak (duncan@ximian.com)
-//     Eyal Alaluf (eyala@mainsoft.com)
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-// Copyright (C) 2006 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Reflection;
-using System.Xml;
-using System.Xml.Schema;
-using System.Xml.Serialization;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-/*
-       XmlFormatter implementation design inference:
-
-       type definitions:
-       - No XML Schema types are directly used. There are some maps from
-         xs:blahType to ms:blahType where the namespaceURI for prefix "ms" is
-         "http://schemas.microsoft.com/2003/10/Serialization/" .
-
-       serializable types:
-       - An object being serialized 1) must be of type System.Object, or
-         2) must be null, or 3) must have either a [DataContract] attribute
-         or a [Serializable] attribute to be serializable.
-       - When the object is either of type System.Object or null, then the
-         XML type is "anyType".
-       - When the object is [Serializable], then the runtime-serialization
-         compatible object graph is written.
-       - Otherwise the serialization is based on contract attributes.
-         ([Serializable] takes precedence).
-
-       type derivation:
-       - For type A to be serializable, the base type B of A must be
-         serializable.
-       - If a type which is [Serializable] and whose base type has a
-         [DataContract], then for base type members [DataContract] is taken.
-       - It is vice versa i.e. if the base type is [Serializable] and the
-         derived type has a [DataContract], then [Serializable] takes place
-         for base members.
-
-       known type collection:
-       - It internally manages mapping store keyed by contract QNames.
-         KnownTypeCollection.Add() checks if the same QName contract already
-         exists (and raises InvalidOperationException if required).
-
-*/
-       internal abstract partial class SerializationMap
-       {
-               public const BindingFlags AllInstanceFlags =
-                       BindingFlags.Public | BindingFlags.NonPublic |
-                       BindingFlags.Instance;
-
-               public readonly KnownTypeCollection KnownTypes;
-               public readonly Type RuntimeType;
-               public bool IsReference; // new in 3.5 SP1
-               public List<DataMemberInfo> Members;
-#if !NET_2_1
-               XmlSchemaSet schema_set;
-#endif
-               //FIXME FIXME
-               Dictionary<Type, QName> qname_table = new Dictionary<Type, QName> ();
-
-               protected SerializationMap (
-                       Type type, QName qname, KnownTypeCollection knownTypes)
-               {
-                       KnownTypes = knownTypes;
-                       RuntimeType = type;
-                       if (qname.Namespace == null)
-                               qname = new QName (qname.Name,
-                                       KnownTypeCollection.DefaultClrNamespaceBase + type.Namespace);
-
-                       XmlName = qname;
-                       Members = new List<DataMemberInfo> ();
-
-                       foreach (var mi in type.GetMethods (AllInstanceFlags)) {
-                               if (mi.GetCustomAttributes (typeof (OnDeserializingAttribute), false).Length > 0)
-                                       OnDeserializing = mi;
-                               else if (mi.GetCustomAttributes (typeof (OnDeserializedAttribute), false).Length > 0)
-                                       OnDeserialized = mi;
-                       }
-               }
-
-               public MethodInfo OnDeserializing { get; set; }
-               public MethodInfo OnDeserialized { get; set; }
-
-               public virtual bool OutputXsiType {
-                       get { return true; }
-               }
-
-               public QName XmlName { get; set; }
-
-               public abstract bool IsContractAllowedType { get; }
-
-               protected void HandleId (XmlReader reader, XmlFormatterDeserializer deserializer, object instance)
-               {
-                       HandleId (reader.GetAttribute ("Id", KnownTypeCollection.MSSimpleNamespace), deserializer, instance);
-               }
-               
-               protected void HandleId (string id, XmlFormatterDeserializer deserializer, object instance)
-               {
-                       if (id != null)
-                               deserializer.References.Add (id, instance);
-               }
-
-               public CollectionDataContractAttribute GetCollectionDataContractAttribute (Type type)
-               {
-                       object [] atts = type.GetCustomAttributes (
-                               typeof (CollectionDataContractAttribute), false);
-                       return atts.Length == 0 ? null : (CollectionDataContractAttribute) atts [0];
-               }
-
-               public DataMemberAttribute GetDataMemberAttribute (
-                       MemberInfo mi)
-               {
-                       object [] atts = mi.GetCustomAttributes (
-                               typeof (DataMemberAttribute), false);
-                       if (atts.Length == 0)
-                               return null;
-                       return (DataMemberAttribute) atts [0];
-               }
-
-               bool IsPrimitive (Type type)
-               {
-                       return (Type.GetTypeCode (type) != TypeCode.Object || type == typeof (object));
-               }
-
-               //Returns list of data members for this type ONLY
-               public virtual List<DataMemberInfo> GetMembers ()
-               {
-                       throw new NotImplementedException (String.Format ("Implement me for {0}", this));
-               }
-
-#if !NET_2_1
-               protected XmlSchemaElement GetSchemaElement (QName qname, XmlSchemaType schemaType)
-               {
-                       XmlSchemaElement schemaElement = new XmlSchemaElement ();
-                       schemaElement.Name = qname.Name;
-                       schemaElement.SchemaTypeName = qname;
-
-                       if (schemaType is XmlSchemaComplexType)
-                               schemaElement.IsNillable = true;
-
-                       return schemaElement;
-               }
-
-               protected XmlSchema GetSchema (XmlSchemaSet schemas, string ns)
-               {
-                       ICollection colln = schemas.Schemas (ns);
-                       if (colln.Count > 0) {
-                               if (colln.Count > 1)
-                                       throw new Exception (String.Format (
-                                               "More than 1 schema for namespace '{0}' found.", ns));
-                               foreach (object o in colln)
-                                       //return colln [0]
-                                       return (o as XmlSchema);
-                       }
-
-                       XmlSchema schema = new XmlSchema ();
-                       schema.TargetNamespace = ns;
-                       schema.ElementFormDefault = XmlSchemaForm.Qualified;
-                       schemas.Add (schema);
-
-                       return schema;
-               }
-
-               protected XmlQualifiedName GetQualifiedName (Type type)
-               {
-                       if (qname_table.ContainsKey (type))
-                               return qname_table [type];
-
-                       QName qname = KnownTypes.GetQName (type);
-                       if (qname.Namespace == KnownTypeCollection.MSSimpleNamespace)
-                               qname = new QName (qname.Name, XmlSchema.Namespace);
-
-                       qname_table [type] = qname;
-                       return qname;
-               }
-#endif
-
-               public virtual void Serialize (object graph,
-                       XmlFormatterSerializer serializer)
-               {
-                       string label;
-                       if (serializer.TrySerializeAsReference (IsReference, graph, out label))
-                               return;
-                       else if (serializer.SerializingObjects.Contains (graph))
-                               throw new SerializationException (String.Format ("Circular reference of an object in the object graph was found: '{0}' of type {1}", graph, graph.GetType ()));
-                       serializer.SerializingObjects.Add (graph);
-
-                       if (label != null)
-                               serializer.Writer.WriteAttributeString ("z", "Id", KnownTypeCollection.MSSimpleNamespace, label);
-
-                       SerializeNonReference (graph, serializer);
-
-                       serializer.SerializingObjects.Remove (graph);
-               }
-
-               public virtual void SerializeNonReference (object graph,
-                       XmlFormatterSerializer serializer)
-               {
-                       foreach (DataMemberInfo dmi in Members) {
-                               FieldInfo fi = dmi.Member as FieldInfo;
-                               PropertyInfo pi = fi == null ?
-                                       (PropertyInfo) dmi.Member : null;
-                               Type type = fi != null ?
-                                       fi.FieldType : pi.PropertyType;
-                               object value = fi != null ?
-                                       fi.GetValue (graph) :
-                                       pi.GetValue (graph, null);
-
-                               serializer.WriteStartElement (dmi.XmlName, dmi.XmlRootNamespace, dmi.XmlNamespace);
-                               serializer.Serialize (type, value);
-                               serializer.WriteEndElement ();
-                       }
-               }
-
-               public virtual object DeserializeObject (XmlReader reader, XmlFormatterDeserializer deserializer)
-               {
-                       bool isEmpty = reader.IsEmptyElement;
-                       string id = reader.GetAttribute ("Id", KnownTypeCollection.MSSimpleNamespace);
-                       reader.ReadStartElement ();
-                       reader.MoveToContent ();
-
-                       object res;
-
-                       if (isEmpty)
-                               res = DeserializeEmptyContent (reader, deserializer, id);
-                       else
-                               res = DeserializeContent (reader, deserializer, id);
-
-                       reader.MoveToContent ();
-                       if (!isEmpty && reader.NodeType == XmlNodeType.EndElement)
-                               reader.ReadEndElement ();
-                       else if (!isEmpty && !reader.EOF && reader.NodeType != XmlNodeType.EndElement) {
-                               var li = reader as IXmlLineInfo;
-                               throw new SerializationException (String.Format ("Deserializing type '{3}'. Expecting state 'EndElement'. Encountered state '{0}' with name '{1}' with namespace '{2}'.{4}",
-                                       reader.NodeType,
-                                       reader.Name,
-                                       reader.NamespaceURI,
-                                       RuntimeType.FullName,
-                                       li != null && li.HasLineInfo () ? String.Format (" {0}({1},{2})", reader.BaseURI, li.LineNumber, li.LinePosition) : String.Empty));
-                       }
-                       return res;
-               }
-
-               // This is sort of hack. The argument reader already moved ahead of
-               // the actual empty element.It's just for historical consistency.
-               public virtual object DeserializeEmptyContent (XmlReader reader,
-                       XmlFormatterDeserializer deserializer, string id)
-               {
-                       return DeserializeContent (reader, deserializer, id, true);
-               }
-
-               public virtual object DeserializeContent (XmlReader reader,
-                       XmlFormatterDeserializer deserializer, string id)
-               {
-                       return DeserializeContent (reader, deserializer, id, false);
-               }
-
-               object DeserializeContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id, bool empty)
-               {
-                       object instance = FormatterServices.GetUninitializedObject (RuntimeType);
-                       HandleId (id, deserializer, instance);
-
-                       if (OnDeserializing != null)
-                               OnDeserializing.Invoke (instance, new object [] {new StreamingContext (StreamingContextStates.All)});
-
-                       int depth = reader.NodeType == XmlNodeType.None ? reader.Depth : reader.Depth - 1;
-                       bool [] filled = new bool [Members.Count];
-                       bool [] nsmatched = new bool [Members.Count];
-                       int memberInd = -1, ordered = -1;
-                       while (!empty && reader.NodeType == XmlNodeType.Element && reader.Depth > depth) {
-                               DataMemberInfo dmi = null;
-                               int i = 0;
-                               bool nsmatchedOne = false;
-                               for (; i < Members.Count; i++) { // unordered
-                                       if (Members [i].Order >= 0)
-                                               break;
-                                       if (reader.LocalName == Members [i].XmlName) {
-                                               memberInd = i;
-                                               dmi = Members [i];
-                                               nsmatchedOne = (dmi.XmlRootNamespace == null || reader.NamespaceURI == dmi.XmlRootNamespace);
-                                               if (nsmatchedOne)
-                                                       break;
-                                       }
-                               }
-                               for (i = Math.Max (i, ordered); i < Members.Count; i++) { // ordered
-                                       if (dmi != null)
-                                               break;
-                                       if (reader.LocalName == Members [i].XmlName) {
-                                               ordered = i;
-                                               memberInd = i;
-                                               dmi = Members [i];
-                                               nsmatchedOne = (dmi.XmlRootNamespace == null || reader.NamespaceURI == dmi.XmlRootNamespace);
-                                               if (nsmatchedOne)
-                                                       break;
-                                       }
-                               }
-                               
-                               if (dmi == null) {
-                                       reader.Skip ();
-                                       reader.MoveToContent ();
-                                       continue;
-                               }
-                               if (filled [memberInd] && nsmatched [memberInd]) {
-                                       // The strictly-corresponding member (i.e. that matches namespace URI too, not only local name) already exists, so skip this element.
-                                       reader.Skip ();
-                                       reader.MoveToContent ();
-                                       continue;
-                               }
-                               nsmatched [memberInd] = nsmatchedOne;
-                               SetValue (dmi, instance, deserializer.Deserialize (dmi.MemberType, reader));
-                               filled [memberInd] = true;
-                               reader.MoveToContent ();
-                       }
-                       for (int i = 0; i < Members.Count; i++)
-                               if (!filled [i] && Members [i].IsRequired)
-                                       throw MissingRequiredMember (Members [i], reader);
-
-                       if (OnDeserialized != null)
-                               OnDeserialized.Invoke (instance, new object [] {new StreamingContext (StreamingContextStates.All)});
-
-                       return instance;
-               }
-
-               // For now it could be private.
-               protected Exception MissingRequiredMember (DataMemberInfo dmi, XmlReader reader)
-               {
-                       var li = reader as IXmlLineInfo;
-                       return new ArgumentException (String.Format ("Data contract member {0} for the type {1} is required, but missing in the input XML.{2}",
-                               new QName (dmi.XmlName, dmi.XmlNamespace),
-                               RuntimeType,
-                               li != null && li.HasLineInfo () ? String.Format (" {0}({1},{2})", reader.BaseURI, li.LineNumber, li.LinePosition) : null));
-               }
-
-               // For now it could be private.
-               protected void SetValue (DataMemberInfo dmi, object obj, object value)
-               {
-                       try {
-                               if (dmi.Member is PropertyInfo)
-                                       ((PropertyInfo) dmi.Member).SetValue (obj, value, null);
-                               else
-                                       ((FieldInfo) dmi.Member).SetValue (obj, value);
-                       } catch (Exception ex) {
-                               throw new InvalidOperationException (String.Format ("Failed to set value of type {0} for property {1}", value != null ? value.GetType () : null, dmi.Member), ex);
-                       }
-               }
-
-               protected DataMemberInfo CreateDataMemberInfo (DataMemberAttribute dma, MemberInfo mi, Type memberType, string ownerNamespace)
-               {
-                       KnownTypes.Add (memberType);
-                       QName qname = KnownTypes.GetQName (memberType);
-                       
-                       if (KnownTypeCollection.GetPrimitiveTypeFromName (qname) != null)
-                               return new DataMemberInfo (mi, dma, ownerNamespace, null);
-                       else
-                               return new DataMemberInfo (mi, dma, ownerNamespace, qname.Namespace);
-               }
-       }
-
-       internal partial class XmlSerializableMap : SerializationMap
-       {
-               public override bool IsContractAllowedType { get { return true; } }
-
-               public XmlSerializableMap (Type type, QName qname, KnownTypeCollection knownTypes)
-                       : base (type, qname, knownTypes)
-               {
-               }
-
-               public override void Serialize (object graph, XmlFormatterSerializer serializer)
-               {
-                       IXmlSerializable ixs = graph as IXmlSerializable;
-                       if (ixs == null)
-                               //FIXME: Throw what exception here?
-                               throw new SerializationException ();
-
-                       ixs.WriteXml (serializer.Writer);
-               }
-
-               public override object DeserializeObject (XmlReader reader, XmlFormatterDeserializer deserializer)
-               {
-#if NET_2_1
-                       IXmlSerializable ixs = (IXmlSerializable) Activator.CreateInstance (RuntimeType);
-#else
-                       IXmlSerializable ixs = (IXmlSerializable) Activator.CreateInstance (RuntimeType, true);
-#endif
-
-                       HandleId (reader, deserializer, ixs);
-
-                       ixs.ReadXml (reader);
-                       return ixs;
-               }
-       }
-
-       internal partial class SharedContractMap : SerializationMap
-       {
-               public SharedContractMap (
-                       Type type, QName qname, KnownTypeCollection knownTypes)
-                       : base (type, qname, knownTypes)
-               {
-               }
-
-               public override bool IsContractAllowedType { get { return true; } }
-
-               internal void Initialize ()
-               {
-                       Type type = RuntimeType;
-                       List <DataMemberInfo> members;
-                       object [] atts = type.GetCustomAttributes (
-                               typeof (DataContractAttribute), false);
-                       IsReference = atts.Length > 0 ? (((DataContractAttribute) atts [0]).IsReference) : false;
-
-                       while (type != null) {
-                               members = GetMembers (type);
-                               members.Sort (DataMemberInfo.DataMemberInfoComparer.Instance);
-                               Members.InsertRange (0, members);
-                               members.Clear ();
-
-                               type = type.BaseType;
-                       }
-               }
-
-               List<DataMemberInfo> GetMembers (Type type)
-               {
-                       List<DataMemberInfo> data_members = new List<DataMemberInfo> ();
-                       BindingFlags flags = AllInstanceFlags | BindingFlags.DeclaredOnly;
-
-                       foreach (PropertyInfo pi in type.GetProperties (flags)) {
-                               DataMemberAttribute dma =
-                                       GetDataMemberAttribute (pi);
-                               if (dma == null)
-                                       continue;
-                               KnownTypes.Add (pi.PropertyType);
-                               var map = KnownTypes.FindUserMap (pi.PropertyType);
-                               if (!pi.CanRead || (!pi.CanWrite && !(map is ICollectionTypeMap)))
-                                       throw new InvalidDataContractException (String.Format (
-                                                       "DataMember property '{0}' on type '{1}' must have both getter and setter.", pi, pi.DeclaringType));
-                               data_members.Add (CreateDataMemberInfo (dma, pi, pi.PropertyType, KnownTypeCollection.GetStaticQName (pi.DeclaringType).Namespace));
-                       }
-
-                       foreach (FieldInfo fi in type.GetFields (flags)) {
-                               DataMemberAttribute dma =
-                                       GetDataMemberAttribute (fi);
-                               if (dma == null)
-                                       continue;
-                               data_members.Add (CreateDataMemberInfo (dma, fi, fi.FieldType, KnownTypeCollection.GetStaticQName (fi.DeclaringType).Namespace));
-                       }
-
-                       return data_members;
-               }
-
-               public override List<DataMemberInfo> GetMembers ()
-               {
-                       return Members;
-               }
-       }
-
-       internal partial class DefaultTypeMap : SerializationMap
-       {
-               public DefaultTypeMap (Type type, KnownTypeCollection knownTypes)
-                       : base (type, KnownTypeCollection.GetStaticQName (type), knownTypes)
-               {
-               }
-
-               public override bool IsContractAllowedType { get { return false; } }
-
-               internal void Initialize ()
-               {
-                       Members.AddRange (GetDefaultMembers ());
-               }
-
-               List<DataMemberInfo> GetDefaultMembers ()
-               {
-                       var l = new List<DataMemberInfo> ();
-                       foreach (var mi in RuntimeType.GetMembers ()) {
-                               Type mt = null;
-                               FieldInfo fi = mi as FieldInfo;
-                               mt = fi == null ? null : fi.FieldType;
-                               PropertyInfo pi = mi as PropertyInfo;
-                               if (pi != null && pi.CanRead && pi.CanWrite && pi.GetIndexParameters ().Length == 0)
-                                       mt = pi.PropertyType;
-                               if (mt == null)
-                                       continue;
-                               if (mi.GetCustomAttributes (typeof (IgnoreDataMemberAttribute), false).Length != 0)
-                                       continue;
-                               string ns = KnownTypeCollection.GetStaticQName (mi.DeclaringType).Namespace;
-                               l.Add (CreateDataMemberInfo (new DataMemberAttribute (), mi, mt, ns));
-                       }
-                       l.Sort (DataMemberInfo.DataMemberInfoComparer.Instance);
-                       return l;
-               }
-       }
-
-       // FIXME: it still needs to consider KeyName/ValueName
-       // (especially Dictionary collection is not likely considered yet.)
-       internal partial class CollectionContractTypeMap : CollectionTypeMap
-       {
-               CollectionDataContractAttribute a;
-
-               public CollectionContractTypeMap (
-                       Type type, CollectionDataContractAttribute a, Type elementType,
-                       QName qname, KnownTypeCollection knownTypes)
-                       : base (type, elementType, qname, knownTypes)
-               {
-                       this.a = a;
-                       IsReference = a.IsReference;
-                       if (!String.IsNullOrEmpty (a.ItemName))
-                               element_qname = new XmlQualifiedName (a.ItemName, a.Namespace ?? CurrentNamespace);
-               }
-
-               internal override string CurrentNamespace {
-                       get { return XmlName.Namespace; }
-               }
-
-               public override bool IsContractAllowedType { get { return true; } }
-       }
-
-       internal interface ICollectionTypeMap
-       {
-       }
-
-       internal partial class CollectionTypeMap : SerializationMap, ICollectionTypeMap
-       {
-               Type element_type;
-               internal QName element_qname;
-               MethodInfo add_method;
-
-               public CollectionTypeMap (
-                       Type type, Type elementType,
-                       QName qname, KnownTypeCollection knownTypes)
-                       : base (type, qname, knownTypes)
-               {
-                       element_type = elementType;
-                       element_qname = KnownTypes.GetQName (element_type);
-                       var icoll = GetGenericCollectionInterface (RuntimeType);
-                       if (icoll != null) {
-                               if (RuntimeType.IsInterface) {
-                                       add_method = RuntimeType.GetMethod ("Add", icoll.GetGenericArguments ());
-                               } else {
-                                       var imap = RuntimeType.GetInterfaceMap (icoll);
-                                       for (int i = 0; i < imap.InterfaceMethods.Length; i++)
-                                               if (imap.InterfaceMethods [i].Name == "Add") {
-                                                       add_method = imap.TargetMethods [i];
-                                                       break;
-                                               }
-                                       if (add_method == null)
-                                               add_method = type.GetMethod ("Add", icoll.GetGenericArguments ());
-                               }
-                       }
-               }
-
-               static Type GetGenericCollectionInterface (Type type)
-               {
-                       foreach (var iface in type.GetInterfacesOrSelfInterface ())
-                               if (iface.IsGenericType && iface.GetGenericTypeDefinition () == typeof (IEnumerable<>))
-                                       return iface;
-
-                       return null;
-               }
-
-               public override bool IsContractAllowedType { get { return false; } }
-
-               public override bool OutputXsiType {
-                       get { return false; }
-               }
-
-               internal virtual string CurrentNamespace {
-                       get {
-                               string ns = element_qname.Namespace;
-                               if (ns == KnownTypeCollection.MSSimpleNamespace)
-                                       ns = KnownTypeCollection.MSArraysNamespace;
-                               return ns;
-                       }
-               }
-
-               public override void SerializeNonReference (object graph,
-                       XmlFormatterSerializer serializer)
-               {
-                       // output item xmlns in advance so that it does not result in excessive xmlns overwrites.
-                       if (XmlName.Namespace != element_qname.Namespace && element_qname.Namespace != KnownTypeCollection.MSSimpleNamespace)
-                               serializer.Writer.WriteXmlnsAttribute (null, element_qname.Namespace);
-
-                       foreach (object o in (IEnumerable) graph) {
-                               serializer.WriteStartElement (element_qname.Name, XmlName.Namespace, CurrentNamespace);
-                               serializer.Serialize (element_type, o);
-                               serializer.WriteEndElement ();
-                       }
-               }
-
-               object CreateInstance ()
-               {
-                       if (RuntimeType.IsArray)
-                               return new ArrayList ();
-                       if (RuntimeType.IsInterface) {
-                               var icoll = GetGenericCollectionInterface (RuntimeType);
-                               if (icoll != null)
-                                       return Activator.CreateInstance (typeof (List<>).MakeGenericType (RuntimeType.GetGenericArguments () [0])); // List<T>
-                               else // non-generic
-                                       return new ArrayList ();
-                       }
-#if NET_2_1 // FIXME: is it fine?
-                       return Activator.CreateInstance (RuntimeType);
-#else
-                       return Activator.CreateInstance (RuntimeType, true);
-#endif
-               }
-
-               public override object DeserializeEmptyContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id)
-               {
-                       var instance = CreateInstance ();
-                       HandleId (id, deserializer, instance);
-                       if (OnDeserializing != null)
-                               OnDeserializing.Invoke (instance, new object [] {new StreamingContext (StreamingContextStates.All)});
-                       try {
-                               if (RuntimeType.IsArray)
-                                       return ((ArrayList)instance).ToArray (element_type);
-                               else
-                                       return instance;
-                       } finally {
-                               if (OnDeserialized != null)
-                                       OnDeserialized.Invoke (instance, new object [] {new StreamingContext (StreamingContextStates.All)});
-                       }
-               }
-
-               public override object DeserializeContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id)
-               {
-                       object instance = CreateInstance ();
-                       HandleId (id, deserializer, instance);
-                       if (OnDeserializing != null)
-                               OnDeserializing.Invoke (instance, new object [] {new StreamingContext (StreamingContextStates.All)});
-                       int depth = reader.NodeType == XmlNodeType.None ? reader.Depth : reader.Depth - 1;
-                       while (reader.NodeType == XmlNodeType.Element && reader.Depth > depth) {
-                               object elem = deserializer.Deserialize (element_type, reader);
-                               if (instance is IList)
-                                       ((IList)instance).Add (elem);
-                               else if (add_method != null)
-                                       add_method.Invoke (instance, new object [] {elem});
-                               else
-                                       throw new NotImplementedException (String.Format ("Type {0} is not supported", RuntimeType));
-                               reader.MoveToContent ();
-                       }
-                       try {
-                               if (RuntimeType.IsArray)
-                                       return ((ArrayList)instance).ToArray (element_type);
-                               return instance;
-                       } finally {
-                               if (OnDeserialized != null)
-                                       OnDeserialized.Invoke (instance, new object [] {new StreamingContext (StreamingContextStates.All)});
-                       }
-               }
-
-               public override List<DataMemberInfo> GetMembers ()
-               {
-                       //Shouldn't come here at all!
-                       throw new NotImplementedException ();
-               }
-       }
-
-       internal partial class DictionaryTypeMap : SerializationMap, ICollectionTypeMap
-       {
-               Type key_type, value_type;
-               QName item_qname, key_qname, value_qname;
-               MethodInfo add_method;
-               CollectionDataContractAttribute a;
-
-               public DictionaryTypeMap (
-                       Type type, CollectionDataContractAttribute a, KnownTypeCollection knownTypes)
-                       : base (type, QName.Empty, knownTypes)
-               {
-                       this.a = a;
-
-                       key_type = typeof (object);
-                       value_type = typeof (object);
-
-                       var idic = GetGenericDictionaryInterface (RuntimeType);
-                       if (idic != null) {
-                               var imap = RuntimeType.GetInterfaceMap (idic);
-                               for (int i = 0; i < imap.InterfaceMethods.Length; i++)
-                                       if (imap.InterfaceMethods [i].Name == "Add") {
-                                               add_method = imap.TargetMethods [i];
-                                               break;
-                                       }
-                               var argtypes = idic.GetGenericArguments();
-                               key_type = argtypes [0];
-                               value_type = argtypes [1];
-                               if (add_method == null)
-                                       add_method = type.GetMethod ("Add", argtypes);
-                       }
-
-                       XmlName = GetDictionaryQName ();
-                       item_qname = GetItemQName ();
-                       key_qname = GetKeyQName ();
-                       value_qname = GetValueQName ();
-               }
-
-               static Type GetGenericDictionaryInterface (Type type)
-               {
-                       foreach (var iface in type.GetInterfacesOrSelfInterface ())
-                               if (iface.IsGenericType && iface.GetGenericTypeDefinition () == typeof (IDictionary<,>))
-                                       return iface;
-
-                       return null;
-               }
-
-               string ContractNamespace {
-                       get { return a != null && !String.IsNullOrEmpty (a.Namespace) ? a.Namespace : KnownTypeCollection.MSArraysNamespace; }
-               }
-
-               public override bool IsContractAllowedType { get { return a != null; } }
-
-               public Type KeyType { get { return key_type; } }
-               public Type ValueType { get { return value_type; } }
-
-               internal virtual QName GetDictionaryQName ()
-               {
-                       string name = a != null ? a.Name : null;
-                       string ns = a != null ? a.Namespace : null;
-                       if (RuntimeType.IsGenericType && RuntimeType.GetGenericTypeDefinition () != typeof (Dictionary<,>))
-                               name = name ?? KnownTypeCollection.GetDefaultName (RuntimeType);
-                       else
-                               name = "ArrayOf" + GetItemQName ().Name;
-                       ns = ns ?? KnownTypeCollection.MSArraysNamespace;
-
-                       return new QName (name, ns);
-               }
-
-               internal virtual QName GetItemQName ()
-               {
-                       string name = a != null ? a.ItemName : null;
-                       string ns = a != null ? a.Namespace : null;
-
-                       name = name ?? "KeyValueOf" + KnownTypes.GetQName (key_type).Name + KnownTypes.GetQName (value_type).Name;
-                       ns = ns ?? (a != null ? ContractNamespace : KnownTypeCollection.MSArraysNamespace);
-
-                       return new QName (name, ns);
-               }
-
-               internal virtual QName GetKeyQName ()
-               {
-                       string name = a != null ? a.KeyName : null;
-                       string ns = a != null ? a.Namespace : null;
-
-                       name = name ?? "Key";
-                       ns = ns ?? (a != null ? ContractNamespace : KnownTypeCollection.MSArraysNamespace);
-                       return new QName (name, ns);
-               }
-
-               internal virtual QName GetValueQName ()
-               {
-                       string name = a != null ? a.ValueName : null;
-                       string ns = a != null ? a.Namespace : null;
-
-                       name = name ?? "Value";
-                       ns = ns ?? (a != null ? ContractNamespace : KnownTypeCollection.MSArraysNamespace);
-                       return new QName (name, ns);
-               }
-
-               internal virtual string CurrentNamespace {
-                       get {
-                               string ns = item_qname.Namespace;
-                               if (ns == KnownTypeCollection.MSSimpleNamespace)
-                                       ns = KnownTypeCollection.MSArraysNamespace;
-                               return ns;
-                       }
-               }
-
-               Type pair_type;
-               PropertyInfo pair_key_property, pair_value_property;
-
-               public override void SerializeNonReference (object graph,
-                       XmlFormatterSerializer serializer)
-               {
-                       if (add_method != null) { // generic
-                               if (pair_type == null) {
-                                       pair_type = typeof (KeyValuePair<,>).MakeGenericType (add_method.DeclaringType.GetGenericArguments ());
-                                       pair_key_property = pair_type.GetProperty ("Key");
-                                       pair_value_property = pair_type.GetProperty ("Value");
-                               }
-                               foreach (object p in (IEnumerable) graph) {
-                                       serializer.WriteStartElement (item_qname.Name, item_qname.Namespace, CurrentNamespace);
-                                       serializer.WriteStartElement (key_qname.Name, key_qname.Namespace, CurrentNamespace);
-                                       serializer.Serialize (pair_key_property.PropertyType, pair_key_property.GetValue (p, null));
-                                       serializer.WriteEndElement ();
-                                       serializer.WriteStartElement (value_qname.Name, value_qname.Namespace, CurrentNamespace);
-                                       serializer.Serialize (pair_value_property.PropertyType, pair_value_property.GetValue (p, null));
-                                       serializer.WriteEndElement ();
-                                       serializer.WriteEndElement ();
-                               }
-                       } else { // non-generic
-                               foreach (DictionaryEntry p in (IEnumerable) graph) {
-                                       serializer.WriteStartElement (item_qname.Name, item_qname.Namespace, CurrentNamespace);
-                                       serializer.WriteStartElement (key_qname.Name, key_qname.Namespace, CurrentNamespace);
-                                       serializer.Serialize (key_type, p.Key);
-                                       serializer.WriteEndElement ();
-                                       serializer.WriteStartElement (value_qname.Name, value_qname.Namespace, CurrentNamespace);
-                                       serializer.Serialize (value_type, p.Value);
-                                       serializer.WriteEndElement ();
-                                       serializer.WriteEndElement ();
-                               }
-                       }
-               }
-
-               object CreateInstance ()
-               {
-                       if (RuntimeType.IsInterface) {
-                               if (RuntimeType.IsGenericType && Array.IndexOf (RuntimeType.GetGenericTypeDefinition ().GetInterfaces (), typeof (IDictionary<,>)) >= 0) {
-                                       var gargs = RuntimeType.GetGenericArguments ();
-                                       return Activator.CreateInstance (typeof (Dictionary<,>).MakeGenericType (gargs [0], gargs [1])); // Dictionary<T>
-                               }
-                               else // non-generic
-                                       return new Hashtable ();
-                       }
-#if NET_2_1 // FIXME: is it fine?
-                       return Activator.CreateInstance (RuntimeType);
-#else
-                       return Activator.CreateInstance (RuntimeType, true);
-#endif
-               }
-
-               public override object DeserializeEmptyContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id)
-               {
-                       object instance = CreateInstance ();
-                       HandleId (id, deserializer, instance);
-                       return instance;
-               }
-
-               public override object DeserializeContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id)
-               {
-                       object instance = CreateInstance ();
-                       HandleId (id, deserializer, instance);
-                       int depth = reader.NodeType == XmlNodeType.None ? reader.Depth : reader.Depth - 1;
-                       while (reader.NodeType == XmlNodeType.Element && reader.Depth > depth) {
-                               if (reader.IsEmptyElement)
-                                       throw new XmlException (String.Format ("Unexpected empty element for dictionary entry: name {0}", reader.Name));
-                               // FIXME: sloppy parsing
-                               reader.ReadStartElement ();// item_qname.Name, item_qname.Namespace);
-                               reader.MoveToContent ();
-                               object key = deserializer.Deserialize (key_type, reader);
-                               reader.MoveToContent ();
-                               object val = deserializer.Deserialize (value_type, reader);
-                               reader.MoveToContent ();
-                               reader.ReadEndElement (); // of pair
-                               reader.MoveToContent ();
-
-                               if (instance is IDictionary)
-                                       ((IDictionary)instance).Add (key, val);
-                               else if (add_method != null)
-                                       add_method.Invoke (instance, new object [] {key, val});
-                               else
-                                       throw new NotImplementedException (String.Format ("Type {0} is not supported", RuntimeType));
-                       }
-                       return instance;
-               }
-
-               public override List<DataMemberInfo> GetMembers ()
-               {
-                       //Shouldn't come here at all!
-                       throw new NotImplementedException ();
-               }
-       }
-
-       internal partial class SharedTypeMap : SerializationMap
-       {
-               public SharedTypeMap (
-                       Type type, QName qname, KnownTypeCollection knownTypes)
-                       : base (type, qname, knownTypes)
-               {
-               }
-
-               public override bool IsContractAllowedType { get { return true; } }
-
-               public void Initialize ()
-               {
-                       Members = GetMembers (RuntimeType, XmlName, false);
-               }
-
-               List<DataMemberInfo> GetMembers (Type type, QName qname, bool declared_only)
-               {
-                       List<DataMemberInfo> data_members = new List<DataMemberInfo> ();
-                       BindingFlags flags = AllInstanceFlags | BindingFlags.DeclaredOnly;
-                       
-                       for (Type t = type; t != null; t = t.BaseType) {
-                               foreach (FieldInfo fi in t.GetFields (flags)) {
-                                       if (fi.GetCustomAttributes (
-                                               typeof (NonSerializedAttribute),
-                                               false).Length > 0)
-                                               continue;
-
-                                       if (fi.IsInitOnly)
-                                               throw new InvalidDataContractException (String.Format ("DataMember field {0} must not be read-only.", fi));
-                                       DataMemberAttribute dma = new DataMemberAttribute ();
-                                       data_members.Add (CreateDataMemberInfo (dma, fi, fi.FieldType, KnownTypeCollection.GetStaticQName (fi.DeclaringType).Namespace));
-                               }
-                       }
-
-                       data_members.Sort (DataMemberInfo.DataMemberInfoComparer.Instance); // alphabetic order.
-
-                       return data_members;
-               }
-
-               // Does this make sense? I doubt.
-               public override List<DataMemberInfo> GetMembers ()
-               {
-                       return Members;
-                       //return GetMembers (RuntimeType, XmlName, true);
-               }
-       }
-
-       internal partial class EnumMap : SerializationMap
-       {
-               List<EnumMemberInfo> enum_members;
-               bool flag_attr;
-
-               public EnumMap (
-                       Type type, QName qname, KnownTypeCollection knownTypes)
-                       : base (type, qname, knownTypes)
-               {
-                       bool has_dc = false;
-                       object [] atts = RuntimeType.GetCustomAttributes (
-                               typeof (DataContractAttribute), false);
-                       if (atts.Length != 0)
-                               has_dc = true;
-                       flag_attr = type.GetCustomAttributes (typeof (FlagsAttribute), false).Length > 0;
-
-                       enum_members = new List<EnumMemberInfo> ();
-                       BindingFlags flags = BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Static;
-                       
-                       foreach (FieldInfo fi in RuntimeType.GetFields (flags)) {
-                               string name = fi.Name;
-                               if (has_dc) {
-                                       EnumMemberAttribute ema =
-                                               GetEnumMemberAttribute (fi);
-                                       if (ema == null)
-                                               continue;
-
-                                       if (ema.Value != null)
-                                               name = ema.Value;
-                               }
-
-                               enum_members.Add (new EnumMemberInfo (name, fi.GetValue (null)));
-                       }
-               }
-
-               public override bool IsContractAllowedType { get { return false; } }
-
-               private EnumMemberAttribute GetEnumMemberAttribute (
-                       MemberInfo mi)
-               {
-                       object [] atts = mi.GetCustomAttributes (
-                               typeof (EnumMemberAttribute), false);
-                       if (atts.Length == 0)
-                               return null;
-                       return (EnumMemberAttribute) atts [0];
-               }
-
-               public override void Serialize (object graph,
-                       XmlFormatterSerializer serializer)
-               {
-                       if (flag_attr) {
-                               long val = Convert.ToInt64 (graph);
-                               string s = null;
-                               foreach (EnumMemberInfo emi in enum_members) {
-                                       long f = Convert.ToInt64 (emi.Value);
-                                       if (f == val) {
-                                               s = emi.XmlName;
-                                               break;
-                                       }
-                                       if ((f & val) == f)
-                                               s += (s != null ? " " : String.Empty) + emi.XmlName;
-                               }
-                               if (s != null)
-                                       serializer.Writer.WriteString (s);
-                               return;
-                       } else {
-                               foreach (EnumMemberInfo emi in enum_members) {
-                                       if (Enum.Equals (emi.Value, graph)) {
-                                               serializer.Writer.WriteString (emi.XmlName);
-                                               return;
-                                       }
-                               }
-                       }
-
-                       throw new SerializationException (String.Format (
-                               "Enum value '{0}' is invalid for type '{1}' and cannot be serialized.", graph, RuntimeType));
-               }
-
-               public override object DeserializeEmptyContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id)
-               {
-                       if (!flag_attr)
-                               throw new SerializationException (String.Format ("Enum value '' is invalid for type '{0}' and cannot be deserialized.", RuntimeType));
-                       var instance = Enum.ToObject (RuntimeType, 0);
-                       HandleId (id, deserializer, instance);
-                       return instance;
-               }
-
-               public override object DeserializeContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id)
-               {
-                       string value = reader.NodeType != XmlNodeType.Text ? String.Empty : reader.ReadContentAsString ();
-                       HandleId (id, deserializer, value);
-
-                       if (value != String.Empty) {
-                               if (flag_attr && value.IndexOf (' ') != -1) {
-                                       long flags = 0L;
-                                       foreach (string flag in value.Split (' ')) {
-                                               foreach (EnumMemberInfo emi in enum_members) {
-                                                       if (emi.XmlName == flag) {
-                                                               flags |= Convert.ToInt64 (emi.Value);
-                                                               break;
-                                                       }
-                                               }
-                                       }
-                                       return Enum.ToObject (RuntimeType, flags);
-                               }
-                               else {
-                                       foreach (EnumMemberInfo emi in enum_members)
-                                               if (emi.XmlName == value)
-                                                       return emi.Value;
-                               }
-                       }
-
-                       if (!flag_attr)
-                               throw new SerializationException (String.Format ("Enum value '{0}' is invalid for type '{1}' and cannot be deserialized.", value, RuntimeType));
-                       return Enum.ToObject (RuntimeType, 0);
-               }
-       }
-
-       internal struct EnumMemberInfo
-       {
-               public readonly string XmlName;
-               public readonly object Value;
-
-               public EnumMemberInfo (string name, object value)
-               {
-                       XmlName = name;
-                       Value = value;
-               }
-       }
-
-       internal class DataMemberInfo //: KeyValuePair<int, MemberInfo>
-       {
-               public readonly int Order;
-               public readonly bool IsRequired;
-               public readonly string XmlName;
-               public readonly MemberInfo Member;
-               public readonly string XmlNamespace;
-               public readonly string XmlRootNamespace;
-               public readonly Type MemberType;
-
-               public DataMemberInfo (MemberInfo member, DataMemberAttribute dma, string rootNamespce, string ns)
-               {
-                       if (dma == null)
-                               throw new ArgumentNullException ("dma");
-                       Order = dma.Order;
-                       Member = member;
-                       IsRequired = dma.IsRequired;
-                       XmlName = XmlConvert.EncodeLocalName (dma.Name != null ? dma.Name : member.Name);
-                       XmlNamespace = ns;
-                       XmlRootNamespace = rootNamespce;
-                       if (Member is FieldInfo)
-                               MemberType = ((FieldInfo) Member).FieldType;
-                       else
-                               MemberType = ((PropertyInfo) Member).PropertyType;
-               }
-
-               public class DataMemberInfoComparer : IComparer<DataMemberInfo>
-                       , IComparer // see bug #76361
-               {
-                       public static readonly DataMemberInfoComparer Instance
-                               = new DataMemberInfoComparer ();
-
-                       private DataMemberInfoComparer () {}
-
-                       public int Compare (object o1, object o2)
-                       {
-                               return Compare ((DataMemberInfo) o1,
-                                       (DataMemberInfo) o2);
-                       }
-
-                       public int Compare (DataMemberInfo d1, DataMemberInfo d2)
-                       {
-                               if (d1.Order == d2.Order)
-                                       return String.CompareOrdinal (d1.XmlName, d2.XmlName);
-
-                               return d1.Order - d2.Order;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs
deleted file mode 100644 (file)
index a0a9632..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-//
-// XmlFormatterDeserializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Xml;
-using System.Xml.Schema;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       internal class XmlFormatterDeserializer
-       {
-               KnownTypeCollection types;
-               IDataContractSurrogate surrogate;
-               DataContractResolver resolver, default_resolver; // new in 4.0.
-               // 3.5 SP1 supports deserialization by reference (id->obj).
-               // Though unlike XmlSerializer, it does not support forward-
-               // reference resolution i.e. a referenced object must appear
-               // before any references to it.
-               Dictionary<string,object> references = new Dictionary<string,object> ();
-               Dictionary<QName,Type> resolved_qnames = new Dictionary<QName,Type> ();
-
-               public static object Deserialize (XmlReader reader, Type declaredType,
-                       KnownTypeCollection knownTypes, IDataContractSurrogate surrogate, DataContractResolver resolver, DataContractResolver defaultResolver,
-                       string name, string ns, bool verifyObjectName)
-               {
-                       reader.MoveToContent ();
-                       if (verifyObjectName)
-                               if (reader.NodeType != XmlNodeType.Element ||
-                                   reader.LocalName != name ||
-                                   reader.NamespaceURI != ns)
-                                       throw new SerializationException (String.Format ("Expected element '{0}' in namespace '{1}', but found {2} node '{3}' in namespace '{4}'", name, ns, reader.NodeType, reader.LocalName, reader.NamespaceURI));
-//                             Verify (knownTypes, declaredType, name, ns, reader);
-                       return new XmlFormatterDeserializer (knownTypes, surrogate, resolver, defaultResolver).Deserialize (declaredType, reader);
-               }
-
-               // Verify the top element name and namespace.
-               private static void Verify (KnownTypeCollection knownTypes, Type type, string name, string Namespace, XmlReader reader)
-               {
-                       QName graph_qname = new QName (reader.LocalName, reader.NamespaceURI);
-                       if (graph_qname.Name == name && graph_qname.Namespace == Namespace)
-                               return;
-
-                       // <BClass .. i:type="EClass" >..</BClass>
-                       // Expecting type EClass : allowed
-                       // See test Serialize1b, and Serialize1c (for
-                       // negative cases)
-
-                       // Run through inheritance heirarchy .. 
-                       for (Type baseType = type; baseType != null; baseType = baseType.BaseType)
-                               if (knownTypes.GetQName (baseType) == graph_qname)
-                                       return;
-
-                       QName typeQName = knownTypes.GetQName (type);
-                       throw new SerializationException (String.Format (
-                               "Expecting element '{0}' from namespace '{1}'. Encountered 'Element' with name '{2}', namespace '{3}'",
-                               typeQName.Name, typeQName.Namespace, graph_qname.Name, graph_qname.Namespace));
-               }
-
-               private XmlFormatterDeserializer (
-                       KnownTypeCollection knownTypes,
-                       IDataContractSurrogate surrogate,
-                       DataContractResolver resolver,
-                       DataContractResolver defaultResolver)
-               {
-                       this.types = knownTypes;
-                       this.surrogate = surrogate;
-                       this.resolver = resolver;
-                       this.default_resolver = defaultResolver;
-               }
-
-               public Dictionary<string,object> References {
-                       get { return references; }
-               }
-
-               XmlDocument document;
-               
-               XmlDocument XmlDocument {
-                       get { return (document = document ?? new XmlDocument ()); }
-               }
-
-               // This method handles z:Ref, xsi:nil and primitive types, and then delegates to DeserializeByMap() for anything else.
-
-               public object Deserialize (Type type, XmlReader reader)
-               {
-                       if (type == typeof (XmlElement))
-                               return XmlDocument.ReadNode (reader);
-                       else if (type == typeof (XmlNode [])) {
-                               reader.ReadStartElement ();
-                               var l = new List<XmlNode> ();
-                               for(; !reader.EOF && reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ())
-                                       l.Add (XmlDocument.ReadNode (reader));
-                               reader.ReadEndElement ();
-                               return l.ToArray ();
-                       }
-                       QName graph_qname = null;
-                       
-                       if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>)) {
-                               Type internal_type = type.GetGenericArguments () [0];
-                               
-                               if (types.FindUserMap(internal_type) != null) {
-                                       graph_qname = types.GetQName (internal_type);
-                               }
-                       }
-                       
-                       if (graph_qname == null)
-                               graph_qname = types.GetQName (type);
-                               
-                       string itype = reader.GetAttribute ("type", XmlSchema.InstanceNamespace);
-                       if (itype != null) {
-                               string [] parts = itype.Split (':');
-                               if (parts.Length > 1)
-                                       graph_qname = new QName (parts [1], reader.LookupNamespace (reader.NameTable.Get (parts [0])));
-                               else
-                                       graph_qname = new QName (itype, reader.LookupNamespace (String.Empty));
-                       }
-
-                       string label = reader.GetAttribute ("Ref", KnownTypeCollection.MSSimpleNamespace);
-                       if (label != null) {
-                               object o;
-                               if (!references.TryGetValue (label, out o))
-                                       throw new SerializationException (String.Format ("Deserialized object with reference Id '{0}' was not found", label));
-                               reader.Skip ();
-                               return o;
-                       }
-
-                       bool isNil = reader.GetAttribute ("nil", XmlSchema.InstanceNamespace) == "true";
-
-                       if (isNil) {
-                               reader.Skip ();
-                               if (!type.IsValueType || type == typeof (void))
-                                       return null;
-                               else if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>))
-                                       return null;
-                               else 
-                                       throw new SerializationException (String.Format ("Value type {0} cannot be null.", type));
-                       }
-
-                       if (resolver != null) {
-                               Type t;
-                               if (resolved_qnames.TryGetValue (graph_qname, out t))
-                                       type = t;
-                               else { // i.e. resolve name only once.
-                                       type = resolver.ResolveName (graph_qname.Name, graph_qname.Namespace, type, default_resolver) ?? type;
-                                       resolved_qnames.Add (graph_qname, type);
-                                       types.Add (type);
-                               }
-                       }
-
-                       if (KnownTypeCollection.GetPrimitiveTypeFromName (graph_qname) != null) {
-                               string id = reader.GetAttribute ("Id", KnownTypeCollection.MSSimpleNamespace);
-
-                               object ret = DeserializePrimitive (type, reader, graph_qname);
-
-                               if (id != null) {
-                                       if (references.ContainsKey (id))
-                                               throw new InvalidOperationException (String.Format ("Object with Id '{0}' already exists as '{1}'", id, references [id]));
-                                       references.Add (id, ret);
-                               }
-                               return ret;
-                       }
-
-                       return DeserializeByMap (graph_qname, type, reader);
-               }
-
-               object DeserializePrimitive (Type type, XmlReader reader, QName qname)
-               {
-                       bool isDateTimeOffset = false;
-                       // Handle DateTimeOffset type and DateTimeOffset?.
-                       if (type == typeof (DateTimeOffset))
-                               isDateTimeOffset = true;
-                       else if(type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>)) 
-                               isDateTimeOffset = type.GetGenericArguments () [0] == typeof (DateTimeOffset);  
-                       // It is the only exceptional type that does not serialize to string but serializes into complex element.
-                       if (isDateTimeOffset) {
-                               if (reader.IsEmptyElement) {
-                                       reader.Read ();
-                                       return default (DateTimeOffset);
-                               }
-                               reader.ReadStartElement ();
-                               reader.MoveToContent ();
-                               var date = reader.ReadElementContentAsDateTime ("DateTime", KnownTypeCollection.DefaultClrNamespaceSystem);
-                               var off = TimeSpan.FromMinutes (reader.ReadElementContentAsInt ("OffsetMinutes", KnownTypeCollection.DefaultClrNamespaceSystem));
-                               reader.MoveToContent ();
-                               reader.ReadEndElement ();
-                               return new DateTimeOffset (DateTime.SpecifyKind (date.ToUniversalTime () + off, DateTimeKind.Unspecified), off);
-                       }
-
-                       string value;
-                       if (reader.IsEmptyElement) {
-                               reader.Read (); // advance
-                               if (type.IsValueType)
-                                       return Activator.CreateInstance (type);
-                               else
-                                       // FIXME: Workaround for creating empty objects of the correct type.
-                                       value = String.Empty;
-                       }
-                       else
-                               value = reader.ReadElementContentAsString ();
-                       return KnownTypeCollection.PredefinedTypeStringToObject (value, qname.Name, reader);
-               }
-
-               object DeserializeByMap (QName name, Type type, XmlReader reader)
-               {
-                       SerializationMap map = null;
-                       // List<T> and T[] have the same QName, use type to find map work better.
-                       if(name.Name.StartsWith ("ArrayOf", StringComparison.Ordinal) || resolved_qnames.ContainsKey (name))
-                               map = types.FindUserMap (type);
-                       else
-                               map = types.FindUserMap (name); // use type when the name is "resolved" one. Otherwise use name (there are cases that type cannot be resolved by type).
-                       if (map == null && (name.Name.StartsWith ("ArrayOf", StringComparison.Ordinal) ||
-                           name.Namespace == KnownTypeCollection.MSArraysNamespace ||
-                           name.Namespace.StartsWith (KnownTypeCollection.DefaultClrNamespaceBase, StringComparison.Ordinal))) {
-                               var it = GetTypeFromNamePair (name.Name, name.Namespace);
-                               types.Add (it);
-                               map = types.FindUserMap (name);
-                       }
-                       if (map == null)
-                               throw new SerializationException (String.Format ("Unknown type {0} is used for DataContract with reference of name {1}. Any derived types of a data contract or a data member should be added to KnownTypes.", type, name));
-
-                       return map.DeserializeObject (reader, this);
-               }
-
-               Type GetTypeFromNamePair (string name, string ns)
-               {
-                       Type p = KnownTypeCollection.GetPrimitiveTypeFromName (new QName (name, ns));
-                       if (p != null)
-                               return p;
-                       bool makeArray = false;
-                       if (name.StartsWith ("ArrayOf", StringComparison.Ordinal)) {
-                               name = name.Substring (7); // strip "ArrayOf"
-                               if (ns == KnownTypeCollection.MSArraysNamespace)
-                                       return GetTypeFromNamePair (name, KnownTypeCollection.MSSimpleNamespace).MakeArrayType ();
-                               makeArray = true;
-                       }
-
-                       string dnsb = KnownTypeCollection.DefaultClrNamespaceBase;
-                       string clrns = ns.StartsWith (dnsb, StringComparison.Ordinal) ?  ns.Substring (dnsb.Length) : ns;
-
-                       foreach (var ass in AppDomain.CurrentDomain.GetAssemblies ()) {
-                               Type [] types;
-
-                               types = ass.GetTypes ();
-                               if (types == null)
-                                       continue;
-
-                               foreach (var t in types) {
-                                       // there can be null entries or exception throw to access the attribute - 
-                                       // at least when some referenced assemblies could not be loaded (affects moonlight)
-                                       if (t == null)
-                                               continue;
-
-                                       try {
-                                               var dca = t.GetCustomAttribute<DataContractAttribute> (true);
-                                               if (dca != null && dca.Name == name && dca.Namespace == ns)
-                                                       return makeArray ? t.MakeArrayType () : t;
-                                       }
-                                       catch (TypeLoadException tle) {
-                                               Console.Error.WriteLine (tle);
-                                               continue;
-                                       }
-                                       catch (FileNotFoundException fnfe) {
-                                               Console.Error.WriteLine (fnfe);
-                                               continue;
-                                       }
-
-                                       if (clrns != null && t.Name == name && t.Namespace == clrns)
-                                               return makeArray ? t.MakeArrayType () : t;
-                               }
-                       }
-                       throw new XmlException (String.Format ("Type not found; name: {0}, namespace: {1}", name, ns));
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs
deleted file mode 100644 (file)
index 4dae584..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-//
-// XmlFormatterSerializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Xml;
-using System.Xml.Schema;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       internal class XmlFormatterSerializer
-       {
-               XmlDictionaryWriter writer;
-               object graph;
-               KnownTypeCollection types;
-               
-               bool save_id;
-               bool ignore_unknown;
-               IDataContractSurrogate surrogate;
-               DataContractResolver resolver, default_resolver; // new in 4.0
-               int max_items;
-
-               List<object> objects = new List<object> ();
-               Dictionary<object,string> references = new Dictionary<object,string> (); // preserve possibly referenced objects to ids. (new in 3.5 SP1)
-
-               public static void Serialize (XmlDictionaryWriter writer, object graph, Type declaredType, KnownTypeCollection types,
-                       bool ignoreUnknown, int maxItems, string root_ns, bool preserveObjectReferences, DataContractResolver resolver, DataContractResolver defaultResolver)
-               {
-                       new XmlFormatterSerializer (writer, types, ignoreUnknown, maxItems, root_ns, preserveObjectReferences, resolver, defaultResolver)
-                               .Serialize (/*graph != null ? graph.GetType () : */declaredType, graph); // FIXME: I believe it should always use declaredType, but such a change brings some test breakages.
-               }
-
-               public XmlFormatterSerializer (XmlDictionaryWriter writer, KnownTypeCollection types, bool ignoreUnknown,
-                                              int maxItems, string root_ns, bool preserveObjectReferences,
-                                              DataContractResolver resolver, DataContractResolver defaultResolver)
-               {
-                       this.writer = writer;
-                       this.types = types;
-                       ignore_unknown = ignoreUnknown;
-                       max_items = maxItems;
-                       PreserveObjectReferences = preserveObjectReferences;
-                       this.resolver = resolver;
-                       this.default_resolver = defaultResolver;
-               }
-
-               public bool PreserveObjectReferences { get; private set; }
-
-               public List<object> SerializingObjects {
-                       get { return objects; }
-               }
-
-               public XmlDictionaryWriter Writer {
-                       get { return writer; }
-               }
-
-               public void Serialize (Type type, object graph)
-               {
-                       if (graph == null)
-                               writer.WriteAttributeString ("i", "nil", XmlSchema.InstanceNamespace, "true");
-                       else if (type == typeof (XmlElement))
-                               ((XmlElement) graph).WriteTo (Writer);
-                       else if (type == typeof (XmlNode [])) {
-                               foreach (var xn in (XmlNode []) graph)
-                                       xn.WriteTo (Writer);
-                       }
-                       else {
-                               QName resolvedQName = null;
-                               if (resolver != null) {
-                                       XmlDictionaryString rname, rns;
-                                       if (resolver.TryResolveType (graph != null ? graph.GetType () : typeof (object), type, default_resolver, out rname, out rns))
-                                               resolvedQName = new QName (rname.Value, rns.Value);
-                               }
-
-                               Type actualType = graph.GetType ();
-
-                               SerializationMap map;
-                               map = types.FindUserMap (actualType);
-                               // For some collection types, the actual type does not matter. So get nominal serialization type instead.
-                               // (The code below also covers the lines above, but I don't remove above lines to avoid extra search cost.)
-                               if (map == null) {
-                                       // FIXME: not sure if type.IsInterface is the correct condition to determine whether items are serialized with i:type or not. (e.g. bug #675144 server response).
-                                       actualType = types.GetSerializedType (type.IsInterface ? type : actualType);
-                                       map = types.FindUserMap (actualType);
-                               }
-                               // If it is still unknown, then register it.
-                               if (map == null) {
-                                       types.Add (actualType);
-                                       map = types.FindUserMap (actualType);
-                               }
-                               
-                               bool explicityType = false;
-                               if(type != actualType)
-                               {
-                                       // Check if underlying type of Nullable, mismatch the current type.
-                                       if(type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>))
-                                               explicityType = (type.GetGenericArguments () [0] != actualType);
-                                       else
-                                               explicityType = true;
-                               }
-
-                               if (explicityType && (map == null || map.OutputXsiType)) {
-                                       QName qname = resolvedQName ?? types.GetXmlName (actualType);
-                                       string name = qname.Name;
-                                       string ns = qname.Namespace;
-                                       if (qname == QName.Empty) {
-                                               name = XmlConvert.EncodeLocalName (actualType.Name);
-                                               ns = KnownTypeCollection.DefaultClrNamespaceBase + actualType.Namespace;
-                                       } else if (XmlSchemaType.GetBuiltInSimpleType (new QName (qname.Name, XmlSchema.Namespace)) != null)
-                                               ns = XmlSchema.Namespace;
-                                       if (writer.LookupPrefix (ns) == null) // it goes first (extraneous, but it makes att order compatible)
-                                               writer.WriteXmlnsAttribute (null, ns);
-                                       writer.WriteStartAttribute ("i", "type", XmlSchema.InstanceNamespace);
-                                       writer.WriteQualifiedName (name, ns);
-                                       writer.WriteEndAttribute ();
-                               }
-                               QName predef = KnownTypeCollection.GetPredefinedTypeName (actualType);
-                               if (predef != QName.Empty)
-                                       SerializePrimitive (type, graph, predef);
-                               else
-                                       map.Serialize (graph, this);
-                       }
-               }
-
-               public void SerializePrimitive (Type type, object graph, QName qname)
-               {
-                       string label;
-                       if (TrySerializeAsReference (false, graph, out label))
-                               return;
-                       if (label != null)
-                               Writer.WriteAttributeString ("z", "Id", KnownTypeCollection.MSSimpleNamespace, label);
-
-                       bool isDateTimeOffset = false;
-                       // Handle DateTimeOffset type and DateTimeOffset?
-                       if (type == typeof (DateTimeOffset))
-                               isDateTimeOffset = true;
-                       else if(type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>)) 
-                               isDateTimeOffset = type.GetGenericArguments () [0] == typeof (DateTimeOffset);  
-                       // It is the only exceptional type that does not serialize to string but serializes into complex element.
-                       if (isDateTimeOffset) {
-                               var v = (DateTimeOffset) graph;
-                               writer.WriteStartElement ("DateTime", KnownTypeCollection.DefaultClrNamespaceSystem);
-                               SerializePrimitive (typeof (DateTime), DateTime.SpecifyKind (v.DateTime.Subtract (v.Offset), DateTimeKind.Utc), KnownTypeCollection.GetPredefinedTypeName (typeof (DateTime)));
-                               writer.WriteEndElement ();
-                               writer.WriteStartElement ("OffsetMinutes", KnownTypeCollection.DefaultClrNamespaceSystem);
-                               SerializePrimitive (typeof (int), v.Offset.TotalMinutes, KnownTypeCollection.GetPredefinedTypeName (typeof (int)));
-                               writer.WriteEndElement ();
-                       }
-                       else
-                               writer.WriteString (KnownTypeCollection.PredefinedTypeObjectToString (graph));
-               }
-
-               public void WriteStartElement (string memberName, string memberNamespace, string contentNamespace)
-               {
-                       writer.WriteStartElement (memberName, memberNamespace);
-                       if (!string.IsNullOrEmpty (contentNamespace) && contentNamespace != memberNamespace)
-                               writer.WriteXmlnsAttribute (null, contentNamespace);
-               }
-
-               public void WriteEndElement ()
-               {
-                       writer.WriteEndElement ();
-               }
-
-               // returned bool: whether z:Ref is written or not.
-               // out label: object label either in use or newly allocated.
-               public bool TrySerializeAsReference (bool isMapReference, object graph, out string label)
-               {
-                       label = null;
-                       if (!isMapReference && (!PreserveObjectReferences || graph == null || graph.GetType ().IsValueType))
-                               return false;
-
-                       if (references.TryGetValue (graph, out label)) {
-                               Writer.WriteAttributeString ("z", "Ref", KnownTypeCollection.MSSimpleNamespace, label);
-                               label = null; // do not write label
-                               return true;
-                       }
-
-                       label = "i" + (references.Count + 1);
-                       references.Add (graph, label);
-
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlObjectSerializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlObjectSerializer.cs
deleted file mode 100644 (file)
index 2abb766..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// XmlObjectSerializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.IO;
-using System.Text;
-using System.Reflection;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Xml;
-using System.Xml.Schema;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       public abstract class XmlObjectSerializer
-       {
-               // This is only for compatible mode.
-               IDataContractSurrogate surrogate;
-
-               SerializationBinder binder;
-               ISurrogateSelector selector;
-
-               int max_items = 0x10000; // FIXME: could be from config.
-
-               protected XmlObjectSerializer ()
-               {
-               }
-
-               public virtual bool IsStartObject (XmlReader reader)
-               {
-                       return IsStartObject (XmlDictionaryReader.CreateDictionaryReader (reader));
-               }
-
-               public abstract bool IsStartObject (XmlDictionaryReader reader);
-
-               public virtual object ReadObject (Stream stream)
-               {
-                       var settings = new XmlReaderSettings ();
-                       settings.CheckCharacters = false;
-                       return ReadObject (XmlReader.Create (stream, settings));
-               }
-
-               public virtual object ReadObject (XmlReader reader)
-               {
-                       return ReadObject (XmlDictionaryReader.CreateDictionaryReader (reader));
-               }
-
-               public virtual object ReadObject (XmlDictionaryReader reader)
-               {
-                       return ReadObject (reader, true);
-               }
-
-               public virtual object ReadObject (XmlReader reader, bool readContentOnly)
-               {
-                       return ReadObject (
-                               XmlDictionaryReader.CreateDictionaryReader (reader),
-                               readContentOnly);
-               }
-
-               [MonoTODO]
-               public abstract object ReadObject (XmlDictionaryReader reader, bool readContentOnly);
-
-               public virtual void WriteObject (Stream stream, object graph)
-               {
-                       var settings = new XmlWriterSettings ();
-                       settings.Encoding = Encoding.UTF8;
-                       settings.CloseOutput = false;
-                       settings.OmitXmlDeclaration = true;
-                       settings.CheckCharacters = false;
-                       using (XmlWriter xw = XmlDictionaryWriter.CreateDictionaryWriter (XmlWriter.Create (stream, settings))) {
-                               WriteObject (xw, graph);
-                       }
-               }
-
-               public virtual void WriteObject (XmlWriter writer, object graph)
-               {
-                       WriteObject (XmlDictionaryWriter.CreateDictionaryWriter (writer), graph);
-               }
-
-               public virtual void WriteStartObject (XmlWriter writer, object graph)
-               {
-                       WriteStartObject (XmlDictionaryWriter.CreateDictionaryWriter (writer), graph);
-               }
-
-               public virtual void WriteObject (XmlDictionaryWriter writer, object graph)
-               {
-                       WriteStartObject (writer, graph);
-                       WriteObjectContent (writer, graph);
-                       WriteEndObject (writer);
-               }
-
-               public abstract void WriteStartObject (
-                       XmlDictionaryWriter writer, object graph);
-
-               public virtual void WriteObjectContent (XmlWriter writer, object graph)
-               {
-                       WriteObjectContent (
-                               XmlDictionaryWriter.CreateDictionaryWriter (writer),
-                               graph);
-               }
-
-               public abstract void WriteObjectContent (
-                       XmlDictionaryWriter writer, object graph);
-
-               public virtual void WriteEndObject (XmlWriter writer)
-               {
-                       WriteEndObject (XmlDictionaryWriter.CreateDictionaryWriter (writer));
-               }
-
-               public abstract void WriteEndObject (
-                       XmlDictionaryWriter writer);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlSerializableServices.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlSerializableServices.cs
deleted file mode 100644 (file)
index a2cf7e6..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// XmlSerializableServices.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Xml;
-using System.Xml.Schema;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       public static class XmlSerializableServices
-       {
-               static Dictionary<QName, XmlSchemaSet> defaultSchemas
-                       = new Dictionary<QName, XmlSchemaSet> ();
-
-               [MonoTODO]
-               public static void AddDefaultSchema (
-                       XmlSchemaSet schemas,
-                       QName typeQName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static XmlNode [] ReadNodes (XmlReader xmlReader)
-               {
-                       if (xmlReader.NodeType != XmlNodeType.Element || xmlReader.IsEmptyElement)
-                               return new XmlNode [0];
-
-                       int depth = xmlReader.Depth;
-                       xmlReader.Read ();
-                       if (xmlReader.NodeType == XmlNodeType.EndElement)
-                               return new XmlNode [0];
-
-                       List<XmlNode> al = new List<XmlNode> ();
-                       XmlDocument doc = new XmlDocument ();
-                       while (xmlReader.Depth > depth & !xmlReader.EOF)
-                               al.Add (doc.ReadNode (xmlReader));
-                       return al.ToArray ();
-               }
-
-               public static void WriteNodes (XmlWriter xmlWriter,
-                       XmlNode [] nodes)
-               {
-                       foreach (XmlNode n in nodes)
-                               n.WriteTo (xmlWriter);
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XsdDataContractExporter.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XsdDataContractExporter.cs
deleted file mode 100644 (file)
index b3959eb..0000000
+++ /dev/null
@@ -1,497 +0,0 @@
-//
-// XsdDataContractExporter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Xml;
-using System.Xml.Schema;
-using System.Xml.Serialization;
-
-using QName = System.Xml.XmlQualifiedName;
-
-//
-// .NET exports almost empty schema for "http://www.w3.org/2001/XMLSchema" that
-// contains only "schema" element which consists of a complexType with empty
-// definition (i.e. <complexType/> ).
-//
-
-namespace System.Runtime.Serialization
-{
-       public class XsdDataContractExporter
-       {
-               class TypeImportInfo
-               {
-                       public Type ClrType { get; set; }
-                       public QName RootElementName { get; set; }
-                       public XmlSchemaType SchemaType { get; set; }
-                       public QName  SchemaTypeName { get; set; }
-               }
-
-               static readonly List<TypeImportInfo> predefined_types;
-
-               static XsdDataContractExporter ()
-               {
-                       var l = new List<TypeImportInfo> ();
-                       predefined_types = l;
-                       if (!MSTypesSchema.IsCompiled)
-                               MSTypesSchema.Compile (null);
-                       foreach (XmlSchemaElement el in MSTypesSchema.Elements.Values) {
-                               var typeName = el.ElementSchemaType.QualifiedName;
-                               var info = new TypeImportInfo () {
-                                       RootElementName = el.QualifiedName,
-                                       SchemaType = typeName.Namespace == XmlSchema.Namespace ? null : el.ElementSchemaType,
-                                       SchemaTypeName = typeName,
-                                       ClrType = GetPredefinedTypeFromQName (typeName) };
-                               l.Add (info);
-                       }
-               }
-
-               // Note that this does not handle DBNull and DateTimeOffset
-               // (they are not included in the predefined schema)
-               static Type GetPredefinedTypeFromQName (QName qname)
-               {
-                       switch (qname.Namespace) {
-                       case XmlSchema.Namespace:
-                       case KnownTypeCollection.MSSimpleNamespace:
-                               return KnownTypeCollection.GetPrimitiveTypeFromName (qname);
-                       }
-                       throw new Exception ("Should not happen");
-               }
-
-               static XmlSchema mstypes_schema;
-               static XmlSchema MSTypesSchema {
-                       get {
-                               if (mstypes_schema == null) {
-                                       Assembly a = Assembly.GetCallingAssembly ();
-                                       Stream s = a.GetManifestResourceStream ("mstypes.schema");
-                                       mstypes_schema= XmlSchema.Read (s, null);
-                               }
-                               return mstypes_schema;
-                       }
-               }
-
-               KnownTypeCollection known_types = new KnownTypeCollection ();
-               List<TypeImportInfo> imported_types = new List<TypeImportInfo> ();
-
-               public XsdDataContractExporter ()
-                       : this (new XmlSchemaSet ())
-               {
-               }
-               
-               public XsdDataContractExporter (XmlSchemaSet schemas)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-#if false // by default this is the only added schema. But it is pointless...
-                       var xs = new XmlSchema () { TargetNamespace = XmlSchema.Namespace };
-                       xs.Items.Add (new XmlSchemaElement () { Name = "schema", SchemaType = new XmlSchemaComplexType () });
-                       schemas.Add (xs);
-#else // FIXME: it is added only when the included items are in use.
-                       schemas.Add (MSTypesSchema);
-#endif
-                       Schemas = schemas;
-               }
-               
-               public ExportOptions Options { get; set; }
-               public XmlSchemaSet Schemas { get; private set; }
-
-               // CanExport implementation
-
-               public bool CanExport (ICollection<Assembly> assemblies)
-               {
-                       if (assemblies == null)
-                               throw new ArgumentNullException ("assemblies");
-                       foreach (var ass in assemblies)
-                               if (!CanExport (ass.GetTypes ()))
-                                       return false;
-                       return true;
-               }
-               
-               public bool CanExport (ICollection<Type> types)
-               {
-                       if (types == null)
-                               throw new ArgumentNullException ("types");
-                       foreach (var type in types)
-                               if (!CanExport (type))
-                                       return false;
-                       return true;
-               }
-               
-               public bool CanExport (Type type)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-
-                       if (predefined_types.FirstOrDefault (i => i.ClrType == type) != null)
-                               return true;
-
-                       known_types.Add (type);
-                       return known_types.FindUserMap (type) != null;
-               }
-
-               // Export implementation
-
-               public void Export (ICollection<Assembly> assemblies)
-               {
-                       if (assemblies == null)
-                               throw new ArgumentNullException ("assemblies");
-                       foreach (var ass in assemblies)
-                               Export (ass.GetTypes ());
-               }
-               
-               public void Export (ICollection<Type> types)
-               {
-                       if (types == null)
-                               throw new ArgumentNullException ("types");
-                       foreach (var type in types)
-                               Export (type);
-               }
-               
-               public void Export (Type type)
-               {
-                       if (ExportCore (type, true)) {
-                               // This reprocess is required to clean up compilation state.
-                               foreach (XmlSchema xs in Schemas.Schemas ())
-                                       Schemas.Reprocess (xs);
-                               Schemas.Compile ();
-                       }
-               }
-
-               // returns true if it requires recompilcation
-               bool ExportCore (Type type, bool rejectNonContract)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-
-                       if (predefined_types.FirstOrDefault (i => i.ClrType == type) != null) {
-                               if (Schemas.Contains (MSTypesSchema.TargetNamespace))
-                                       return false; // exists
-                               Schemas.Add (MSTypesSchema);
-                               return false;
-                       }
-                       if (imported_types.FirstOrDefault (i => i.ClrType == type) != null)
-                               return false;
-
-                       known_types.Add (type);
-                       var map = known_types.FindUserMap (type);
-                       if (map == null)
-                               return false;
-                       map.ExportSchemaType (this);
-                       return true;
-               }
-               
-               internal void ExportDictionaryContractType (CollectionDataContractAttribute attr, SerializationMap map, Type dicType)
-               {
-                       var type = map.RuntimeType;
-                       var qname = map.XmlName;
-
-                       var typeArgs = dicType.IsGenericType ? dicType.GetGenericArguments () : null;
-                       var keyType = typeArgs != null ? typeArgs [0] : typeof (object);
-                       var valueType = typeArgs != null ? typeArgs [1] : typeof (object);
-                       ExportCore (keyType, false);
-                       ExportCore (valueType, false);
-
-                       string keyName = "Key", valueName = "Value";
-                       if (attr != null) {
-                               keyName = attr.KeyName ?? keyName;
-                               valueName = attr.ValueName ?? valueName;
-                       }
-                       string itemName = attr != null && attr.ItemName != null ? attr.ItemName : "KeyValueOf" + keyName + valueName;
-
-                       var ct = CreateComplexType (qname, type);
-                       var appInfo = new XmlSchemaAppInfo ();
-                       var node = new XmlDocument ().CreateElement ("IsDictionary", KnownTypeCollection.MSSimpleNamespace);
-                       node.InnerText = "true";
-                       appInfo.Markup = new XmlNode [] { node };
-                       ct.Annotation = new XmlSchemaAnnotation ();
-                       ct.Annotation.Items.Add (appInfo);
-
-                       var seq = new XmlSchemaSequence ();
-                       ct.Particle = seq;
-                       var el = new XmlSchemaElement () { Name = itemName, MinOccurs = 0, MaxOccursString = "unbounded" };
-                       seq.Items.Add (el);
-
-                       var dictType = new XmlSchemaComplexType ();
-                       el.SchemaType = dictType;
-                       var dictSeq = new XmlSchemaSequence ();
-                       dictType.Particle = dictSeq;
-                       dictSeq.Items.Add (new XmlSchemaElement () { Name = keyName, SchemaTypeName = GetSchemaTypeName (keyType), IsNillable = true });
-                       dictSeq.Items.Add (new XmlSchemaElement () { Name = valueName, SchemaTypeName = GetSchemaTypeName (valueType), IsNillable = true });
-               }
-               
-               internal void ExportListContractType (CollectionDataContractAttribute attr, CollectionTypeMap map)
-               {
-                       Type type = map.RuntimeType;
-                       var qname = map.XmlName;
-
-                       var typeArgs = type.IsGenericType ? type.GetGenericArguments () : null;
-                       if (typeArgs != null && typeArgs.Length != 1)
-                               throw new InvalidDataContractException ("CollectionDataContractAttribute is applied to non-collection type.");
-
-                       var itemType = typeArgs != null ? typeArgs [0] : type.IsArray ? type.GetElementType () : typeof (object);
-                       bool nullable = !itemType.IsValueType;
-                       if (itemType.IsGenericType && itemType.GetGenericTypeDefinition () == typeof (Nullable<>)) {
-                               itemType = itemType.GetGenericArguments () [0];
-                               nullable = true;
-                       }
-                       ExportCore (itemType, false);
-
-                       var itemQName = GetSchemaTypeName (itemType);
-                       var itemName = attr != null && attr.ItemName != null ? attr.ItemName : itemQName.Name;
-
-                       var ct = CreateComplexType (qname, type);
-                       var seq = new XmlSchemaSequence ();
-                       ct.Particle = seq;
-                       var el = new XmlSchemaElement () { Name = itemName, MinOccurs = 0, MaxOccursString = "unbounded", SchemaTypeName = itemQName, IsNillable = nullable };
-                       seq.Items.Add (el);
-
-                       /*
-                       var arrayType = new XmlSchemaComplexType ();
-                       el.SchemaType = arrayType;
-                       var arraySeq = new XmlSchemaSequence ();
-                       arrayType.Particle = arraySeq;
-                       arraySeq.Items.Add (new XmlSchemaElement () { Name = itemName, SchemaTypeName = itemQName, IsNillable = true });
-                       */
-               }
-
-               internal void ExportEnumContractType (DataContractAttribute attr, SerializationMap map)
-               {
-                       Type type = map.RuntimeType;
-                       var qname = map.XmlName;
-                       var st = CreateSimpleType (qname, type);
-                       if (type.GetCustomAttribute<FlagsAttribute> (false) != null) {
-                               var list = new XmlSchemaSimpleTypeList ();
-                               var sct = new XmlSchemaSimpleType ();
-                               sct.Content = CreateEnumMembers (type, attr != null);
-                               list.ItemType = sct;
-                               st.Content = list;
-                       }
-                       else
-                               st.Content = CreateEnumMembers (type, attr != null);
-               }
-
-               XmlSchemaSimpleTypeRestriction CreateEnumMembers (Type type, bool expectAttribute)
-               {
-                       var r = new XmlSchemaSimpleTypeRestriction () { BaseTypeName = GetSchemaTypeName (typeof (string)) };
-                       foreach (var mi in type.GetFields (BindingFlags.Public | BindingFlags.Static)) {
-                               var ema = expectAttribute ? mi.GetCustomAttribute<EnumMemberAttribute> (false) : null;
-                               if (expectAttribute && ema == null)
-                                       continue;
-                               var xe = new XmlSchemaEnumerationFacet () { Value = ema != null && ema.Value != null ? ema.Value : mi.Name };
-                               r.Facets.Add (xe);
-                       }
-                       return r;
-               }
-
-               internal void ExportStandardComplexType (DataContractAttribute attr, SerializationMap map, List<DataMemberInfo> members)
-               {
-                       Type type = map.RuntimeType;
-                       var qname = map.XmlName;
-                       var ct = CreateComplexType (qname, type);
-
-                       if (type.BaseType != null && type.BaseType != typeof (object)) {
-                               ExportCore (type.BaseType, false);
-                               var xcc = new XmlSchemaComplexContent ();
-                               ct.ContentModel = xcc;
-                               var xcce = new XmlSchemaComplexContentExtension ();
-                               xcc.Content = xcce;
-                               xcce.BaseTypeName = GetSchemaTypeName (type.BaseType);
-                               xcce.Particle = CreateMembersSequence (type, members, attr != null);
-                       }
-                       else
-                               ct.Particle = CreateMembersSequence (type, members, attr != null);
-               }
-
-               XmlSchemaSimpleType CreateSimpleType (QName qname, Type type)
-               {
-                       var xs = GetSchema (qname.Namespace);
-
-                       var el = new XmlSchemaElement () { Name = qname.Name, IsNillable = true };
-                       el.SchemaTypeName = qname;
-                       xs.Items.Add (el);
-                       var st = new XmlSchemaSimpleType () { Name = qname.Name };
-                       xs.Items.Add (st);
-                       imported_types.Add (new TypeImportInfo () { RootElementName = qname, SchemaType = st, SchemaTypeName = qname,  ClrType = type });
-
-                       return st;
-               }
-
-               XmlSchemaComplexType CreateComplexType (QName qname, Type type)
-               {
-                       var xs = GetSchema (qname.Namespace);
-
-                       var el = new XmlSchemaElement () { Name = qname.Name, IsNillable = true };
-                       el.SchemaTypeName = qname;
-                       xs.Items.Add (el);
-                       var ct = new XmlSchemaComplexType () { Name = qname.Name };
-                       xs.Items.Add (ct);
-                       imported_types.Add (new TypeImportInfo () { RootElementName = qname, SchemaType = ct, SchemaTypeName = qname,  ClrType = type });
-
-                       return ct;
-               }
-
-               static int CompareMembers (MemberInfo m1, MemberInfo m2)
-               {
-                       var a1 = m1.GetCustomAttribute<DataMemberAttribute> (false);
-                       var a2 = m2.GetCustomAttribute<DataMemberAttribute> (false);
-                       return a1.Order == a2.Order ? String.CompareOrdinal (a1.Name ?? m1.Name, a2.Name ?? m2.Name) : a1.Order - a2.Order;
-               }
-
-               // FIXME: use members parameter to determine which members are to be exported.
-               XmlSchemaSequence CreateMembersSequence (Type type, List<DataMemberInfo> dataMembers, bool expectContract)
-               {
-                       var seq = new XmlSchemaSequence ();
-                       var members = new List<MemberInfo> ();
-                       var flags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly;
-                       if (expectContract)
-                               flags |= BindingFlags.NonPublic;
-
-                       foreach (var mi in type.GetFields (flags))
-                               if (!expectContract || mi.GetCustomAttribute<DataMemberAttribute> (false) != null)
-                                       members.Add (mi);
-                       foreach (var mi in type.GetProperties (flags))
-                               if ((!expectContract || mi.GetCustomAttribute<DataMemberAttribute> (false) != null) && mi.GetIndexParameters ().Length == 0)
-                                       members.Add (mi);
-
-                       if (expectContract)
-                               members.Sort (CompareMembers);
-
-                       foreach (var mi in members) {
-                               var dma = mi.GetCustomAttribute<DataMemberAttribute> (false);
-                               var fi = mi as FieldInfo;
-                               var pi = mi as PropertyInfo;
-                               var mt = fi != null ? fi.FieldType : pi.PropertyType;
-                               bool nullable = !mt.IsValueType;
-                               if (mt.IsGenericType && mt.GetGenericTypeDefinition () == typeof (Nullable<>)) {
-                                       mt = mt.GetGenericArguments () [0];
-                                       nullable = true;
-                               }
-                               ExportCore (mt, false);
-
-                               var name = dma != null && dma.Name != null ? dma.Name : mi.Name;
-                               var xe = new XmlSchemaElement () { Name = name, IsNillable = nullable };
-                               xe.SchemaTypeName = GetSchemaTypeName (mt);
-                               seq.Items.Add (xe);
-                       }
-                       return seq;
-               }
-
-               XmlSchema GetSchema (string ns)
-               {
-                       foreach (XmlSchema xs in Schemas.Schemas (ns))
-                               return xs;
-                       var nxs = new XmlSchema () { ElementFormDefault = XmlSchemaForm.Qualified };
-                       if (!String.IsNullOrEmpty (ns))
-                               nxs.TargetNamespace = ns;
-                       Schemas.Add (nxs);
-                       return nxs;
-               }
-
-               string GetXmlTypeName (Type type)
-               {
-                       var qname = KnownTypeCollection.GetPrimitiveTypeName (type);
-                       if (!qname.Equals (QName.Empty))
-                               return qname.Name;
-                       var ret = type.Name;
-                       int idx = ret.IndexOf ('`');
-                       return idx < 0 ? ret : ret.Substring (0, idx);
-               }
-
-               string GetXmlNamespace (Type type)
-               {
-                       foreach (ContractNamespaceAttribute a in type.Assembly.GetCustomAttributes (typeof (ContractNamespaceAttribute), false))
-                               if (a.ClrNamespace == type.Namespace)
-                                       return a.ContractNamespace;
-                       return KnownTypeCollection.DefaultClrNamespaceBase + type.Namespace;
-               }
-
-               // get mapping info (either exported or predefined).
-
-               public QName GetRootElementName (Type type)
-               {
-                       var info = predefined_types.FirstOrDefault (i => i.ClrType == type);
-                       if (info != null)
-                               return info.RootElementName;
-                       info = imported_types.FirstOrDefault (i => i.ClrType == type);
-                       if (info != null && info.RootElementName != null)
-                               return info.RootElementName;
-
-                       return GetSchemaTypeName (type);
-               }
-               
-               public XmlSchemaType GetSchemaType (Type type)
-               {
-                       var info = predefined_types.FirstOrDefault (i => i.ClrType == type);
-                       if (info != null)
-                               return info.SchemaType;
-                       info = imported_types.FirstOrDefault (i => i.ClrType == type);
-                       if (info != null)
-                               return info.SchemaType;
-
-                       return null;
-               }
-               
-               public QName GetSchemaTypeName (Type type)
-               {
-                       var info = predefined_types.FirstOrDefault (i => i.ClrType == type);
-                       if (info != null)
-                               return info.SchemaTypeName;
-                       info = imported_types.FirstOrDefault (i => i.ClrType == type);
-                       if (info != null && info.SchemaTypeName != null)
-                               return info.SchemaTypeName;
-
-                       known_types.Add (type);
-                       var map = known_types.FindUserMap (type);
-                       if (map != null)
-                               return map.XmlName;
-
-                       // The following lines would be mostly redundant (legacy code now that it widely uses SerializationMap.XmlName for consistency...)
-
-                       var cdca = type.GetCustomAttribute<CollectionDataContractAttribute> (false);
-                       if (cdca != null)
-                               return new QName (cdca.Name ?? GetXmlTypeName (type), cdca.Namespace ?? GetXmlNamespace (type));
-                       var dca = type.GetCustomAttribute<DataContractAttribute> (false);
-                       if (dca != null)
-                               return new QName (dca.Name ?? GetXmlTypeName (type), dca.Namespace ?? GetXmlNamespace (type));
-
-                       if (type.IsArray) {
-                               var item = GetSchemaTypeName (type.GetElementType ());
-                               if (item.Namespace == XmlSchema.Namespace)
-                                       return new QName ("ArrayOf" + item.Name, KnownTypeCollection.MSArraysNamespace);
-                               return new QName ("ArrayOf" + item.Name, item.Namespace);
-                       }
-
-                       return new QName (type.Name, KnownTypeCollection.DefaultClrNamespaceBase + type.Namespace);
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XsdDataContractImporter.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XsdDataContractImporter.cs
deleted file mode 100644 (file)
index 28bc270..0000000
+++ /dev/null
@@ -1,1085 +0,0 @@
-//
-// XsdDataContractImporter.cs
-//
-// Authors:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//      Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
-//               2012 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Xml;
-using System.Xml.Schema;
-using System.Xml.Serialization;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       [MonoTODO ("support arrays")]
-       public class XsdDataContractImporter
-       {
-               static readonly XmlQualifiedName qname_anytype = new XmlQualifiedName ("anyType", XmlSchema.Namespace);
-
-               public XsdDataContractImporter ()
-                       : this (null)
-               {
-               }
-
-               public XsdDataContractImporter (CodeCompileUnit codeCompileUnit)
-               {
-                       // null argument is ok.
-                       CodeCompileUnit = codeCompileUnit ?? new CodeCompileUnit ();
-
-                       // Options is null by default
-               }
-
-               public CodeCompileUnit CodeCompileUnit { get; private set; }
-
-               CodeDomProvider code_provider = CodeDomProvider.CreateProvider ("csharp");
-               Dictionary<CodeNamespace,CodeIdentifiers> identifiers_table = new Dictionary<CodeNamespace,CodeIdentifiers> ();
-               ImportOptions import_options;
-
-               public ImportOptions Options {
-                       get { return import_options; }
-                       set {
-                               import_options = value;
-                               code_provider = value.CodeProvider ?? code_provider;
-                       }
-               }
-
-               void GenerateXmlType (XmlQualifiedName qname)
-               {
-                       var cns = GetCodeNamespace (qname.Namespace);
-                       var td = new CodeTypeDeclaration () {
-                               Name = GetUniqueName (CodeIdentifier.MakeValid (qname.Name), cns),
-                               TypeAttributes = GenerateInternal ? TypeAttributes.NotPublic : TypeAttributes.Public,
-                               IsPartial = true };
-                       cns.Types.Add (td);
-                       td.BaseTypes.Add (new CodeTypeReference (typeof (IXmlSerializable)));
-
-                       var thisNodes = new CodePropertyReferenceExpression (new CodeThisReferenceExpression (), "Nodes"); // property this.Nodes
-                       var xmlSerializableServices = new CodeTypeReferenceExpression (typeof (XmlSerializableServices)); // static XmlSerializableServices.
-                       var qnameType = new CodeTypeReference (typeof (XmlQualifiedName));
-
-                       // XmlQualifiedName qname = new XmlQualifiedName ({qname.Name}, {qname.Namespace});
-                       td.Members.Add (new CodeMemberField () { Name = "qname", Type = qnameType, InitExpression = new CodeObjectCreateExpression (qnameType, new CodePrimitiveExpression (qname.Name), new CodePrimitiveExpression (qname.Namespace)) });
-
-                       // public XmlNode[] Nodes { get; set; }
-                       td.Members.Add (new CodeMemberProperty () { Name = "Nodes", Type = new CodeTypeReference (typeof (XmlNode [])), Attributes = (GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public) | MemberAttributes.Final, HasGet = true, HasSet = true });
-
-                       // public void ReadXml(XmlReader reader) {
-                       var read = new CodeMemberMethod () { Name = "ReadXml", Attributes = (GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public) | MemberAttributes.Final };
-                       read.Parameters.Add (new CodeParameterDeclarationExpression (new CodeTypeReference (typeof (XmlReader)), "reader"));
-                       //   this.Nodes = XmlSerializableServices.ReadXml(reader);
-                       read.Statements.Add (
-                               new CodeAssignStatement (thisNodes,
-                                       new CodeMethodInvokeExpression (
-                                               new CodeMethodReferenceExpression (xmlSerializableServices, "ReadXml"),
-                                               new CodeArgumentReferenceExpression ("reader"))));
-                       // }
-                       td.Members.Add (read);
-
-                       // public void WriteXml(XmlWriter writer) {
-                       var write = new CodeMemberMethod () { Name = "WriteXml",Attributes = (GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public) | MemberAttributes.Final };
-                       write.Parameters.Add (new CodeParameterDeclarationExpression (new CodeTypeReference (typeof (XmlWriter)), "writer"));
-                       //   XmlSerializableServices.WriteXml(writer, this.Nodes);
-                       write.Statements.Add (
-                               new CodeMethodInvokeExpression (
-                                       new CodeMethodReferenceExpression (xmlSerializableServices, "WriteXml"),
-                                       new CodeArgumentReferenceExpression ("writer"),
-                                       thisNodes));
-                       // }
-                       td.Members.Add (write);
-
-                       // public XmlSchema GetSchema () { return null; }
-                       var getSchema = new CodeMemberMethod () { Name = "GetSchema", Attributes = (GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public) | MemberAttributes.Final, ReturnType = new CodeTypeReference (typeof (XmlSchema)) };
-                       getSchema.Statements.Add (new CodeMethodReturnStatement (new CodePrimitiveExpression (null)));
-                       td.Members.Add (getSchema);
-
-                       // public static XmlQualifiedName ExportSchema (XmlSchemaSet schemas) {
-                       var export = new CodeMemberMethod () { Name = "ExportSchema", Attributes = (GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public) | MemberAttributes.Final | MemberAttributes.Static, ReturnType = qnameType };
-                       export.Parameters.Add (new CodeParameterDeclarationExpression (new CodeTypeReference (typeof (XmlSchemaSet)), "schemas"));
-                       //   XmlSerializableServices.AddDefaultSchema (schemas);
-                       export.Statements.Add (new CodeMethodInvokeExpression (xmlSerializableServices, "AddDefaultSchema", new CodeArgumentReferenceExpression ("schemas")));
-                       //   return qname;
-                       export.Statements.Add (new CodeMethodReturnStatement (new CodeFieldReferenceExpression (new CodeThisReferenceExpression (), "qname")));
-                       // }
-                       td.Members.Add (export);
-               }
-
-               // CanImport
-
-               public bool CanImport (XmlSchemaSet schemas)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-
-                       PrepareSchemas (schemas);
-
-                       foreach (XmlSchemaElement xe in schemas.GlobalElements.Values)
-                               if (!CanImport (schemas, xe))
-                                       return false;
-                       return true;
-               }
-
-               public bool CanImport (XmlSchemaSet schemas, ICollection<XmlQualifiedName> typeNames)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-                       if (typeNames == null)
-                               throw new ArgumentNullException ("typeNames");
-
-                       PrepareSchemas (schemas);
-
-                       foreach (var name in typeNames)
-                               if (!CanImport (schemas, name))
-                                       return false;
-                       return true;
-               }
-
-               public bool CanImport (XmlSchemaSet schemas, XmlQualifiedName typeName)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-                       if (typeName == null)
-                               throw new ArgumentNullException ("typeName");
-
-                       PrepareSchemas (schemas);
-
-                       if (IsPredefinedType (typeName))
-                               return true; // while it just ignores...
-
-                       if (!schemas.GlobalTypes.Contains (typeName))
-                               return false;
-
-                       return CanImport (schemas, schemas.GlobalTypes [typeName] as XmlSchemaType);
-               }
-
-               public bool CanImport (XmlSchemaSet schemas, XmlSchemaElement element)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-                       if (element == null)
-                               throw new ArgumentNullException ("element");
-
-                       PrepareSchemas (schemas);
-
-                       if (element.ElementSchemaType != null)
-                               return CanImport (schemas, element.ElementSchemaType as XmlSchemaType);
-                       else if (element.SchemaTypeName != null && !element.SchemaTypeName.Equals (QName.Empty))
-                               return CanImport (schemas, element.SchemaTypeName);
-                       else
-                               // anyType
-                               return true;
-               }
-
-
-#if true // new
-               bool CanImport (XmlSchemaSet schemas, XmlSchemaType type)
-               {
-                       if (IsPredefinedType (type.QualifiedName))
-                               return true;
-
-                       var st = type as XmlSchemaSimpleType;
-                       if (st != null) {
-                               return CanImportSimpleType (schemas, st);
-                       } else {
-                               var ct = (XmlSchemaComplexType) type;
-                               var sc = ct.ContentModel as XmlSchemaSimpleContent;
-                               if (sc != null) {
-                                       if (sc.Content is XmlSchemaSimpleContentExtension)
-                                               return false;
-                               }
-                               if (!CanImportComplexType (schemas, ct))
-                                       return false;
-                               return true;
-                       }
-               }
-
-               bool CanImportSimpleType (XmlSchemaSet schemas, XmlSchemaSimpleType type)
-               {
-                       var scl = type.Content as XmlSchemaSimpleTypeList;
-                       if (scl != null) {
-                               if (scl.ItemType == null)
-                                       return false;
-                               var itemType = scl.ItemType as XmlSchemaSimpleType;
-                               var ir = itemType.Content as XmlSchemaSimpleTypeRestriction;
-                               if (ir == null)
-                                       return false;
-                               return true; // as enum
-                       }
-                       var scr = type.Content as XmlSchemaSimpleTypeRestriction;
-                       if (scr != null)
-                               return true; // as enum
-
-                       return false;
-               }
-
-               bool CanImportComplexType (XmlSchemaSet schemas, XmlSchemaComplexType type)
-               {
-                       foreach (XmlSchemaAttribute att in type.AttributeUses.Values)
-                               if (att.Use != XmlSchemaUse.Optional || att.QualifiedName.Namespace != KnownTypeCollection.MSSimpleNamespace)
-                                       return false;
-
-                       CodeTypeReference baseClrType = null;
-                       var particle = type.Particle;
-                       if (type.ContentModel != null) {
-                               var xsscr = type.ContentModel.Content as XmlSchemaSimpleContentRestriction;
-                               if (xsscr != null) {
-                                       if (xsscr.BaseType != null) {
-                                               if (!CanImport (schemas, xsscr.BaseType))
-                                                       return false;
-                                       } else {
-                                               if (!CanImport (schemas, xsscr.BaseTypeName))
-                                                       return false;
-                                       }
-                                       // The above will result in an error, but make sure to show we don't support it.
-                                       return false;
-                               }
-                               var xscce = type.ContentModel.Content as XmlSchemaComplexContentExtension;
-                               if (xscce != null) {
-                                       if (!CanImport (schemas, xscce.BaseTypeName))
-                                               return false;
-                                       baseClrType = GetCodeTypeReferenceInternal (xscce.BaseTypeName, false);
-
-                                       var baseInfo = GetTypeInfo (xscce.BaseTypeName, false);
-                                       particle = xscce.Particle;
-                               }
-                               var xsccr = type.ContentModel.Content as XmlSchemaComplexContentRestriction;
-                               if (xsccr != null)
-                                       return false;
-                       }
-
-                       var seq = particle as XmlSchemaSequence;
-                       if (seq == null && particle != null)
-                               return false;
-
-                       if (seq != null) {
-
-                       if (seq.Items.Count == 1 && seq.Items [0] is XmlSchemaAny && type.Parent is XmlSchemaElement) {
-
-                               // looks like it is not rejected (which contradicts the error message on .NET). See XsdDataContractImporterTest.ImportTestX32(). Also ImporTestX13() for Parent check.
-
-                       } else {
-
-                       foreach (var child in seq.Items)
-                               if (!(child is XmlSchemaElement))
-                                       return false;
-
-                       bool isDictionary = false;
-                       if (type.Annotation != null) {
-                               foreach (var ann in type.Annotation.Items) {
-                                       var ai = ann as XmlSchemaAppInfo;
-                                       if (ai != null && ai.Markup != null &&
-                                           ai.Markup.Length > 0 &&
-                                           ai.Markup [0].NodeType == XmlNodeType.Element &&
-                                           ai.Markup [0].LocalName == "IsDictionary" &&
-                                           ai.Markup [0].NamespaceURI == KnownTypeCollection.MSSimpleNamespace)
-                                               isDictionary = true;
-                               }
-                       }
-
-                       if (seq.Items.Count == 1) {
-                               var pt = (XmlSchemaParticle) seq.Items [0];
-                               var xe = pt as XmlSchemaElement;
-                               if (pt.MaxOccursString == "unbounded") {
-                                       // import as a collection contract.
-                                       if (pt is XmlSchemaAny) {
-                                       } else if (isDictionary) {
-                                               var kvt = xe.ElementSchemaType as XmlSchemaComplexType;
-                                               var seq2 = kvt != null ? kvt.Particle as XmlSchemaSequence : null;
-                                               var k = seq2 != null && seq2.Items.Count == 2 ? seq2.Items [0] as XmlSchemaElement : null;
-                                               var v = seq2 != null && seq2.Items.Count == 2 ? seq2.Items [1] as XmlSchemaElement : null;
-                                               if (k == null || v == null)
-                                                       return false;
-                                               if (!CanImport (schemas, k.ElementSchemaType))
-                                                       return false;
-                                               if (!CanImport (schemas, v.ElementSchemaType))
-                                                       return false;
-                                               
-                                               return true;
-                                       } else if (type.QualifiedName.Namespace == KnownTypeCollection.MSArraysNamespace &&
-                                                  IsPredefinedType (xe.ElementSchemaType.QualifiedName)) {
-                                               // then this CodeTypeDeclaration is to be removed, and CodeTypeReference to this type should be an array instead.
-                                               return true;
-                                       }
-                                       else
-                                               if (!CanImport (schemas, xe.ElementSchemaType))
-                                                       return false;
-                                       return true;
-                               }
-                       }
-                       if (isDictionary)
-                               return false;
-
-                       // import as a (normal) contract.
-                       var elems = new List<XmlSchemaElement> ();
-                       foreach (XmlSchemaElement xe in seq.Items) {
-                               if (xe.MaxOccurs != 1)
-                                       return false;
-
-                               if (elems.Any (e => e.QualifiedName.Name == xe.QualifiedName.Name))
-                                       return false;
-
-                               elems.Add (xe);
-                       }
-                       foreach (var xe in elems) {
-                               // import property type in prior.
-                               if (!CanImport (schemas, xe.ElementSchemaType.QualifiedName))
-                                       return false;
-                       }
-
-                       } // if (seq contains only an xs:any)
-                       } // if (seq != 0)
-
-                       return true;
-               }
-#else
-               bool CanImport (XmlSchemaSet schemas, XmlSchemaComplexType type)
-               {
-                       if (type == null || type.QualifiedName.Namespace == XmlSchema.Namespace) // xs:anyType -> not supported.
-                               return false;
-
-                       if (type.ContentModel is XmlSchemaSimpleContent) // simple content derivation is not supported.
-                               return false;
-                       if (type.ContentModel != null && type.ContentModel.Content != null) {
-                               var xscce = type.ContentModel.Content as XmlSchemaComplexContentExtension;
-                               if (xscce == null) // complex DBR is not supported.
-                                       return false;
-                               // check base type
-                               if (xscce.BaseTypeName != qname_anytype && !CanImport (schemas, xscce.BaseTypeName))
-                                       return false;
-                       }
-
-                       return true;
-               }
-#endif
-
-               // Import
-
-               void PrepareSchemas (XmlSchemaSet schemas)
-               {
-                       if (!schemas.Contains (KnownTypeCollection.MSSimpleNamespace))
-                               schemas.Add (XmlSchema.Read (GetType ().Assembly.GetManifestResourceStream ("mstypes.schema"), null));
-
-                       if (!schemas.IsCompiled)
-                               schemas.Compile ();
-               }
-
-               public void Import (XmlSchemaSet schemas)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-
-                       PrepareSchemas (schemas);
-
-                       foreach (XmlSchemaElement xe in schemas.GlobalElements.Values)
-                               Import (schemas, xe);
-               }
-
-               public void Import (XmlSchemaSet schemas, ICollection<XmlQualifiedName> typeNames)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-                       if (typeNames == null)
-                               throw new ArgumentNullException ("typeNames");
-                       foreach (var name in typeNames)
-                               Import (schemas, name);
-               }
-
-               // This checks type existence and raises an error if it is missing.
-               public void Import (XmlSchemaSet schemas, XmlQualifiedName typeName)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-                       if (typeName == null)
-                               throw new ArgumentNullException ("typeName");
-
-                       PrepareSchemas (schemas);
-
-                       if (IsPredefinedType (typeName))
-                               return;
-
-                       if (!schemas.GlobalTypes.Contains (typeName))
-                               throw new InvalidDataContractException (String.Format ("Type {0} is not found in the schemas", typeName));
-
-                       Import (schemas, schemas.GlobalTypes [typeName] as XmlSchemaType, typeName);
-               }
-
-               public XmlQualifiedName Import (XmlSchemaSet schemas, XmlSchemaElement element)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-                       if (element == null)
-                               throw new ArgumentNullException ("element");
-
-                       var elname = element.QualifiedName;
-
-                       if (IsPredefinedType (element.SchemaTypeName))
-                               return elname;
-
-                       switch (elname.Namespace) {
-                       case KnownTypeCollection.MSSimpleNamespace:
-                               switch (elname.Name) {
-                               case "char":
-                               case "duration":
-                               case "guid":
-                                       return elname;
-                               }
-                               break;
-                       }
-
-                       if (!CanImport (schemas, element) && Options != null && Options.ImportXmlType) {
-                               var qn = element.QualifiedName;
-                               GenerateXmlType (qn);
-                               return qn;
-                       }
-
-                       if (element.ElementSchemaType != null) {
-                               if (IsCollectionType (element.ElementSchemaType))
-                                       elname = element.ElementSchemaType.QualifiedName;
-                       }
-
-                       // FIXME: use element to fill nillable and arrays.
-                       var qname =
-                               elname != null && !elname.Equals (QName.Empty) ? elname :
-                               element.ElementSchemaType != null ? element.ElementSchemaType.QualifiedName :
-                               qname_anytype;
-
-                       if (element.ElementSchemaType != null)
-                               Import (schemas, element.ElementSchemaType, qname);
-                       else if (element.SchemaTypeName != null && !element.SchemaTypeName.Equals (QName.Empty))
-                               Import (schemas, schemas.GlobalTypes [element.SchemaTypeName] as XmlSchemaType, qname);
-                       // otherwise it is typeless == anyType.
-                       else
-                               Import (schemas, XmlSchemaType.GetBuiltInComplexType (qname_anytype), qname);
-
-                       return qname;
-               }
-
-               void Import (XmlSchemaSet schemas, XmlSchemaType type)
-               {
-                       if (!CanImport (schemas, type) && Options != null && Options.ImportXmlType) {
-                               GenerateXmlType (type.QualifiedName);
-                               return;
-                       }
-                       Import (schemas, type, type.QualifiedName);
-               }
-
-               void Import (XmlSchemaSet schemas, XmlSchemaType type, XmlQualifiedName qname)
-               {
-                       var existing = imported_types.FirstOrDefault (it => it.XsdType == type);
-                       if (existing != null)
-                               return;// existing.XsdTypeName;
-
-                       if (IsPredefinedType (type.QualifiedName))
-                               return;
-
-                       DoImport (schemas, type, qname);
-               }
-
-               string GetUniqueName (string name, CodeNamespace cns)
-               {
-                       CodeIdentifiers i;
-                       if (!identifiers_table.TryGetValue (cns, out i)) {
-                               i = new CodeIdentifiers ();
-                               identifiers_table.Add (cns, i);
-                       }
-                       return i.AddUnique (name, null);
-               }
-
-               void DoImport (XmlSchemaSet schemas, XmlSchemaType type, XmlQualifiedName qname)
-               {
-                       CodeNamespace cns = null;
-                       CodeTypeReference clrRef;
-                       cns = GetCodeNamespace (qname.Namespace);
-                       clrRef = new CodeTypeReference (cns.Name.Length > 0 ? cns.Name + "." + qname.Name : qname.Name);
-
-                       var td = new CodeTypeDeclaration () {
-                               Name = GetUniqueName (CodeIdentifier.MakeValid (qname.Name), cns),
-                               TypeAttributes = GenerateInternal ? TypeAttributes.NotPublic : TypeAttributes.Public,
-                               IsPartial = true };
-                       cns.Types.Add (td);
-
-                       var info = new TypeImportInfo () { ClrType = clrRef, XsdType = type,  XsdTypeName = qname };
-                       imported_types.Add (info);
-
-                       var st = type as XmlSchemaSimpleType;
-                       if (st != null) {
-                               ImportSimpleType (td, schemas, st, qname);
-                       } else {
-                               var ct = (XmlSchemaComplexType) type;
-                               var sc = ct.ContentModel as XmlSchemaSimpleContent;
-                               if (sc != null) {
-                                       if (sc.Content is XmlSchemaSimpleContentExtension)
-                                               throw new InvalidDataContractException (String.Format ("complex type '{0}' with simple content extension is not supported", type.QualifiedName));
-                               }
-                               if (!ImportComplexType (td, schemas, ct, qname)) {
-                                       cns.Types.Remove (td);
-                                       if (cns.Types.Count == 0)
-                                               CodeCompileUnit.Namespaces.Remove (cns);
-                               }
-
-                               foreach (var impinfo in imported_types)
-                                       for (; impinfo.KnownTypeOutputIndex < impinfo.KnownClrTypes.Count; impinfo.KnownTypeOutputIndex++)
-                                               td.CustomAttributes.Add (new CodeAttributeDeclaration (
-                                                       new CodeTypeReference (typeof (KnownTypeAttribute)),
-                                                       new CodeAttributeArgument (new CodeTypeOfExpression (impinfo.KnownClrTypes [impinfo.KnownTypeOutputIndex]))));
-                       }
-               }
-
-               static readonly string ass_name = typeof (DataContractAttribute).Assembly.GetName ().Name;
-               static readonly string ass_version = typeof (DataContractAttribute).Assembly.GetName ().Version.ToString ();
-               static readonly CodeTypeReference typeref_data_contract = new CodeTypeReference (typeof (DataContractAttribute));
-               static readonly CodeTypeReference typeref_coll_contract = new CodeTypeReference (typeof (CollectionDataContractAttribute));
-
-               void AddTypeAttributes (CodeTypeDeclaration td, XmlSchemaType type, params XmlSchemaElement [] collectionArgs)
-               {
-                       var name = type.QualifiedName;
-                       // [GeneratedCode (assembly_name, assembly_version)]
-                       td.CustomAttributes.Add (new CodeAttributeDeclaration (
-                               new CodeTypeReference (typeof (GeneratedCodeAttribute)),
-                               new CodeAttributeArgument (new CodePrimitiveExpression (ass_name)),
-                               new CodeAttributeArgument (new CodePrimitiveExpression (ass_version))));
-
-                       var ct = type as XmlSchemaComplexType;
-
-                       // [DataContract(Name="foobar",Namespace="urn:foobar")] (optionally IsReference=true),
-                       // or [CollectionDataContract(ditto, ItemType/KeyType/ValueType)]
-                       var dca = new CodeAttributeDeclaration (
-                               collectionArgs != null && collectionArgs.Length > 0 ? typeref_coll_contract : typeref_data_contract,
-                               new CodeAttributeArgument ("Name", new CodePrimitiveExpression (name.Name)),
-                               new CodeAttributeArgument ("Namespace", new CodePrimitiveExpression (name.Namespace)));
-                       if (collectionArgs != null) {
-                               if (collectionArgs.Length > 0)
-                                       dca.Arguments.Add (new CodeAttributeArgument ("ItemName", new CodePrimitiveExpression (CodeIdentifier.MakeValid (collectionArgs [0].QualifiedName.Name))));
-                               if (collectionArgs.Length > 2) {
-                                       dca.Arguments.Add (new CodeAttributeArgument ("KeyName", new CodePrimitiveExpression (CodeIdentifier.MakeValid (collectionArgs [1].QualifiedName.Name))));
-                                       dca.Arguments.Add (new CodeAttributeArgument ("ValueName", new CodePrimitiveExpression (CodeIdentifier.MakeValid (collectionArgs [2].QualifiedName.Name))));
-                               }
-                       }
-                       if (ct != null && ct.AttributeUses [new XmlQualifiedName ("Ref", KnownTypeCollection.MSSimpleNamespace)] != null)
-                               dca.Arguments.Add (new CodeAttributeArgument ("IsReference", new CodePrimitiveExpression (true)));
-                       td.CustomAttributes.Add (dca);
-
-                       // optional [Serializable]
-                       if (Options != null && Options.GenerateSerializable)
-                               td.CustomAttributes.Add (new CodeAttributeDeclaration ("System.SerializableAttribute"));
-               }
-
-               static readonly CodeTypeReference typeref_ext_iface = new CodeTypeReference ("System.Runtime.Serialization.IExtensibleDataObject");
-               static readonly CodeTypeReference typeref_ext_class = new CodeTypeReference ("System.Runtime.Serialization.ExtensionDataObject");
-
-               void AddExtensionData (CodeTypeDeclaration td)
-               {
-                       td.BaseTypes.Add (typeref_ext_iface);
-
-                       var field = new CodeMemberField (typeref_ext_class, "extensionDataField");
-                       td.Members.Add (field);
-
-                       var prop = new CodeMemberProperty () { Type = field.Type, Name = "ExtensionData", Attributes = (GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public) | MemberAttributes.Final };
-                       prop.GetStatements.Add (new CodeMethodReturnStatement (
-                               new CodeFieldReferenceExpression (
-                               new CodeThisReferenceExpression (),
-                               "extensionDataField")));
-                       prop.SetStatements.Add (new CodeAssignStatement (
-                               new CodeFieldReferenceExpression (
-                               new CodeThisReferenceExpression (),
-                               "extensionDataField"),
-                               new CodePropertySetValueReferenceExpression ()));
-
-                       td.Members.Add (prop);
-               }
-
-               void ImportSimpleType (CodeTypeDeclaration td, XmlSchemaSet schemas, XmlSchemaSimpleType type, XmlQualifiedName qname)
-               {
-                       var scl = type.Content as XmlSchemaSimpleTypeList;
-                       if (scl != null) {
-                               if (scl.ItemType == null)
-                                       throw new InvalidDataContractException (String.Format ("simple type list is allowed only with an anonymous simple type with enumeration restriction content as its item type definition (type is {0})", type.QualifiedName));
-                               var itemType = scl.ItemType as XmlSchemaSimpleType;
-                               var ir = itemType.Content as XmlSchemaSimpleTypeRestriction;
-                               if (ir == null)
-                                       throw new InvalidDataContractException (String.Format ("simple type list is allowed only with an anonymous simple type with enumeration restriction content as its item type definition (type is {0})", type.QualifiedName));
-                               ImportEnum (td, schemas, ir, type, qname, true);
-                               return;
-                       }
-                       var scr = type.Content as XmlSchemaSimpleTypeRestriction;
-                       if (scr != null) {
-                               ImportEnum (td, schemas, scr, type, qname, false);
-                               return;
-                       }
-
-                       throw new InvalidDataContractException (String.Format ("simple type is supported only if it has enumeration or list of an anonymous simple type with enumeration restriction content as its item type definition (type is {0})", qname));
-               }
-
-               static readonly CodeTypeReference enum_member_att_ref = new CodeTypeReference (typeof (EnumMemberAttribute));
-
-               void ImportEnum (CodeTypeDeclaration td, XmlSchemaSet schemas, XmlSchemaSimpleTypeRestriction r, XmlSchemaType type, XmlQualifiedName qname, bool isFlag)
-               {
-                       if (isFlag && !r.BaseTypeName.Equals (new XmlQualifiedName ("string", XmlSchema.Namespace)))
-                               throw new InvalidDataContractException (String.Format ("For flags enumeration '{0}', the base type for the simple type restriction must be XML schema string", qname));
-
-                       td.IsEnum = true;
-                       AddTypeAttributes (td, type);
-                       if (isFlag)
-                               td.CustomAttributes.Add (new CodeAttributeDeclaration (new CodeTypeReference (typeof (FlagsAttribute))));
-
-                       foreach (var facet in r.Facets) {
-                               var e = facet as XmlSchemaEnumerationFacet;
-                               if (e == null)
-                                       throw new InvalidDataContractException (String.Format ("Invalid simple type restriction (type {0}). Only enumeration is allowed.", qname));
-                               var em = new CodeMemberField () { Name = CodeIdentifier.MakeValid (e.Value) };
-                               var ea = new CodeAttributeDeclaration (enum_member_att_ref);
-                               if (e.Value != em.Name)
-                                       ea.Arguments.Add (new CodeAttributeArgument ("Value", new CodePrimitiveExpression (e.Value)));
-                               em.CustomAttributes.Add (ea);
-                               td.Members.Add (em);
-                       }
-               }
-
-               // Returns false if it should remove the imported type.
-               bool IsCollectionType (XmlSchemaType type)
-               {
-                       var complex = type as XmlSchemaComplexType;
-                       if (complex == null)
-                               return false;
-
-                       var seq = complex.Particle as XmlSchemaSequence;
-                       if (seq == null)
-                               return false;
-
-                       if (seq.Items.Count == 1 && seq.Items [0] is XmlSchemaAny && complex.Parent is XmlSchemaElement)
-                               return false;
-
-                       if (type.Annotation != null) {
-                               foreach (var ann in type.Annotation.Items) {
-                                       var ai = ann as XmlSchemaAppInfo;
-                                       if (ai != null && ai.Markup != null &&
-                                           ai.Markup.Length > 0 &&
-                                           ai.Markup [0].NodeType == XmlNodeType.Element &&
-                                           ai.Markup [0].LocalName == "IsDictionary" &&
-                                           ai.Markup [0].NamespaceURI == KnownTypeCollection.MSSimpleNamespace)
-                                               return true;
-                               }
-                       }
-                                       
-                       if (seq.Items.Count != 1)
-                               return false;
-
-                       var pt = (XmlSchemaParticle) seq.Items [0];
-                       var xe = pt as XmlSchemaElement;
-                       if (pt.MaxOccursString != "unbounded")
-                               return false;
-
-                       return !(pt is XmlSchemaAny);
-               }
-
-               // Returns false if it should remove the imported type.
-               bool ImportComplexType (CodeTypeDeclaration td, XmlSchemaSet schemas, XmlSchemaComplexType type, XmlQualifiedName qname)
-               {
-                       foreach (XmlSchemaAttribute att in type.AttributeUses.Values)
-                               if (att.Use != XmlSchemaUse.Optional || att.QualifiedName.Namespace != KnownTypeCollection.MSSimpleNamespace)
-                                       throw new InvalidDataContractException (String.Format ("attribute in DataContract complex type '{0}' is limited to those in {1} namespace, and optional.", qname, KnownTypeCollection.MSSimpleNamespace));
-
-                       CodeTypeReference baseClrType = null;
-                       var particle = type.Particle;
-                       if (type.ContentModel != null) {
-                               var xsscr = type.ContentModel.Content as XmlSchemaSimpleContentRestriction;
-                               if (xsscr != null) {
-                                       if (xsscr.BaseType != null)
-                                               Import (schemas, xsscr.BaseType);
-                                       else
-                                               Import (schemas, xsscr.BaseTypeName);
-                                       // The above will result in an error, but make sure to show we don't support it.
-                                       throw new InvalidDataContractException (String.Format ("complex type simple content restriction is not supported in DataContract (type '{0}')", qname));
-                               }
-                               var xscce = type.ContentModel.Content as XmlSchemaComplexContentExtension;
-                               if (xscce != null) {
-                                       Import (schemas, xscce.BaseTypeName);
-                                       baseClrType = GetCodeTypeReferenceInternal (xscce.BaseTypeName, false);
-                                       if (baseClrType != null)
-                                               td.BaseTypes.Add (baseClrType);
-
-                                       var baseInfo = GetTypeInfo (xscce.BaseTypeName, false);
-                                       if (baseInfo != null)
-                                               baseInfo.KnownClrTypes.Add (imported_types.First (it => it.XsdType == type).ClrType);
-                                       particle = xscce.Particle;
-                               }
-                               var xsccr = type.ContentModel.Content as XmlSchemaComplexContentRestriction;
-                               if (xsccr != null)
-                                       throw new InvalidDataContractException (String.Format ("complex content type (for type '{0}') has a restriction content model, which is not supported in DataContract.", qname));
-                       }
-
-                       var seq = particle as XmlSchemaSequence;
-                       if (seq == null && particle != null)
-                               throw new InvalidDataContractException (String.Format ("Not supported particle {1}. In DataContract, only sequence particle is allowed as the top-level content of a complex type (type '{0}')", qname, particle));
-
-                       if (seq != null) {
-
-                       if (seq.Items.Count == 1 && seq.Items [0] is XmlSchemaAny && type.Parent is XmlSchemaElement) {
-
-                               // looks like it is not rejected (which contradicts the error message on .NET). See XsdDataContractImporterTest.ImportTestX32(). Also ImporTestX13() for Parent check.
-
-                       } else {
-
-                       foreach (var child in seq.Items)
-                               if (!(child is XmlSchemaElement))
-                                       throw new InvalidDataContractException (String.Format ("Only local element is allowed as the content of the sequence of the top-level content of a complex type '{0}'. Other particles (sequence, choice, all, any, group ref) are not supported.", qname));
-
-                       bool isDictionary = false;
-                       if (type.Annotation != null) {
-                               foreach (var ann in type.Annotation.Items) {
-                                       var ai = ann as XmlSchemaAppInfo;
-                                       if (ai != null && ai.Markup != null &&
-                                           ai.Markup.Length > 0 &&
-                                           ai.Markup [0].NodeType == XmlNodeType.Element &&
-                                           ai.Markup [0].LocalName == "IsDictionary" &&
-                                           ai.Markup [0].NamespaceURI == KnownTypeCollection.MSSimpleNamespace)
-                                               isDictionary = true;
-                               }
-                       }
-
-                       /*
-                        * Collection Type Support:
-                        * 
-                        * We need to distinguish between normal array/dictionary collections and
-                        * custom collection types which use [CollectionDataContract].
-                        * 
-                        * The name of a normal collection type starts with "ArrayOf" and uses the
-                        * element type's namespace.  We use the collection type directly and don't
-                        * generate a proxy class for these.
-                        * 
-                        * The collection type (and the base class or a custom collection's proxy type)
-                        * is dermined by 'ImportOptions.ReferencedCollectionTypes'.  The default is to
-                        * use an array for list collections and Dictionary<,> for dictionaries.
-                        * 
-                        * Note that my implementation currently only checks for generic type definitions
-                        * in the 'ImportOptions.ReferencedCollectionTypes' - it looks for something that
-                        * implements IEnumerable<T> or IDictionary<K,V>.  This is not complete, but it's
-                        * all that's necessary to support different collection types in a GUI.
-                        * 
-                        * Simply use
-                        *     var options = new ImportOptions ();
-                        *     options.ReferencedCollectionTypes.Add (typeof (LinkedList<>));
-                        *     options.ReferencedCollectionTypes.Add (typeof (SortedList<,>));
-                        * to configure these; see XsdDataContractImportTest2.cs for some examples.
-                        * 
-                        */
-
-                       if (seq.Items.Count == 1) {
-                               var pt = (XmlSchemaParticle) seq.Items [0];
-                               var xe = pt as XmlSchemaElement;
-                               if (pt.MaxOccursString == "unbounded") {
-                                       // import as a collection contract.
-                                       if (pt is XmlSchemaAny) {
-                                       } else if (isDictionary) {
-                                               var kvt = xe.ElementSchemaType as XmlSchemaComplexType;
-                                               var seq2 = kvt != null ? kvt.Particle as XmlSchemaSequence : null;
-                                               var k = seq2 != null && seq2.Items.Count == 2 ? seq2.Items [0] as XmlSchemaElement : null;
-                                               var v = seq2 != null && seq2.Items.Count == 2 ? seq2.Items [1] as XmlSchemaElement : null;
-                                               if (k == null || v == null)
-                                                       throw new InvalidDataContractException (String.Format ("Invalid Dictionary contract type '{0}'. A Dictionary schema type must have a sequence particle which contains exactly two schema elements for key and value.", type.QualifiedName));
-                                               return ImportCollectionType (td, schemas, type, k, v);
-                                       }
-                                       return ImportCollectionType (td, schemas, type, xe);
-                               }
-                       }
-                       if (isDictionary)
-                               throw new InvalidDataContractException (String.Format ("complex type '{0}' is an invalid Dictionary type definition. A Dictionary must have a sequence particle with exactly two child elements", qname));
-
-                       // import as a (normal) contract.
-                       var elems = new List<XmlSchemaElement> ();
-                       foreach (XmlSchemaElement xe in seq.Items) {
-                               if (xe.MaxOccurs != 1)
-                                       throw new InvalidDataContractException (String.Format ("schema complex type '{0}' has a content sequence containing an element '{1}' with 'maxOccurs' value as more than 1, which is not supported in DataContract.", qname, xe.QualifiedName));
-
-                               if (elems.Any (e => e.QualifiedName.Name == xe.QualifiedName.Name))
-                                       throw new InvalidDataContractException (String.Format ("In schema type '{0}', there already is an element whose name is {1}, where duplicate of element names are not supported.", qname, xe.QualifiedName.Name));
-
-                               elems.Add (xe);
-                       }
-                       foreach (var xe in elems) {
-                               // import property type in prior.
-                               Import (schemas, xe.ElementSchemaType.QualifiedName);
-                               AddProperty (td, xe);
-                       }
-
-                       } // if (seq contains only an xs:any)
-                       } // if (seq != 0)
-
-                       AddTypeAttributes (td, type);
-                       AddExtensionData (td);
-
-                       return true;
-               }
-
-               bool ImportCollectionType (CodeTypeDeclaration td, XmlSchemaSet schemas,
-                                          XmlSchemaComplexType type,
-                                          XmlSchemaElement key, XmlSchemaElement value)
-               {
-                       Import (schemas, key.ElementSchemaType);
-                       Import (schemas, value.ElementSchemaType);
-                       var keyType = GetCodeTypeReference (key.ElementSchemaType.QualifiedName);
-                       var valueType = GetCodeTypeReference (value.ElementSchemaType.QualifiedName);
-
-                       var collectionType = GetDictionaryCollectionType ();
-                       var baseTypeName = collectionType != null ?
-                               collectionType.FullName : "System.Collections.Generic.Dictionary";
-
-                       if (type.QualifiedName.Name.StartsWith ("ArrayOf")) {
-                               // Standard collection, use the collection type instead of
-                               // creating a proxy class.
-                               var cti = imported_types.First (i => i.XsdType == type);
-                               cti.ClrType = new CodeTypeReference (baseTypeName, keyType, valueType);
-                               return false;
-                       }
-
-                       td.BaseTypes.Add (new CodeTypeReference (baseTypeName, keyType, valueType));
-                       AddTypeAttributes (td, type, key);
-                       AddTypeAttributes (td, type, value);
-                       return true;
-               }
-
-               bool ImportCollectionType (CodeTypeDeclaration td, XmlSchemaSet schemas,
-                                          XmlSchemaComplexType type, XmlSchemaElement xe)
-               {
-                       Import (schemas, xe.ElementSchemaType);
-                       var element = GetCodeTypeReference (xe.ElementSchemaType.QualifiedName);
-
-                       var collectionType = GetListCollectionType ();
-
-                       if (type.QualifiedName.Name.StartsWith ("ArrayOf")) {
-                               // Standard collection, use the collection type instead of
-                               // creating a proxy class.
-                               var cti = imported_types.First (i => i.XsdType == type);
-                               if (collectionType != null)
-                                       cti.ClrType = new CodeTypeReference (collectionType.FullName, element);
-                               else
-                                       cti.ClrType = new CodeTypeReference (element, 1);
-                               return false;
-                       }
-
-                       var baseTypeName = collectionType != null ?
-                               collectionType.FullName : "System.Collections.Generic.List";
-
-                       td.BaseTypes.Add (new CodeTypeReference (baseTypeName, element));
-                       AddTypeAttributes (td, type, xe);
-                       return true;
-               }
-
-               bool ImplementsInterface (Type type, Type iface)
-               {
-                       foreach (var i in type.GetInterfaces ()) {
-                               if (i.Equals (iface))
-                                       return true;
-                               if (i.IsGenericType && i.GetGenericTypeDefinition ().Equals (iface))
-                                       return true;
-                       }
-
-                       return false;
-               }
-
-               Type GetListCollectionType ()
-               {
-                       if (import_options == null)
-                               return null;
-                       var listTypes = import_options.ReferencedCollectionTypes.Where (
-                               t => t.IsGenericTypeDefinition && t.GetGenericArguments ().Length == 1 &&
-                               ImplementsInterface (t, typeof (IEnumerable<>)));
-                       return listTypes.FirstOrDefault ();
-               }
-
-               Type GetDictionaryCollectionType ()
-               {
-                       if (import_options == null)
-                               return null;
-                       var dictTypes = import_options.ReferencedCollectionTypes.Where (
-                               t => t.IsGenericTypeDefinition && t.GetGenericArguments ().Length == 2 &&
-                               ImplementsInterface (t, typeof (IDictionary<,>)));
-                       return dictTypes.FirstOrDefault ();
-               }
-
-               static readonly CodeExpression this_expr = new CodeThisReferenceExpression ();
-               static readonly CodeExpression arg_value_expr = new CodePropertySetValueReferenceExpression ();
-
-               bool GenerateInternal {
-                       get { return Options != null && Options.GenerateInternal; }
-               }
-
-               void AddProperty (CodeTypeDeclaration td, XmlSchemaElement xe)
-               {
-                       var att = GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public;
-                       var fi = new CodeMemberField () { Name = CodeIdentifier.MakeValid (xe.QualifiedName.Name + "Field"), Type = GetCodeTypeReference (xe.ElementSchemaType.QualifiedName, xe) };
-                       td.Members.Add (fi);
-                       var pi = new CodeMemberProperty () { Name = xe.QualifiedName.Name, Attributes = att, HasGet = true, HasSet = true, Type = fi.Type };
-                       // [DataMember(Name=foobar, IsRequired=!nillable)]
-                       var dma = new CodeAttributeDeclaration (
-                               new CodeTypeReference (typeof (DataMemberAttribute)));
-                       if (fi.Name != xe.QualifiedName.Name)
-                               new CodeAttributeArgument ("Name", new CodePrimitiveExpression (xe.QualifiedName.Name));
-                       if (!xe.IsNillable)
-                               new CodeAttributeArgument ("IsRequired", new CodePrimitiveExpression (true));
-                       pi.CustomAttributes.Add (dma);
-
-                       pi.GetStatements.Add (new CodeMethodReturnStatement () { Expression = new CodeFieldReferenceExpression (this_expr, fi.Name) });
-                       pi.SetStatements.Add (new CodeAssignStatement (new CodeFieldReferenceExpression (this_expr, fi.Name), arg_value_expr));
-
-
-                       td.Members.Add (pi);
-               }
-
-               bool IsPredefinedType (XmlQualifiedName qname)
-               {
-                       if (qname == null)
-                               return false;
-                       switch (qname.Namespace) {
-                       case KnownTypeCollection.MSSimpleNamespace:
-                               return KnownTypeCollection.GetPrimitiveTypeFromName (qname) != null;
-                       case XmlSchema.Namespace:
-                               return XmlSchemaType.GetBuiltInSimpleType (qname) != null || XmlSchemaType.GetBuiltInComplexType (qname) != null;
-                       }
-                       return false;
-               }
-
-               CodeNamespace GetCodeNamespace (string xmlns)
-               {
-                       string ns = null;
-                       if (Options == null || !Options.Namespaces.TryGetValue (xmlns, out ns))
-                               ns = GetCodeNamespaceFromXmlns (xmlns);
-
-                       foreach (CodeNamespace cns in CodeCompileUnit.Namespaces)
-                               if (cns.Name == ns)
-                                       return cns;
-                       var newCns = new CodeNamespace () { Name = ns };
-                       CodeCompileUnit.Namespaces.Add (newCns);
-                       return newCns;
-               }
-
-               const string default_ns_prefix = "http://schemas.datacontract.org/2004/07/";
-
-               string GetCodeNamespaceFromXmlns (string xns)
-               {
-                       if (xns.StartsWith (default_ns_prefix, StringComparison.Ordinal))
-                               xns = xns.Substring (default_ns_prefix.Length);
-                       else {
-                               Uri u;
-                               string tmp;
-                               if (Uri.TryCreate (xns, UriKind.Absolute, out u) && (tmp = MakeStringNamespaceComponentsValid (u.GetComponents (UriComponents.Host | UriComponents.Path, UriFormat.Unescaped))).Length > 0)
-                                       xns = tmp;
-                       }
-                       return MakeStringNamespaceComponentsValid (xns);
-               }
-
-               static readonly char [] split_tokens = new char [] {'/', '.'};
-
-               string MakeStringNamespaceComponentsValid (string ns)
-               {
-                       var arr = ns.Split (split_tokens, StringSplitOptions.RemoveEmptyEntries);
-                       for (int i = 0; i < arr.Length; i++)
-                               arr [i] = CodeIdentifier.MakeValid (arr [i]);
-                       return String.Join (".", arr);
-               }
-
-               // Post-compilation information retrieval
-
-               TypeImportInfo GetTypeInfo (XmlQualifiedName typeName, bool throwError)
-               {
-                       var info = imported_types.FirstOrDefault (
-                               i => i.XsdTypeName.Equals (typeName) || i.XsdType.QualifiedName.Equals (typeName));
-                       if (info == null) {
-                               if (throwError)
-                                       throw new InvalidOperationException (String.Format ("schema type '{0}' has not been imported yet. Import it first.", typeName));
-                               return null;
-                       }
-                       return info;
-               }
-
-               public CodeTypeReference GetCodeTypeReference (XmlQualifiedName typeName)
-               {
-                       return GetCodeTypeReferenceInternal (typeName, true);
-               }
-
-               CodeTypeReference GetCodeTypeReferenceInternal (XmlQualifiedName typeName, bool throwError)
-               {
-                       if (typeName == null)
-                               throw new ArgumentNullException ("typeName");
-
-                       switch (typeName.Namespace) {
-                       case XmlSchema.Namespace:
-                       case KnownTypeCollection.MSSimpleNamespace:
-                               var pt = KnownTypeCollection.GetPrimitiveTypeFromName (typeName);
-                               if (pt == null)
-                                       throw new ArgumentException (String.Format ("Invalid type name in a predefined namespace: {0}", typeName));
-                               return new CodeTypeReference (pt);
-                       }
-
-                       var info = GetTypeInfo (typeName, throwError);
-                       return info != null ? info.ClrType : null;
-               }
-
-               [MonoTODO ("use element argument and fill Nullable etc.")]
-               public CodeTypeReference GetCodeTypeReference (XmlQualifiedName typeName, XmlSchemaElement element)
-               {
-                       if (typeName == null)
-                               throw new ArgumentNullException ("typeName");
-                       if (element == null)
-                               throw new ArgumentNullException ("element");
-
-                       return GetCodeTypeReference (typeName);
-               }
-
-               public ICollection<CodeTypeReference> GetKnownTypeReferences (XmlQualifiedName typeName)
-               {
-                       if (typeName == null)
-                               throw new ArgumentNullException ("typeName");
-
-                       return GetTypeInfo (typeName, true).KnownClrTypes;
-               }
-
-               List<TypeImportInfo> imported_types = new List<TypeImportInfo> ();
-
-               class TypeImportInfo
-               {
-                       public TypeImportInfo ()
-                       {
-                               KnownClrTypes = new List<CodeTypeReference> ();
-                       }
-
-                       public CodeTypeReference ClrType { get; set; }
-                       public XmlQualifiedName XsdTypeName { get; set; }
-                       public XmlSchemaType XsdType { get; set; }
-                       public List<CodeTypeReference> KnownClrTypes { get; private set; }
-                       public int KnownTypeOutputIndex { get; set; } // updated while importing.
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/ChangeLog b/mcs/class/System.Runtime.Serialization/System.Xml/ChangeLog
deleted file mode 100755 (executable)
index 25af315..0000000
+++ /dev/null
@@ -1,632 +0,0 @@
-2010-06-02 Atsushi Enomoto  <atsushi@ximian.com>
-
-        * XmlBinaryDictionaryReader.cs : reset name in Reset().
-          Fixed bug #599479.
-
-2010-02-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : try to lookup dictionary string in
-         WriteNode(). This is part of #577139 fix (probably).
-
-2010-02-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : for text '0' and '1', write 0x80 and
-         0x82 instead of 0x99 [0x30|0x31]. This cosmetic fix gives identical
-         writer output for #577139 (and yet it still doesn't work).
-
-2009-12-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : slightly more descriptive errmsg.
-
-2009-12-01  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * XmlDictionaryReader.cs: Fix ReadValueAsBase64 return value and
-       remove NET_2_1 (gui-compare shows this in our 3.0 SP1 profile)
-
-2009-09-21  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * XmlDictionaryWriter.cs: Remove usage of XmlMtomDictionaryWriter
-       for NET_2_1
-
-2009-07-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : ReadValueAsBase64(byte[],int,int) is only
-         in SL2.
-
-2009-07-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : read false (0x84) and true (0x86).
-
-2009-07-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSimpleDictionaryWriter.cs : fix bogus import of
-         XmlWriter.WriteNode() to handle more than two elements.
-
-2009-06-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : fix GetAttribute() that returns
-         attributes from cache that are *not* in current element.
-
-2009-06-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : there was wrong reusage of nodes
-         when the node was at the top of the stack. It was added twice and
-         call to reset resulted in end element with empty names.
-
-2009-05-29  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : allow mapping an identical prefix
-         to different xmlns in different element level.
-
-2009-05-29  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : allow writing xml/xmlns attributes
-         without specifying their corresponding namespaces.
-
-2009-05-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : fix regression on stream consumption
-         excess.
-
-2009-05-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : ReadContentString() returned
-         doubled string result.
-
-2009-05-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : fix utf16 array on getting its
-         length. Report correct length (since BinaryReader is directly used
-         it makes no sense to incompletely keep track of position in Source).
-
-2009-05-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : support reader quotas.
-
-2009-05-07  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * UniqueId.cs: Fix attributes for v3.5 (and later 2.0 SP) and remove
-       them (in particular [SecurityTreatAsSafe]) from the NET_2_1 build.
-
-2009-04-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : several fixes;
-         - Name property was always empty.
-         - Value property was always empty for attributes.
-         - TextIndex node type was not supported.
-         - node reset at Read() was incomplete.
-         - attribute Prefix for single character had wrong value.
-         - namespace nodes did not appear as attribute nodes.
-         - attribute value node must be always single. Another text node
-           means a text child of the element, not the following attr value.
-         tests will go in sys.servicemodel.
-
-2009-04-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlMtomDictionaryReader.cs : new.
-       * XmlDictionaryReader.cs : implemented CreateMtomReader().
-
-2009-04-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlMtomDictionaryWriter.cs : new.
-       * XmlDictionaryWriter.cs : implement CreateMtomWriter().
-
-2009-04-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : add ReadStartElement() overload.
-
-2009-04-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * UniqueId.cs : add missing security attributes.
-       * XmlDictionaryReader.cs : cleanup extra TODOs.
-       * XmlBinaryDictionaryReader.cs : iplement IsArray.
-
-2009-03-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlDictionaryWriter.cs :
-         a couple of fixes to reflect correct values for node properties
-         on each read step.
-
-2009-03-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlBinaryFormat.cs :
-         support array operation (0x03) on reader too.
-
-2009-03-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : removed lots of unused part.
-
-2009-03-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriterAutoGen.cs : generated code.
-       * XmlBinaryFormat.cs, XmlBinaryDictionaryWriter.cs :
-         support array operation (0x03) and a bunch of WriteArray() methods.
-
-2009-03-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlBinaryDictionaryWriter.cs
-         XmlBinaryFormat.cs : implemented element with short prefix.
-
-2009-03-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryFormat.cs, XmlBinaryDictionaryWriter.cs :
-         resolved all namespace and QName issues.
-
-2009-03-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : further namespace refactory.
-         namespaces are managed by its own (to work fine for both string
-         and dictionary string).
-
-2009-03-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryFormat.cs, XmlBinaryDictionaryReader.cs,
-         XmlBinaryDictionaryWriter.cs : improved shorthanded prefix
-         support. Not only autocreated prefixes but also explicitly-
-         specified 'a' .. 'z' prefixes are mapped as shorthand.
-         Some significant (and ongoing) namespace support changes.
-
-2009-03-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryFormat.cs, XmlBinaryDictionaryWriter.cs :
-         added some incomplete code for QName support.
-
-2009-03-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlBinaryFormat.cs :
-         handle utf16 typed nodes. (not sure if it is used in writer.)
-
-2009-03-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : oops, fix build.
-
-2009-03-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs, XmlBinaryDictionaryReader.cs,
-         XmlBinaryFormat.cs, : reverted Uuid change (UniqueId is different).
-         Updated TODO status. Removed extra BinaryReader type.
-
-2009-03-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlBinaryDictionaryWriter.cs,
-         XmlBinaryFormat.cs : fixed couple of issues regarding text and
-         base64 fixed-length buffers (their sizes are not variant).
-         Some ongoing changes on reading dummy-prefixed attributes.
-
-2009-03-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlBinaryFormat.cs,
-         XmlBinaryDictionaryWriter.cs : couple of enhancements to support
-         missing types, Dictionary string lookups and indexing fixes.
-         Also reflect some correction by [MC-NBFX] (MS OSPed document).
-       * XmlBinaryReaderSession.cs : implemented.
-
-2009-03-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : more not-understandable bits.
-
-2009-03-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : implemented ReadFullStartElement (full??).
-
-2009-03-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : implemented missing && understandable
-         members.
-
-2009-03-02  Chris Toshok  <toshok@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlSimpleDictionaryReader.cs: 2.1
-       has HasValue.
-
-2009-02-13  Jonathan Pryor  <jpryor@novell.com>
-
-       * UniqueId.cs: Remove most [MonoTODO]s and NotImplementedExceptions.
-         Revert the 2009-02-12 UniqueId.IsGuid "fix", as .NET says that 
-         new UniqueId(new Guid()).IsGuid==false (which makes no sense, as
-         .ToString() on the same instance includes the "urn:uuid:" prefix,
-         which is used by Guids...).
-
-2009-02-13  Jonathan Pryor  <jpryor@novell.com>
-
-       * XmlDictionaryWriter.cs: Implement WriteValue(IStreamProvider).
-
-2009-02-13  Jonathan Pryor  <jpryor@novell.com>
-
-       * XmlDictionaryWriter.cs: Implement
-         WriteTextNode(XmlDictionaryReader,bool).  This requires changes to
-         WriteNode(), as testing had determined that WriteTextNode() is used
-         instead of WriteString() for Text nodes and attribute values when
-         called via WriteNode().
-
-2009-02-12  Jonathan Pryor  <jpryor@novell.com>
-
-       * XmlDictionaryWriter.cs: Implement WriteValue(Guid),
-         WriteValue(TimeSpan), WriteValue(UniqueId).
-       * UniqueId.cs: Fix UniqueId.IsGuid, as `new UniqueId(new Guid())` was
-         previously being detected as a string value, not a Guid value.
-
-2009-02-12  Jonathan Pryor  <jpryor@novell.com>
-
-       * XmlDictionaryWriter.cs (WriteStartElement): Add parameter checking
-         and default arguments to avoid NullReferenceExceptions.
-
-2009-02-11  Jonathan Pryor  <jpryor@novell.com>
-
-       * XmlDictionaryString.cs: Add constructor argument checking.
-
-2009-02-10  Jonathan Pryor  <jpryor@novell.com>
-
-       * IFragmentCapableXmlDictionaryWriter.cs: Added.
-
-2008-09-09  Atsushi Enomoto  <atsushi@ximian.com>
-                       Jb Evain  <jbevain@novell.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlSimpleDictionaryReader.cs:
-       add support to build on the net_2_1 profile.
-
-2008-04-10  Eyal Alaluf <eyala@mainsoft.com>
-
-       * XmlBinaryDictionaryWriter.cs: WriteXmlnsAttribute generates a prefix
-         when given a null prefix.
-
-2008-03-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs :
-         - It didn't clean namespaces up during Read().
-         - Non-typed attribute nodes should be allowed in get_Value().
-         - Fixed wrong namespace scope push.
-
-2008-02-27 Eyal Alaluf <eyala@mainsoft.com>
-
-       * XmlBinaryDictionaryReader.cs: Handle compilation warnings.
-       * XmlSimpleDictionaryReader.cs: Added onClose handling.
-       * XmlDictionaryReader.cs: Simple implementation of CreateTextReader.
-
-2008-02-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : Even with UTF8 (marked) .net does not
-         output BOMs, so use always unmarked utf8 for any UTF8 encodings.
-
-2008-02-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : Since it does not support XML declaration
-         its encoding is limited to utf16 and utf8. Null argument check.
-
-2007-11-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : WriteNode() is override, not new.
-
-2007-07-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : store Depth for dummy prefix output.
-         WriteXmlnsAttribute() writes dummy prefix when null prefix is given.
-       * XmlSimpleDictionaryWriter.cs, XmlBinaryDictionaryWriter.cs :
-         increment Depth on WriteStartElement() and decrement it on
-         WriteEndElement(). They don't have to be complete, just fine as
-         long as it correctly creates a dummy.
-
-2007-04-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryFormat.cs : added Base64Fixed (0xA0).
-       * XmlBinaryDictionaryReader.cs : support 0xA0 type above.
-         ReadInt() refactoring. Handle float and double value types.
-
-2007-03-30  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs :
-         implemented some ReadContentAs[Type]() methods.
-       * XmlDictionaryReader.cs :
-         Added Read[[Element]ContentAs]String() implementations.
-       * XmlDictionaryReaderAutoGen.cs : regenerated
-
-2007-03-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : simply return false for
-         TryGet[Base64|Array]Length().
-       * XmlBinaryDictionaryReader.cs : Value string should be pupulated
-         for typed value nodes.
-
-2007-03-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : more ongoing updates (valuetype support,
-         key support updates, ReadElementContentAsBase64).
-
-2007-03-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryFormat.cs, XmlBinaryDictionaryWriter.cs :
-         support following operators; 0x80 (integer 0), 0x82 (integer 1) and
-         0xAE (UniqueId which is created from Guid).
-         Little fix for length output.
-
-2007-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : fix infinite loop.
-
-2007-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : added couple of missing methods.
-
-2007-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReaderAutoGen.cs : regenerated.
-
-2007-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : ongoing updates to the 3.0 RTM
-         format.
-
-2007-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : for XmlWriterBinarySession lookup,
-         internal dictionary lookup should be string-based, since otherwise
-         it will never return correct dictionary string stored when the
-         dictionary string is from another dictionary.
-       * XmlBinaryWriterSession.cs :
-         TryLookup() is now based on string value comparison.
-         Reverted internal dictionary to int->XmlDictionaryString form,
-         as I don't use TryGetValue() anymore.
-
-2007-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : WriteValue(Decimal) is working now.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryFormat.cs : new file, collection of constants.
-       * XmlBinaryDictionaryWriter.cs :
-         Stream->BinaryWriter. Support for WriteValue() for almost all
-         types.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : removed couple of MonoTODOs.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : more couple of fixes (typed value
-         support and fixes, more element/attribute namespace fixes etc.).
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : fixed Base64 operation byte.
-         For comment node there is no corresponding combined EndElement
-         operation, so don't try to combine it.
-         Don't output xmlns and xml namespaces.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : fixed couple of dictionary string
-         issues (on lookup and index output).
-       * XmlBinaryWriterSession.cs : added internal TryLookup(). Changed
-         internal structure to have dictionary string as a key.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : new prefix population is needed
-         in this class too.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : more WriteEndAttribute() is needed.
-         Remove wrong namespaceUri index output. Fixed attribute operation.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : output attribute value.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : for binary output format requirement,
-         every content must be buffered once and wait for next operation so
-         that if the content is one of the content sequence or not. This is
-         almost silly, but that is what Microsoft wanted to do.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : couple of namespaces processing fix.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : WriteAttributeString and WriteStartElement
-         should also delegate to dictionary-string based methods.
-       * XmlBinaryDictionaryWriter.cs : ongoing reimplementation as it was
-         based on pretty old design as well as pretty old XmlTextWriter.
-
-2007-03-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryWriterSession.cs : implemented.
-       * XmlBinaryDictionaryWriter.cs : a bunch of updates.
-
-2007-03-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * UniqueId.cs : hacky Equals() implementation.
-       * XmlDictionaryReaderQuotas.cs : removed Default and fixed Max.
-       * XmlSimpleDictionaryWriter.cs : in .NET 3.0 RTM, it is supported.
-       * XmlDictionaryWriter.cs : WriteStartElement(XmlDictionaryString,
-         XmlDictionaryString) should call WriteStartElement(string,
-         XmlDictionaryString,XmlDictionaryString) since because only the
-         latter is overridable and possible to provide dictionary string.
-
-2007-03-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : make it partial. Fill Quotas when requested.
-       * XmlDictionaryReaderAutoGen.cs : added autogenerated array reader
-         methods.
-       * XmlDictionaryWriter.cs : make it partial.
-       * XmlDictionaryWruterAutoGen.cs : added autogenerated array writer
-         methods.
-
-2006-10-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlSimpleDictionaryReader.cs :
-         implement IXmlNamespaceResolver.
-
-2006-07-31  Ankit Jain  <jankit@novell.com>
-
-       * UniqueId.cs (.ctor): (string overload) Implement.
-       (ToString): Prepend "urn:uuid:" instead of "uuid-".
-
-2006-07-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * UniqueId.cs : some implementation.
-
-2006-07-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs, XmlSimpleDictionaryWriter.cs,
-         XmlDictionaryReaderQuotas.cs : June CTP API update.
-
-2006-07-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, IStreamProvider.cs,
-         XmlSimpleDictionaryReader.cs, IXmlMtomReaderInitializer.cs,
-         XmlBinaryWriterSession.cs, IXmlUTF8ReaderInitializer.cs,
-         IXmlMtomWriterInitializer.cs, XmlDictionaryReader.cs :
-         June CTP API updates.
-
-2006-01-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlShimWriter.cs : deleted.
-       * XmlBinaryDictionaryWriter.cs, XmlSimpleDictionaryWriter.cs :
-         WriteProcessingInstruction() throws InvalidOperationException.
-
-2005-11-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs, XmlBinaryDictionaryWriter.cs,
-         XmlDictionary.cs, XmlDictionaryWriter.cs, XmlC14NWriter.cs :
-         several API fixes to Nov. CTP.
-
-2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : CreateMtomReader() stubs.
-
-2005-10-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : use saved xml_lang and xml_space for
-         those corresponding properties (they bork at the declaring element).
-
-2005-10-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * UniqueId.cs : it does not compile.
-
-2005-10-23  Duncan Mak  <duncan@novell.com>
-
-       * UniqueId.cs (.ctor): Implement some overloads by chaining it to
-       other Unimplemented ones.
-       (operator ==, operator !=): Implemented using the Equals method.
-       (Equals, TryGetGuid): Well, at least figure the false case....
-
-2005-10-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionary.cs : fixed type of Empty.
-       * XmlDictionaryReaderQuotas.cs : Default and Max were not readonly.
-
-2005-10-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : and it can GetContext().
-
-2005-10-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs :
-         Fixed index for room-reserved attributes (0x22-0x3B).
-         Added note on 0x9D.
-       * XmlBinaryDictionaryReader.cs :
-         Several fixes to get it work fine.
-
-2005-10-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionary.cs : TryLookup() should use TryGetValue().
-         Fixed incorrect upper bound check for TryLookup(int, out dictstr).
-       * XmlBinaryDictionaryWriter.cs : Use 0x8B for empty string everywhere
-         we use 0x83.
-
-2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : new file for CreateBinaryReader().
-       * XmlDictionaryReader.cs : use above.
-       * XmlBinaryDictionaryWriter.cs : several fixes (renamed private
-         fields, added more notes, and much more).
-
-2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs :
-         Added notes on dictionary string support inference. Fixed filename.
-
-2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : new file for CreateBinaryWriter().
-       * XmlDictionaryWriter.cs : use above.
-
-2005-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : stubby WriteNode() impl.
-       * XmlBinaryWriterSession.cs : tiny notes.
-
-2005-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSimpleDictionaryWriter.cs : new file for CreateDictionaryWriter().
-         Implemented simple XmlWriter functionality.
-       * XmlDictionaryWriter.cs : use above.
-
-2005-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : implemented some members. Added more stubs.
-
-2005-09-29  Duncan Mak  <duncan@novell.com>
-
-       * XmlDictionaryWriter.cs (CreateBinaryWriter): Added stub.
-
-2005-09-28  Duncan Mak  <duncan@novell.com>
-
-       * XmlDictionaryWriter.cs (CreateDictionaryWriter): Added stub.
-
-2005-09-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs :
-         Some member signature fixes.
-         implemented CreateDictionaryReader().
-         TryGetLocalNameAsDictionaryString() seems always returning false.
-         IsLocalName() is not likely to use TryGet...() above.
-       * XmlSimpleDictionaryReader.cs : for CreateDictionaryReader().
-
-2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryString.cs, XmlDictionary.cs,
-         XmlDictionaryReaderQuotas.cs, XmlDictionaryReader.cs:
-         added some implementations.
-
-2005-09-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryString.cs, XmlShimWriter.cs,
-         IXmlBinaryWriterInitializer.cs, IXmlUTF8WriterInitializer.cs,
-         XmlDictionaryWriter.cs, UniqueId.cs, XmlC14NWriter.cs,
-         XmlDictionary.cs, OnXmlDictionaryReaderClose.cs,
-         XmlBinaryReaderSession.cs, IXmlMtomReaderInitializer.cs,
-         IXmlDictionary.cs, IXmlBinaryReaderInitializer.cs,
-         XmlCanonicalWriter.cs, XmlBinaryWriterSession.cs,
-         XmlDictionaryReaderQuotas.cs, IXmlUTF8ReaderInitializer.cs,
-         IXmlMtomWriterInitializer.cs, XmlDictionaryReader.cs :
-         #if NET_2_0. coding style was updated.
-
-2005-09-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * IXmlBinaryReaderInitializer.cs
-         IXmlBinaryWriterInitializer.cs
-         IXmlDictionary.cs
-         IXmlMtomReaderInitializer.cs
-         IXmlMtomWriterInitializer.cs
-         IXmlUTF8ReaderInitializer.cs
-         IXmlUTF8WriterInitializer.cs
-         OnXmlDictionaryReaderClose.cs
-         UniqueId.cs
-         XmlBinaryReaderSession.cs
-         XmlBinaryWriterSession.cs
-         XmlC14NWriter.cs
-         XmlCanonicalWriter.cs
-         XmlDictionary.cs
-         XmlDictionaryReader.cs
-         XmlDictionaryReaderQuotas.cs
-         XmlDictionaryString.cs
-         XmlDictionaryWriter.cs
-         XmlShimWriter.cs : new files.
-
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IFragmentCapableXmlDictionaryWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IFragmentCapableXmlDictionaryWriter.cs
deleted file mode 100644 (file)
index f9c8ac2..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// IFragmentCapableXmlDictionaryWriter.cs
-//
-// Author:
-//     Jonathan Pryor <jpryor@novell.com>
-//
-// Copyright (C) 2009 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.IO;
-
-namespace System.Xml
-{
-       public interface IFragmentCapableXmlDictionaryWriter
-       {
-               bool CanFragment { get; }
-
-               void StartFragment (Stream stream, bool generateSelfContainedTextFragment);
-               void WriteFragment (byte[] buffer, int offset, int count);
-               void EndFragment ();
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IStreamProvider.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IStreamProvider.cs
deleted file mode 100644 (file)
index 3856a45..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// IStreamProvider.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.IO;
-
-namespace System.Xml
-{
-       public interface IStreamProvider
-       {
-               Stream GetStream ();
-               void ReleaseStream (Stream stream);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlBinaryReaderInitializer.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlBinaryReaderInitializer.cs
deleted file mode 100644 (file)
index e0d2840..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// IXmlBinaryReaderInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-
-namespace System.Xml
-{
-       public interface IXmlBinaryReaderInitializer
-       {
-               void SetInput (
-                       Stream stream,
-                       IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quota,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose);
-
-               void SetInput (byte [] buffer, int offset, int count,
-                       IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quota,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlBinaryWriterInitializer.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlBinaryWriterInitializer.cs
deleted file mode 100644 (file)
index fa34bf5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// IXmlBinaryWriterInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-
-namespace System.Xml
-{
-       public interface IXmlBinaryWriterInitializer
-       {
-               void SetOutput (Stream stream,
-                       IXmlDictionary dictionary,
-                       XmlBinaryWriterSession session,
-                       bool ownsStream);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlDictionary.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlDictionary.cs
deleted file mode 100644 (file)
index a894ae1..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// IXmlDictionary.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Xml
-{
-       public interface IXmlDictionary
-       {
-               bool TryLookup (int key, out XmlDictionaryString result);
-               bool TryLookup (string value, out XmlDictionaryString result);
-               bool TryLookup (XmlDictionaryString value,
-                       out XmlDictionaryString result);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlMtomReaderInitializer.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlMtomReaderInitializer.cs
deleted file mode 100644 (file)
index 484e776..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// IXmlMtomReaderInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
-       public interface IXmlMtomReaderInitializer
-       {
-               void SetInput (Stream stream, Encoding [] encodings,
-                               string contentType,
-                               XmlDictionaryReaderQuotas quotas,
-                               int maxBufferSize,
-                               OnXmlDictionaryReaderClose onClose);
-
-               void SetInput (byte [] buffer, int offset, int count,
-                               Encoding [] encodings, string contentType, 
-                               XmlDictionaryReaderQuotas quotas,
-                               int maxBufferSize,
-                               OnXmlDictionaryReaderClose onClose);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlMtomWriterInitializer.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlMtomWriterInitializer.cs
deleted file mode 100644 (file)
index 0f85ada..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// IXmlMtomWriterInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
-       public interface IXmlMtomWriterInitializer
-       {
-               void SetOutput (Stream stream, Encoding encoding,
-                       int maxSizeInBytes, string startInfo, string boundary,
-                       string startUri, bool writeMessageHeaders, bool ownsStream);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlUTF8ReaderInitializer.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlUTF8ReaderInitializer.cs
deleted file mode 100644 (file)
index 126e7a1..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// IXmlTextReaderInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
-       public interface IXmlTextReaderInitializer
-       {
-               void SetInput (byte [] buffer, int offset, int count,
-                       Encoding encoding,
-                       XmlDictionaryReaderQuotas quota,
-                       OnXmlDictionaryReaderClose onClose);
-
-               void SetInput (Stream stream,
-                       Encoding encoding,
-                       XmlDictionaryReaderQuotas quota,
-                       OnXmlDictionaryReaderClose onClose);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlUTF8WriterInitializer.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlUTF8WriterInitializer.cs
deleted file mode 100644 (file)
index 83d6fdc..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// IXmlTextWriterInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
-       public interface IXmlTextWriterInitializer
-       {
-               void SetOutput (Stream stream, Encoding encoding, bool ownsStream);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/OnXmlDictionaryReaderClose.cs b/mcs/class/System.Runtime.Serialization/System.Xml/OnXmlDictionaryReaderClose.cs
deleted file mode 100644 (file)
index 54ce036..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// OnXmlDictionaryReaderClose.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Xml
-{
-       public delegate void OnXmlDictionaryReaderClose (XmlDictionaryReader reader);
-}
-
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/UniqueId.cs b/mcs/class/System.Runtime.Serialization/System.Xml/UniqueId.cs
deleted file mode 100644 (file)
index 28cbb00..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-//
-// UniqueId.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//     Jonathan Pryor <jpryor@novell.com>
-//
-// Copyright (C) 2005,2007,2009 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-using System.Security;
-
-namespace System.Xml
-{
-       public class UniqueId
-       {
-               Guid guid;
-               string id;
-
-               public UniqueId ()
-                       : this (Guid.NewGuid ())
-               {
-               }
-
-               public UniqueId (byte [] id)
-                       : this (id, 0)
-               {
-               }
-
-               public UniqueId (Guid id)
-               {
-                       this.guid = id;
-               }
-
-               public UniqueId (string value)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ("value cannot be null", "value");
-
-                       if (value.Length == 0)
-                               throw new FormatException ("UniqueId cannot be zero length");
-
-                       this.id = value;
-               }
-
-               public UniqueId (byte [] id, int offset)
-               {
-                       if (id == null)
-                               throw new ArgumentNullException ();
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException ("offset");
-                       if (offset >= id.Length)
-                               throw new ArgumentException ("id too small.", "offset");
-
-                       if (id.Length - offset != 16)
-                               throw new ArgumentException ("id and offset provide less than 16 bytes");
-
-                       if (offset == 0)
-                               guid = new Guid (id);
-                       else {
-                               List<byte> buf = new List<byte> (id);
-                               buf.RemoveRange (0, offset);
-                               guid = new Guid (buf.ToArray ());
-                       }
-               }
-
-               public UniqueId (char [] id, int offset, int count)
-               {
-                       if (id == null)
-                               throw new ArgumentNullException ("id");
-                       if (offset < 0 || offset >= id.Length)
-                               throw new ArgumentOutOfRangeException ("offset");
-                       if (count < 0 || id.Length - offset < count)
-                               throw new ArgumentOutOfRangeException ("count");
-                       if (count == 0)
-                               throw new FormatException ();
-
-                       // Does it start with "urn:uuid:"?  If so, it's a Guid.
-                       if (count > 8 && id [offset] == 'u' && id [offset+1] == 'r' && 
-                                       id [offset+2] == 'n' && id [offset+3] == ':' &&
-                                       id [offset+4] == 'u' && id [offset+5] == 'u' &&
-                                       id [offset+6] == 'i' && id [offset+7] == 'd' &&
-                                       id [offset+8] == ':') {
-                               if (count != 45)
-                                       throw new ArgumentOutOfRangeException ("Invalid Guid");
-                               this.guid = new Guid (new string (id, offset+9, count-9));
-                       } else
-                               this.id = new string (id, offset, count);
-               }
-
-               public int CharArrayLength {
-                       get {return id != null ? id.Length : 45;}
-               }
-
-               public bool IsGuid {
-                       get { return guid != default (Guid); }
-               }
-
-               public override bool Equals (Object obj)
-               {
-                       UniqueId other = obj as UniqueId;
-
-                       if (other == null)
-                               return false;
-
-                       if (IsGuid && other.IsGuid) {
-                               return guid.Equals (other.guid);
-                       }
-
-                       return id == other.id;
-               }
-
-               [MonoTODO ("Determine semantics when IsGuid==true")]
-               public override int GetHashCode ()
-               {
-                       return id != null ? id.GetHashCode () : guid.GetHashCode ();
-               }
-
-               public static bool operator == (UniqueId id1, UniqueId id2)
-               {
-                       return object.Equals (id1, id2);
-               }
-
-               public static bool operator != (UniqueId id1, UniqueId id2)
-               {
-                       return ! (id1 == id2);
-               }
-
-               public int ToCharArray (char [] array, int offset)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException ("array");
-                       if (offset < 0 || offset >= array.Length)
-                               throw new ArgumentOutOfRangeException ("offset");
-
-                       string s = ToString ();
-                       s.CopyTo (0, array, offset, s.Length);
-                       return s.Length;
-               }
-
-               public override string ToString ()
-               {
-                       if (id == null)
-                               return "urn:uuid:" + guid;
-
-                       return id;
-               }
-
-               public bool TryGetGuid (out Guid guid)
-               {
-                       if (IsGuid) {
-                               guid = this.guid;
-                               return true;
-                       } else {
-                               guid = default (Guid);
-                               return false;
-                       }
-               }
-
-               public bool TryGetGuid (byte [] buffer, int offset)
-               {
-                       if (!IsGuid)
-                               return false;
-
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
-                       if (offset < 0 || offset >= buffer.Length)
-                               throw new ArgumentOutOfRangeException ("offset");
-                       if (buffer.Length - offset < 16)
-                               throw new ArgumentOutOfRangeException ("offset");
-
-                       guid.ToByteArray ().CopyTo (buffer, offset);
-                       return true;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryReader.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryReader.cs
deleted file mode 100644 (file)
index acc4ad0..0000000
+++ /dev/null
@@ -1,1197 +0,0 @@
-//
-// XmlBinaryDictionaryReader.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2005, 2007 Novell, Inc.  http://www.novell.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Text;
-
-using QName = System.Xml.XmlQualifiedName;
-using BF = System.Xml.XmlBinaryFormat;
-
-namespace System.Xml
-{
-       // FIXME:
-       //      - support XmlDictionaryReaderQuotas.
-
-       internal class XmlBinaryDictionaryReader : XmlDictionaryReader, IXmlNamespaceResolver
-       {
-               internal interface ISource
-               {
-                       int Position { get; }
-                       int ReadByte ();
-                       int Read (byte [] data, int offset, int count);
-                       BinaryReader Reader { get; }
-               }
-
-               internal class StreamSource : ISource
-               {
-                       BinaryReader reader;
-
-                       public StreamSource (Stream stream)
-                       {
-                               this.reader = new BinaryReader (stream);
-                       }
-
-                       public int Position {
-                               get { return (int) reader.BaseStream.Position; }
-                       }
-
-                       public BinaryReader Reader {
-                               get { return reader; }
-                       }
-
-                       public int ReadByte ()
-                       {
-                               return reader.BaseStream.ReadByte ();
-                       }
-
-                       public int Read (byte [] data, int offset, int count)
-                       {
-                               return reader.BaseStream.Read (data, offset, count);
-                       }
-               }
-
-               class NodeInfo
-               {
-                       public NodeInfo ()
-                       {
-                       }
-
-                       public NodeInfo (bool isAttr)
-                       {
-                               IsAttributeValue = isAttr;
-                       }
-
-                       public bool IsAttributeValue;
-                       public int Position;
-                       public string Prefix;
-                       public XmlDictionaryString DictLocalName;
-                       public XmlDictionaryString DictNS;
-                       public XmlDictionaryString DictValue; // BF.TextIndex
-                       public XmlNodeType NodeType;
-                       public object TypedValue;
-                       public byte ValueType;
-
-                       // -1 for nothing,
-                       // -2 for that of element (only for attribute),
-                       // 0 or more to fill later
-                       public int NSSlot;
-
-                       string name = String.Empty;
-                       string local_name = String.Empty;
-                       string ns = String.Empty;
-                       string value;
-
-                       public string LocalName {
-                               get { return DictLocalName != null ? DictLocalName.Value : local_name; }
-                               set {
-                                       DictLocalName = null;
-                                       local_name = value;
-                               }
-                       }
-
-                       public string NS {
-                               get { return DictNS != null ? DictNS.Value : ns; }
-                               set {
-                                       DictNS = null;
-                                       ns = value;
-                               }
-                       }
-
-                       public string Name {
-                               get {
-                                       if (name.Length == 0)
-                                               name = Prefix.Length > 0 ?
-                                                       String.Concat (Prefix, ":", LocalName) :
-                                                       LocalName;
-                                       return name;
-                               }
-                       }
-
-                       public virtual string Value {
-                               get {
-                                       switch (ValueType) {
-                                       case 0:
-                                       case BF.Comment:
-                                       case BF.Chars8:
-                                       case BF.Chars16:
-                                       case BF.Chars32:
-                                       case BF.EmptyText:
-                                       case BF.Utf16_8:
-                                       case BF.Utf16_16:
-                                       case BF.Utf16_32:
-                                               return value;
-                                       case BF.TextIndex:
-                                               return DictValue.Value;
-                                       case BF.Zero:
-                                               return "0";
-                                       case BF.One:
-                                               return "1";
-                                       case BF.BoolTrue:
-                                               return "true";
-                                       case BF.BoolFalse:
-                                               return "false";
-                                       case BF.Int8:
-                                               return XmlConvert.ToString ((byte) TypedValue);
-                                       case BF.Int16:
-                                               return XmlConvert.ToString ((short) TypedValue);
-                                       case BF.Int32:
-                                               return XmlConvert.ToString ((int) TypedValue);
-                                       case BF.Int64:
-                                               return XmlConvert.ToString ((long) TypedValue);
-                                       case BF.Single:
-                                               return XmlConvert.ToString ((float) TypedValue);
-                                       case BF.Double:
-                                               return XmlConvert.ToString ((double) TypedValue);
-                                       case BF.Decimal:
-                                               return XmlConvert.ToString ((decimal) TypedValue);
-                                       case BF.DateTime:
-                                               return XmlConvert.ToString ((DateTime) TypedValue, XmlDateTimeSerializationMode.RoundtripKind);
-                                       case BF.TimeSpan:
-                                               return XmlConvert.ToString ((TimeSpan) TypedValue);
-                                       case BF.Guid:
-                                               return XmlConvert.ToString ((Guid) TypedValue);
-                                       case BF.UniqueId:
-                                               return TypedValue.ToString ();
-                                       case BF.Bytes8:
-                                       case BF.Bytes16:
-                                       case BF.Bytes32:
-                                               return Convert.ToBase64String ((byte []) TypedValue);
-                                       case BF.QNameIndex:
-                                               return Name;
-                                       default:
-                                               throw new NotImplementedException ("ValueType " + ValueType + " on node " + NodeType);
-                                       }
-                               }
-                               set { this.value = value; }
-                       }
-
-                       public virtual void Reset ()
-                       {
-                               Position = 0;
-                               DictLocalName = DictNS = null;
-                               LocalName = NS = Prefix = Value = name = String.Empty;
-                               NodeType = XmlNodeType.None;
-                               TypedValue = null;
-                               ValueType = 0;
-                               NSSlot = -1;
-                       }
-               }
-
-               class AttrNodeInfo : NodeInfo
-               {
-                       public AttrNodeInfo (XmlBinaryDictionaryReader owner)
-                       {
-                               this.owner = owner;
-                       }
-
-                       XmlBinaryDictionaryReader owner;
-                       public int ValueIndex;
-
-                       public override void Reset ()
-                       {
-                               base.Reset ();
-                               ValueIndex = -1;
-                               NodeType = XmlNodeType.Attribute;
-                       }
-
-                       public override string Value {
-                               get { return owner.attr_values [ValueIndex].Value; }
-                       }
-               }
-
-               ISource source;
-               IXmlDictionary dictionary;
-               XmlDictionaryReaderQuotas quota;
-               XmlBinaryReaderSession session;
-               OnXmlDictionaryReaderClose on_close;
-               XmlParserContext context;
-
-               ReadState state = ReadState.Initial;
-               NodeInfo node;
-               NodeInfo current;
-               List<AttrNodeInfo> attributes = new List<AttrNodeInfo> ();
-               List<NodeInfo> attr_values = new List<NodeInfo> ();
-               List<NodeInfo> node_stack = new List<NodeInfo> ();
-               List<QName> ns_store = new List<QName> ();
-               Dictionary<int,XmlDictionaryString> ns_dict_store =
-                       new Dictionary<int,XmlDictionaryString> ();
-               int attr_count;
-               int attr_value_count;
-               int current_attr = -1;
-               int depth = 0;
-               // used during Read()
-               int ns_slot;
-               // next byte in the source (one byte token ahead always
-               // happens because there is no "end of start element" mark).
-               int next = -1;
-               bool is_next_end_element;
-               // temporary buffer for utf8enc.GetString()
-               byte [] tmp_buffer = new byte [128];
-               UTF8Encoding utf8enc = new UTF8Encoding ();
-
-               // See comment at Read()
-               int array_item_remaining;
-               byte array_item_type;
-               XmlNodeType array_state;
-
-               public XmlBinaryDictionaryReader (byte [] buffer, int offset,
-                       int count, IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quota,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       source = /*new ArraySource (buffer, offset, count);*/
-                               new StreamSource (new MemoryStream (buffer, offset, count));
-                       Initialize (dictionary, quota, session, onClose);
-               }
-
-               public XmlBinaryDictionaryReader (Stream stream,
-                       IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quota,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       source = new StreamSource (stream);
-                       Initialize (dictionary, quota, session, onClose);
-               }
-
-               private void Initialize (IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quotas,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       if (quotas == null)
-                               throw new ArgumentNullException ("quotas");
-                       if (dictionary == null)
-                               dictionary = new XmlDictionary ();
-                       this.dictionary = dictionary;
-
-                       this.quota = quotas;
-
-                       if (session == null)
-                               session = new XmlBinaryReaderSession ();
-                       this.session = session;
-
-                       on_close = onClose;
-                       NameTable nt = new NameTable ();
-                       this.context = new XmlParserContext (nt,
-                               new XmlNamespaceManager (nt),
-                               null, XmlSpace.None);
-
-                       current = node = new NodeInfo ();
-                       current.Reset ();
-                       node_stack.Add (node);
-               }
-
-               public override int AttributeCount {
-                       get { return attr_count; }
-               }
-
-               public override string BaseURI {
-                       get { return context.BaseURI; }
-               }
-
-               public override int Depth {
-                       get { return current == node ? depth : NodeType == XmlNodeType.Attribute ? depth + 1 : depth + 2; }
-               }
-
-               public override bool EOF {
-                       get { return state == ReadState.EndOfFile || state == ReadState.Error; }
-               }
-
-               public override bool HasValue {
-                       get { return Value.Length > 0; }
-               }
-
-               public override bool IsEmptyElement {
-                       get { return false; }
-               }
-
-               public override XmlNodeType NodeType {
-                       get { return current.NodeType; }
-               }
-
-               public override string Prefix {
-                       get { return current_attr >= 0 ? attributes [current_attr].Prefix : current.Prefix; }
-               }
-
-               // looks like it may return attribute's name even if it is on its value node.
-               public override string LocalName {
-                       get { return current_attr >= 0 ? attributes [current_attr].LocalName : current.LocalName; }
-               }
-
-               public override string Name {
-                       get { return current_attr >= 0 ? attributes [current_attr].Name : current.Name; }
-               }
-
-               public override string NamespaceURI {
-                       get { return current_attr >= 0 ? attributes [current_attr].NS : current.NS; }
-               }
-
-               public override XmlNameTable NameTable {
-                       get { return context.NameTable; }
-               }
-
-               public override XmlDictionaryReaderQuotas Quotas {
-                       get { return quota; }
-               }
-
-               public override ReadState ReadState {
-                       get { return state; }
-               }
-
-               public override string Value {
-                       get { return current.Value; }
-               }
-
-               public override void Close ()
-               {
-                       if (on_close != null)
-                               on_close (this);
-               }
-
-               public override string GetAttribute (int i)
-               {
-                       if (i >= attr_count)
-                               throw new ArgumentOutOfRangeException (String.Format ("Specified attribute index is {0} and should be less than {1}", i, attr_count));
-                       return attributes [i].Value;
-               }
-
-               public override string GetAttribute (string name)
-               {
-                       for (int i = 0; i < attr_count; i++)
-                               if (attributes [i].Name == name)
-                                       return attributes [i].Value;
-                       return null;
-               }
-
-               public override string GetAttribute (string localName, string ns)
-               {
-                       for (int i = 0; i < attr_count; i++)
-                               if (attributes [i].LocalName == localName &&
-                                       attributes [i].NS == ns)
-                                       return attributes [i].Value;
-                       return null;
-               }
-
-               public IDictionary<string,string> GetNamespacesInScope (
-                       XmlNamespaceScope scope)
-               {
-                       return context.NamespaceManager.GetNamespacesInScope (scope);
-               }
-
-               public string LookupPrefix (string ns)
-               {
-                       return context.NamespaceManager.LookupPrefix (NameTable.Get (ns));
-               }
-
-               public override string LookupNamespace (string prefix)
-               {
-                       return context.NamespaceManager.LookupNamespace (
-                               NameTable.Get (prefix));
-               }
-
-               public override bool IsArray (out Type type)
-               {
-                       if (array_state == XmlNodeType.Element) {
-                               type = GetArrayType (array_item_type);
-                               return true;
-                       } else {
-                               type = null;
-                               return false;
-                       }
-               }
-
-               public override bool MoveToElement ()
-               {
-                       bool ret = current_attr >= 0;
-                       current_attr = -1;
-                       current = node;
-                       return ret;
-               }
-
-               public override bool MoveToFirstAttribute ()
-               {
-                       if (attr_count == 0)
-                               return false;
-                       current_attr = 0;
-                       current = attributes [current_attr];
-                       return true;
-               }
-
-               public override bool MoveToNextAttribute ()
-               {
-                       if (++current_attr < attr_count) {
-                               current = attributes [current_attr];
-                               return true;
-                       } else {
-                               --current_attr;
-                               return false;
-                       }
-               }
-
-               public override void MoveToAttribute (int i)
-               {
-                       if (i >= attr_count)
-                               throw new ArgumentOutOfRangeException (String.Format ("Specified attribute index is {0} and should be less than {1}", i, attr_count));
-                       current_attr = i;
-                       current = attributes [i];
-               }
-
-               public override bool MoveToAttribute (string name)
-               {
-                       for (int i = 0; i < attributes.Count; i++) {
-                               if (attributes [i].Name == name) {
-                                       MoveToAttribute (i);
-                                       return true;
-                               }
-                       }
-                       return false;
-               }
-
-               public override bool MoveToAttribute (string localName, string ns)
-               {
-                       for (int i = 0; i < attributes.Count; i++) {
-                               if (attributes [i].LocalName == localName &&
-                                       attributes [i].NS == ns) {
-                                       MoveToAttribute (i);
-                                       return true;
-                               }
-                       }
-                       return false;
-               }
-
-               public override bool ReadAttributeValue ()
-               {
-                       if (current_attr < 0)
-                               return false;
-                       int start = attributes [current_attr].ValueIndex;
-                       int end = current_attr + 1 == attr_count ? attr_value_count : attributes [current_attr + 1].ValueIndex;
-                       if (start == end)
-                               return false;
-                       if (!current.IsAttributeValue) {
-                               current = attr_values [start];
-                               return true;
-                       }
-                       // Actually there is no case for attribute whose value is split to more than two nodes. We could simplify the node structure.
-                       return false;
-               }
-
-               // When reading an array (0x03), it requires extraneously
-               // complex procedure for XmlReader. First, it reads element,
-               // type of operation and length of the items. And this XmlReader
-               // has to return Element state. On the next Read(), it proceeds
-               // to the value node of the first item of the array, so it
-               // reads the value stream. On the next Read(), it proceeds to
-               // EndElement, so it should not read anything from stream while
-               // it has to move to the node state to EndElement.
-               public override bool Read ()
-               {
-                       switch (state) {
-                       case ReadState.Closed:
-                       case ReadState.EndOfFile:
-                       case ReadState.Error:
-                               return false;
-                       }
-
-                       // clear.
-                       state = ReadState.Interactive;
-                       MoveToElement ();
-                       attr_count = 0;
-                       attr_value_count = 0;
-                       ns_slot = 0;
-
-                       if (node.NodeType == XmlNodeType.Element) {
-                               // push element scope
-                               if (node_stack.Count <= ++depth) {
-                                       if (depth == quota.MaxDepth)
-                                               throw new XmlException (String.Format ("Binary XML stream quota exceeded. Depth must be less than {0}", quota.MaxDepth));
-                                       node = new NodeInfo ();
-                                       node_stack.Add (node);
-                               } else {
-                                       node = node_stack [depth]; // reuse
-                                       node.Reset ();
-                               }
-                       }
-                       current = node;
-
-                       if (is_next_end_element) {
-                               is_next_end_element = false;
-                               node.Reset ();
-                               ProcessEndElement ();
-                               return true;
-                       }
-
-                       // process array node after preparing node stack.
-                       switch (array_state) {
-                       case XmlNodeType.Element:
-                               ReadArrayItem ();
-                               return true;
-                       case XmlNodeType.Text:
-                               ShiftToArrayItemEndElement ();
-                               return true;
-                       case XmlNodeType.EndElement:
-                               if (--array_item_remaining == 0) {
-                                       array_state = XmlNodeType.None;
-                                       break;
-                               } else {
-                                       ShiftToArrayItemElement ();
-                                       return true;
-                               }
-                       }
-
-                       // array consumer does not expect Reset whlie it's on reading. So call it later than array check.
-                       node.Reset ();
-
-                       int ident = next >= 0 ? next : source.ReadByte ();
-                       next = -1;
-
-                       // check end of source.
-                       if (ident < 0) {
-                               state = ReadState.EndOfFile;
-                               current.Reset ();
-                               return false;
-                       }
-
-                       is_next_end_element = ident > 0x80 && (ident & 1) == 1;
-                       ident -= is_next_end_element ? 1 : 0;
-
-                       switch (ident) {
-                       case BF.EndElement:
-                               ProcessEndElement ();
-                               break;
-                       case BF.Comment:
-                               node.Value = ReadUTF8 ();
-                               node.ValueType = BF.Comment;
-                               node.NodeType = XmlNodeType.Comment;
-                               break;
-                       case BF.ElemString:
-                       case BF.ElemStringPrefix:
-                       case BF.ElemIndex:
-                       case BF.ElemIndexPrefix:
-                               ReadElementBinary ((byte) ident);
-                               break;
-
-                       case BF.Array:
-                               ident = ReadByteOrError ();
-                               ReadElementBinary ((byte) ident);
-                               ident = ReadByteOrError ();
-                               if (ident != 0x01)
-                                       throw new XmlException (String.Format ("EndElement is expected after element in an array. The actual byte was {0:X} in hexadecimal", ident));
-                               ident = ReadByteOrError () - 1; // -1 becauseit contains EndElement
-                               VerifyValidArrayItemType (ident);
-                               if (ident < 0)
-                                       throw new XmlException ("The stream has ended where the array item type is expected");
-                               array_item_type = (byte) ident;
-                               array_item_remaining = ReadVariantSize ();
-                               if (array_item_remaining > quota.MaxArrayLength)
-                                       throw new Exception (String.Format ("Binary xml stream exceeded max array length quota. Items are {0} and should be less than quota.MaxArrayLength", quota.MaxArrayLength));
-                               array_state = XmlNodeType.Element;
-                               break;
-
-                       default:
-                               if (BF.PrefixNElemIndexStart <= ident && ident <= BF.PrefixNElemIndexEnd ||
-                                   BF.PrefixNElemStringStart <= ident && ident <= BF.PrefixNElemStringEnd)
-                                       goto case BF.ElemString;
-                               ReadTextOrValue ((byte) ident, node, false);
-                               break;
-                       }
-
-                       return true;
-               }
-
-               void ReadArrayItem ()
-               {
-                       ReadTextOrValue (array_item_type, node, false);
-                       array_state = XmlNodeType.Text;
-               }
-
-               void ShiftToArrayItemEndElement ()
-               {
-                       ProcessEndElement ();
-                       array_state = XmlNodeType.EndElement;
-               }
-
-               void ShiftToArrayItemElement ()
-               {
-                       node.NodeType = XmlNodeType.Element;
-                       context.NamespaceManager.PushScope ();
-                       array_state = XmlNodeType.Element;
-               }
-
-               void VerifyValidArrayItemType (int ident)
-               {
-                       if (GetArrayType (ident) == null)
-                               throw new XmlException (String.Format ("Unexpected array item type {0:X} in hexadecimal", ident));
-               }
-               
-               Type GetArrayType (int ident)
-               {
-                       switch (ident) {
-                       case BF.Bool:
-                               return typeof (bool);
-                       case BF.Int16:
-                               return typeof (short);
-                       case BF.Int32:
-                               return typeof (int);
-                       case BF.Int64:
-                               return typeof (long);
-                       case BF.Single:
-                               return typeof (float);
-                       case BF.Double:
-                               return typeof (double);
-                       case BF.Decimal:
-                               return typeof (decimal);
-                       case BF.DateTime:
-                               return typeof (DateTime);
-                       case BF.TimeSpan:
-                               return typeof (TimeSpan);
-                       case BF.Guid:
-                               return typeof (Guid);
-                       }
-                       return null;
-               }
-
-               private void ProcessEndElement ()
-               {
-                       if (depth == 0)
-                               throw new XmlException ("Unexpected end of element while there is no element started.");
-                       current = node = node_stack [--depth];
-                       node.NodeType = XmlNodeType.EndElement;
-                       context.NamespaceManager.PopScope ();
-               }
-
-               private void ReadElementBinary (int ident)
-               {
-                       // element
-                       node.NodeType = XmlNodeType.Element;
-                       node.Prefix = String.Empty;
-                       context.NamespaceManager.PushScope ();
-                       switch (ident) {
-                       case BF.ElemString:
-                               node.LocalName = ReadUTF8 ();
-                               break;
-                       case BF.ElemStringPrefix:
-                               node.Prefix = ReadUTF8 ();
-                               node.NSSlot = ns_slot++;
-                               goto case BF.ElemString;
-                       case BF.ElemIndex:
-                               node.DictLocalName = ReadDictName ();
-                               break;
-                       case BF.ElemIndexPrefix:
-                               node.Prefix = ReadUTF8 ();
-                               node.NSSlot = ns_slot++;
-                               goto case BF.ElemIndex;
-                       default:
-                               if (BF.PrefixNElemIndexStart <= ident && ident <= BF.PrefixNElemIndexEnd) {
-                                       node.Prefix = ((char) (ident - BF.PrefixNElemIndexStart + 'a')).ToString ();
-                                       node.DictLocalName = ReadDictName ();
-                               } else if (BF.PrefixNElemStringStart <= ident && ident <= BF.PrefixNElemStringEnd) {
-                                       node.Prefix = ((char) (ident - BF.PrefixNElemStringStart + 'a')).ToString ();
-                                       node.LocalName = ReadUTF8 ();
-                               }
-                               else
-                                       throw new XmlException (String.Format ("Invalid element node type {0:X02} in hexadecimal", ident));
-                               break;
-                       }
-
-                       bool loop = true;
-                       do {
-                               ident = ReadByteOrError ();
-
-                               switch (ident) {
-                               case BF.AttrString:
-                               case BF.AttrStringPrefix:
-                               case BF.AttrIndex:
-                               case BF.AttrIndexPrefix:
-                                       ReadAttribute ((byte) ident);
-                                       break;
-                               case BF.DefaultNSString:
-                               case BF.PrefixNSString:
-                               case BF.DefaultNSIndex:
-                               case BF.PrefixNSIndex:
-                                       ReadNamespace ((byte) ident);
-                                       break;
-                               default:
-                                       if (BF.PrefixNAttrStringStart <= ident && ident <= BF.PrefixNAttrStringEnd ||
-                                           BF.PrefixNAttrIndexStart <= ident && ident <= BF.PrefixNAttrIndexEnd)
-                                               ReadAttribute ((byte) ident);
-                                       else {
-                                               next = ident;
-                                               loop = false;
-                                       }
-                                       break;
-                               }
-                       } while (loop);
-
-                       node.NS = context.NamespaceManager.LookupNamespace (node.Prefix) ?? String.Empty;
-                       foreach (AttrNodeInfo a in attributes)
-                               if (a.Prefix.Length > 0)
-                                       a.NS = context.NamespaceManager.LookupNamespace (a.Prefix);
-
-                       ns_store.Clear ();
-                       ns_dict_store.Clear ();
-               }
-
-               private void ReadAttribute (byte ident)
-               {
-                       if (attributes.Count == attr_count)
-                               attributes.Add (new AttrNodeInfo (this));
-                       AttrNodeInfo a = attributes [attr_count++];
-                       a.Reset ();
-                       a.Position = source.Position;
-
-                       switch (ident) {
-                       case BF.AttrString:
-                               a.LocalName = ReadUTF8 ();
-                               break;
-                       case BF.AttrStringPrefix:
-                               a.Prefix = ReadUTF8 ();
-                               a.NSSlot = ns_slot++;
-                               goto case BF.AttrString;
-                       case BF.AttrIndex:
-                               a.DictLocalName = ReadDictName ();
-                               break;
-                       case BF.AttrIndexPrefix:
-                               a.Prefix = ReadUTF8 ();
-                               a.NSSlot = ns_slot++;
-                               goto case BF.AttrIndex;
-                       default:
-                               if (BF.PrefixNAttrStringStart <= ident && ident <= BF.PrefixNAttrStringEnd) {
-                                       a.Prefix = ((char) ('a' + ident - BF.PrefixNAttrStringStart)).ToString ();
-                                       a.LocalName = ReadUTF8 ();
-                                       break;
-                               }
-                               else if (BF.PrefixNAttrIndexStart <= ident && ident <= BF.PrefixNAttrIndexEnd) {
-                                       a.Prefix = ((char) ('a' + ident - BF.PrefixNAttrIndexStart)).ToString ();
-                                       a.DictLocalName = ReadDictName ();
-                                       break;
-                               }
-                               else throw new XmlException (String.Format ("Unexpected attribute node type: 0x{0:X02}", ident));
-                       }
-                       ReadAttributeValueBinary (a);
-               }
-
-               private void ReadNamespace (byte ident)
-               {
-                       // create attrubute slot.
-                       if (attributes.Count == attr_count)
-                               attributes.Add (new AttrNodeInfo (this));
-                       AttrNodeInfo a = attributes [attr_count++];
-                       a.Reset ();
-                       a.Position = source.Position;
-
-                       string prefix = null, ns = null;
-                       XmlDictionaryString dns = null;
-
-                       switch (ident) {
-                       case BF.DefaultNSString:
-                               prefix = String.Empty;
-                               ns = ReadUTF8 ();
-                               break;
-                       case BF.PrefixNSString:
-                               prefix = ReadUTF8 ();
-                               ns = ReadUTF8 ();
-                               break;
-                       case BF.DefaultNSIndex:
-                               prefix = String.Empty;
-                               dns = ReadDictName ();
-                               ns_dict_store.Add (ns_store.Count, dns);
-                               ns = dns.Value;
-                               break;
-                       case BF.PrefixNSIndex:
-                               prefix = ReadUTF8 ();
-                               dns = ReadDictName ();
-                               ns_dict_store.Add (ns_store.Count, dns);
-                               ns = dns.Value;
-                               break;
-                       }
-
-                       // fill attribute slot.
-                       a.Prefix = prefix.Length > 0 ? "xmlns" : String.Empty;
-                       a.LocalName = prefix.Length > 0 ? prefix : "xmlns";
-                       a.NS = "http://www.w3.org/2000/xmlns/";
-                       a.ValueIndex = attr_value_count;
-                       if (attr_value_count == attr_values.Count)
-                               attr_values.Add (new NodeInfo (true));
-                       NodeInfo v = attr_values [attr_value_count++];
-                       v.Reset ();
-                       v.Value = ns;
-                       v.ValueType = BF.Chars8;
-                       v.NodeType = XmlNodeType.Text;
-
-                       ns_store.Add (new QName (prefix, ns));
-                       context.NamespaceManager.AddNamespace (prefix, ns);
-               }
-
-               private void ReadAttributeValueBinary (AttrNodeInfo a)
-               {
-                       a.ValueIndex = attr_value_count;
-                       if (attr_value_count == attr_values.Count)
-                               attr_values.Add (new NodeInfo (true));
-                       NodeInfo v = attr_values [attr_value_count++];
-                       v.Reset ();
-                       int ident = ReadByteOrError ();
-                       bool end = ident > 0x80 && (ident & 1) == 1;
-                       ident -= end ? 1 : 0;
-                       ReadTextOrValue ((byte) ident, v, true);
-               }
-
-               private bool ReadTextOrValue (byte ident, NodeInfo node, bool canSkip)
-               {
-                       node.Value = null;
-                       node.ValueType = ident;
-                       node.NodeType = XmlNodeType.Text;
-                       switch (ident) {
-                       case BF.Zero:
-                               node.TypedValue = 0;
-                               break;
-                       case BF.One:
-                               node.TypedValue = 1;
-                               break;
-                       case BF.BoolFalse:
-                               node.TypedValue = false;
-                               break;
-                       case BF.BoolTrue:
-                               node.TypedValue = true;
-                               break;
-                       case BF.Int8:
-                               node.TypedValue = ReadByteOrError ();
-                               break;
-                       case BF.Int16:
-                               node.TypedValue = source.Reader.ReadInt16 ();
-                               break;
-                       case BF.Int32:
-                               node.TypedValue = source.Reader.ReadInt32 ();
-                               break;
-                       case BF.Int64:
-                               node.TypedValue = source.Reader.ReadInt64 ();
-                               break;
-                       case BF.Single:
-                               node.TypedValue = source.Reader.ReadSingle ();
-                               break;
-                       case BF.Double:
-                               node.TypedValue = source.Reader.ReadDouble ();
-                               break;
-                       case BF.Decimal:
-                               int [] bits = new int [4];
-                               bits [3] = source.Reader.ReadInt32 ();
-                               bits [2] = source.Reader.ReadInt32 ();
-                               bits [0] = source.Reader.ReadInt32 ();
-                               bits [1] = source.Reader.ReadInt32 ();
-                               node.TypedValue = new Decimal (bits);
-                               break;
-                       case BF.DateTime:
-                               node.TypedValue = DateTime.FromBinary (source.Reader.ReadInt64 ());
-                               break;
-                       //case BF.UniqueId: // identical to .Text
-                       case BF.Bytes8:
-                       case BF.Bytes16:
-                       case BF.Bytes32:
-                               int size =
-                                       (ident == BF.Bytes8) ? source.Reader.ReadByte () :
-                                       (ident == BF.Bytes16) ? source.Reader.ReadUInt16 () :
-                                       source.Reader.ReadInt32 ();
-                               byte [] base64 = Alloc (size);
-                               source.Reader.Read (base64, 0, base64.Length);
-                               node.TypedValue = base64;
-                               break;
-                       case BF.TimeSpan:
-                               node.TypedValue = new TimeSpan (source.Reader.ReadInt64 ());
-                               break;
-                       case BF.UniqueId:
-                               byte [] guid = new byte [16];
-                               source.Reader.Read (guid, 0, guid.Length);
-                               node.TypedValue = new UniqueId (new Guid (guid));
-                               break;
-                       case BF.Guid:
-                               guid = new byte [16];
-                               source.Reader.Read (guid, 0, guid.Length);
-                               node.TypedValue = new Guid (guid);
-                               break;
-                       case BF.Chars8:
-                       case BF.Chars16:
-                       case BF.Chars32:
-                       case BF.Utf16_8:
-                       case BF.Utf16_16:
-                       case BF.Utf16_32:
-                               Encoding enc = ident <= BF.Chars32 ? Encoding.UTF8 : Encoding.Unicode;
-                               size =
-                                       (ident == BF.Chars8 || ident == BF.Utf16_8) ? source.Reader.ReadByte () :
-                                       (ident == BF.Chars16 || ident == BF.Utf16_16) ? source.Reader.ReadUInt16 () :
-                                       source.Reader.ReadInt32 ();
-                               byte [] bytes = Alloc (size);
-                               source.Reader.Read (bytes, 0, size);
-                               node.Value = enc.GetString (bytes, 0, size);
-                               node.NodeType = XmlNodeType.Text;
-                               break;
-                       case BF.EmptyText:
-                               node.Value = String.Empty;
-                               node.NodeType = XmlNodeType.Text;
-                               break;
-                       case BF.TextIndex:
-                               node.DictValue = ReadDictName ();
-                               node.NodeType = XmlNodeType.Text;
-                               break;
-                       case BF.QNameIndex:
-                               node.Prefix = ((char) (ReadByteOrError () + 'a')).ToString ();
-                               node.DictLocalName = ReadDictName();
-                               break;  
-                       default:
-                               if (!canSkip)
-                                       throw new ArgumentException (String.Format ("Unexpected binary XML data at position {1}: {0:X}", ident + (is_next_end_element ? 1 : 0), source.Position));
-                               next = ident;
-                               return false;
-                       }
-                       return true;
-               }
-
-               byte [] Alloc (int size)
-               {
-                       if (size > quota.MaxStringContentLength || size < 0)
-                               throw new XmlException (String.Format ("Text content buffer exceeds the quota limitation at {2}. {0} bytes and should be less than {1} bytes", size, quota.MaxStringContentLength, source.Position));
-                       return new byte [size];
-               }
-
-               private int ReadVariantSize ()
-               {
-                       int size = 0;
-                       // If sizeSpec < 0, then it is variant size specifier.
-                       // Otherwise it is fixed size s = sizeSpec + 1 byte(s).
-                       int d = 0;
-                       do {
-                               byte got = ReadByteOrError ();
-                               size += (got & 0x7F) << d;
-                               d += 7;
-                               if (got < 0x80)
-                                       break;
-                       } while (true);
-                       return size;
-               }
-
-               private string ReadUTF8 ()
-               {
-                       int size = ReadVariantSize ();
-                       if (size == 0)
-                               return String.Empty;
-                       if (tmp_buffer.Length < size) {
-                               int extlen = tmp_buffer.Length * 2;
-                               tmp_buffer = Alloc (size < extlen ? extlen : size);
-                       }
-                       size = source.Read (tmp_buffer, 0, size);
-                       return utf8enc.GetString (tmp_buffer, 0, size);
-               }
-
-               private XmlDictionaryString ReadDictName ()
-               {
-                       int key = ReadVariantSize ();
-                       XmlDictionaryString s;
-                       if ((key & 1) == 1) {
-                               if (session.TryLookup (key >> 1, out s))
-                                       return s;
-                       } else {
-                               if (dictionary.TryLookup (key >> 1, out s))
-                                       return s;
-                       }
-                       throw new XmlException (String.Format ("Input XML binary stream is invalid. No matching XML dictionary string entry at {0}. Binary stream position at {1}", key, source.Position));
-               }
-
-               private byte ReadByteOrError ()
-               {
-                       if (next >= 0) {
-                               byte b = (byte) next;
-                               next = -1;
-                               return b;
-                       }
-                       int ret = source.ReadByte ();
-                       if (ret < 0)
-                               throw new XmlException (String.Format ("Unexpected end of binary stream. Position is at {0}", source.Position));
-                       return (byte) ret;
-               }
-
-               public override void ResolveEntity ()
-               {
-                       throw new NotSupportedException ("this XmlReader does not support ResolveEntity.");
-               }
-
-               public override bool TryGetBase64ContentLength (out int length)
-               {
-                       length = 0;
-                       switch (current.ValueType) {
-                       case BF.Bytes8:
-                       case BF.Bytes16:
-                       case BF.Bytes32:
-                               length = ((byte []) current.TypedValue).Length;
-                               return true;
-                       }
-                       return false;
-               }
-
-               public override string ReadContentAsString ()
-               {
-                       string value = String.Empty;
-                       do {
-                               switch (NodeType) {
-                               case XmlNodeType.Element:
-                               case XmlNodeType.EndElement:
-                                       return value;
-                               case XmlNodeType.Text:
-                                       value += Value;
-                                       break;
-                               }
-                       } while (Read ());
-                       return value;
-               }
-
-               #region read typed content
-
-               public override int ReadContentAsInt ()
-               {
-                       int ret = GetIntValue ();
-                       Read ();
-                       return ret;
-               }
-               
-               int GetIntValue ()
-               {
-                       switch (node.ValueType) {
-                       case BF.Zero:
-                               return 0;
-                       case BF.One:
-                               return 1;
-                       case BF.Int8:
-                               return (byte) current.TypedValue;
-                       case BF.Int16:
-                               return (short) current.TypedValue;
-                       case BF.Int32:
-                               return (int) current.TypedValue;
-                       }
-                       throw new InvalidOperationException (String.Format ("Current content is not an integer. (Internal value type:{0:X02})", (int) node.ValueType));
-               }
-
-               public override long ReadContentAsLong ()
-               {
-                       if (node.ValueType == BF.Int64) {
-                               long v = (long) current.TypedValue;
-                               Read ();
-                               return v;
-                       }
-                       return ReadContentAsInt ();
-               }
-
-               public override float ReadContentAsFloat ()
-               {
-                       if (node.ValueType != BF.Single)
-                               throw new InvalidOperationException ("Current content is not a single");
-                       float v = (float) current.TypedValue;
-                       Read ();
-                       return v;
-               }
-
-               public override double ReadContentAsDouble ()
-               {
-                       if (node.ValueType != BF.Double)
-                               throw new InvalidOperationException ("Current content is not a double");
-                       double v = (double) current.TypedValue;
-                       Read ();
-                       return v;
-               }
-
-               bool IsBase64Node (byte b)
-               {
-                       switch (b) {
-                       case BF.Bytes8:
-                       case BF.Bytes16:
-                       case BF.Bytes32:
-                               return true;
-                       }
-                       return false;
-               }
-
-               // FIXME: this is not likely to consume sequential base64 nodes.
-               public override byte [] ReadContentAsBase64 ()
-               {
-                       byte [] ret = null;
-                       if (!IsBase64Node (node.ValueType))
-                               throw new InvalidOperationException ("Current content is not base64");
-
-                       while (NodeType == XmlNodeType.Text && IsBase64Node (node.ValueType)) {
-                               if (ret == null)
-                                       ret = (byte []) node.TypedValue;
-                               else {
-                                       byte [] tmp = (byte []) node.TypedValue;
-                                       byte [] tmp2 = Alloc (ret.Length + tmp.Length);
-                                       Array.Copy (ret, tmp2, ret.Length);
-                                       Array.Copy (tmp, 0, tmp2, ret.Length, tmp.Length);
-                                       ret = tmp2;
-                               }
-                               Read ();
-                               //MoveToContent ();
-                       }
-                       return ret;
-               }
-
-               public override Guid ReadContentAsGuid ()
-               {
-                       if (node.ValueType != BF.Guid)
-                               throw new InvalidOperationException ("Current content is not a Guid");
-                       Guid ret = (Guid) node.TypedValue;
-                       Read ();
-                       return ret;
-               }
-
-               public override UniqueId ReadContentAsUniqueId ()
-               {
-                       switch (node.ValueType) {
-                       case BF.Chars8:
-                       case BF.Chars16:
-                       case BF.Chars32:
-                       case BF.Utf16_8:
-                       case BF.Utf16_16:
-                       case BF.Utf16_32:
-                               UniqueId ret = new UniqueId (node.Value);
-                               Read ();
-                               return ret;
-                       case BF.UniqueId:
-                               ret = (UniqueId) node.TypedValue;
-                               Read ();
-                               return ret;
-                       default:
-                               throw new InvalidOperationException ("Current content is not a UniqueId");
-                       }
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriter.cs
deleted file mode 100644 (file)
index 4f0674d..0000000
+++ /dev/null
@@ -1,1102 +0,0 @@
-//
-// XmlBinaryDictionaryWriter.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2005, 2007 Novell, Inc.  http://www.novell.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Text;
-
-using BF = System.Xml.XmlBinaryFormat;
-
-namespace System.Xml
-{
-       internal partial class XmlBinaryDictionaryWriter : XmlDictionaryWriter
-       {
-               class MyBinaryWriter : BinaryWriter
-               {
-                       public MyBinaryWriter (Stream s)
-                               : base (s)
-                       {
-                       }
-
-                       public void WriteFlexibleInt (int value)
-                       {
-                               Write7BitEncodedInt (value);
-                       }
-               }
-
-               #region Fields
-               MyBinaryWriter original, writer, buffer_writer;
-               IXmlDictionary dict_ext;
-               XmlDictionary dict_int = new XmlDictionary ();
-               XmlBinaryWriterSession session;
-               bool owns_stream;
-               Encoding utf8Enc = new UTF8Encoding ();
-               MemoryStream buffer = new MemoryStream ();
-
-               const string XmlNamespace = "http://www.w3.org/XML/1998/namespace";
-               const string XmlnsNamespace = "http://www.w3.org/2000/xmlns/";
-
-               WriteState state = WriteState.Start;
-               bool open_start_element = false;
-               // transient current node info
-               List<KeyValuePair<string,object>> namespaces = new List<KeyValuePair<string,object>> ();
-               string xml_lang = null;
-               XmlSpace xml_space = XmlSpace.None;
-               int ns_index = 0;
-               // stacked info
-               Stack<int> ns_index_stack = new Stack<int> ();
-               Stack<string> xml_lang_stack = new Stack<string> ();
-               Stack<XmlSpace> xml_space_stack = new Stack<XmlSpace> ();
-               Stack<string> element_ns_stack = new Stack<string> ();
-               string element_ns = String.Empty;
-               int element_count;
-               string element_prefix; // only meaningful at Element state
-               // current attribute info
-               string attr_value;
-               string current_attr_prefix;
-               object current_attr_name, current_attr_ns;
-               bool attr_typed_value;
-               SaveTarget save_target;
-
-               enum SaveTarget {
-                       None,
-                       Namespaces,
-                       XmlLang,
-                       XmlSpace
-               }
-
-               // XmlWriterSettings support
-
-               #endregion
-
-               #region Constructors
-
-               public XmlBinaryDictionaryWriter (Stream stream,
-                       IXmlDictionary dictionary,
-                       XmlBinaryWriterSession session, bool ownsStream)
-               {
-                       if (dictionary == null)
-                               dictionary = new XmlDictionary ();
-                       if (session == null)
-                               session = new XmlBinaryWriterSession ();
-
-                       original = new MyBinaryWriter (stream);
-                       this.writer = original;
-                       buffer_writer = new MyBinaryWriter (buffer);
-                       this.dict_ext = dictionary;
-                       this.session = session;
-                       owns_stream = ownsStream;
-
-                       AddNamespace ("xml", "http://www.w3.org/XML/1998/namespace");
-                       AddNamespace ("xml", "http://www.w3.org/2000/xmlns/");
-                       ns_index = 2;
-               }
-
-               #endregion
-
-               #region Properties
-
-               public override WriteState WriteState {
-                       get { return state; }
-               }
-               
-               public override string XmlLang {
-                       get { return xml_lang; }
-               }
-
-               public override XmlSpace XmlSpace {
-                       get { return xml_space; }
-               }
-
-               #endregion
-
-               #region Methods
-
-               private void AddMissingElementXmlns ()
-               {
-                       // push new namespaces to manager.
-                       for (int i = ns_index; i < namespaces.Count; i++) {
-                               var ent = namespaces [i];
-                               string prefix = (string) ent.Key;
-                               string ns = ent.Value as string;
-                               XmlDictionaryString dns = ent.Value as XmlDictionaryString;
-                               if (ns != null) {
-                                       if (prefix.Length > 0) {
-                                               writer.Write (BF.PrefixNSString);
-                                               writer.Write (prefix);
-                                       }
-                                       else
-                                               writer.Write (BF.DefaultNSString);
-                                       writer.Write (ns);
-                               } else {
-                                       if (prefix.Length > 0) {
-                                               writer.Write (BF.PrefixNSIndex);
-                                               writer.Write (prefix);
-                                       }
-                                       else
-                                               writer.Write (BF.DefaultNSIndex);
-                                       WriteDictionaryIndex (dns);
-                               }
-                       }
-                       ns_index = namespaces.Count;
-               }
-
-               private void CheckState ()
-               {
-                       if (state == WriteState.Closed) {
-                               throw new InvalidOperationException ("The Writer is closed.");
-                       }
-               }
-
-               void ProcessStateForContent ()
-               {
-                       CheckState ();
-
-                       if (state == WriteState.Element)
-                               CloseStartElement ();
-
-                       ProcessPendingBuffer (false, false);
-                       if (state != WriteState.Attribute)
-                               writer = buffer_writer;
-               }
-
-               void ProcessTypedValue ()
-               {
-                       ProcessStateForContent ();
-                       if (state == WriteState.Attribute) {
-                               if (attr_typed_value)
-                                       throw new InvalidOperationException (String.Format ("A typed value for the attribute '{0}' in namespace '{1}' was already written", current_attr_name, current_attr_ns));
-                               attr_typed_value = true;
-                       }
-               }
-
-               void ProcessPendingBuffer (bool last, bool endElement)
-               {
-                       if (buffer.Position > 0) {
-                               byte [] arr = buffer.GetBuffer ();
-                               if (endElement)
-                                       arr [0]++;
-                               original.Write (arr, 0, (int) buffer.Position);
-                               buffer.SetLength (0);
-                       }
-                       if (last)
-                               writer = original;
-               }
-
-               public override void Close ()
-               {
-                       CloseOpenAttributeAndElements ();
-
-                       if (owns_stream)
-                               writer.Close ();
-                       else if (state != WriteState.Closed)
-                               writer.Flush ();
-                       state = WriteState.Closed;
-               }
-
-               private void CloseOpenAttributeAndElements ()
-               {
-                       CloseStartElement ();
-
-                        while (element_count > 0)
-                               WriteEndElement ();
-               }
-
-               private void CloseStartElement ()
-               {
-                       if (!open_start_element)
-                               return;
-
-                       if (state == WriteState.Attribute)
-                               WriteEndAttribute ();
-
-                       AddMissingElementXmlns ();
-
-                       state = WriteState.Content;
-                       open_start_element = false;
-               }
-
-               public override void Flush ()
-               {
-                       writer.Flush ();
-               }
-
-               public override string LookupPrefix (string ns)
-               {
-                       if (ns == null || ns == String.Empty)
-                               throw new ArgumentException ("The Namespace cannot be empty.");
-
-                       var de = namespaces.LastOrDefault (i => i.Value.ToString () == ns);
-                       return de.Key; // de is KeyValuePair and its default key is null.
-               }
-
-               public override void WriteBase64 (byte[] buffer, int index, int count)
-               {
-                       if (count < 0)
-                               throw new IndexOutOfRangeException ("Negative count");
-                       ProcessStateForContent ();
-
-                       if (count < 0x100) {
-                               writer.Write (BF.Bytes8);
-                               writer.Write ((byte) count);
-                               writer.Write (buffer, index, count);
-                       } else if (count < 0x10000) {
-                               writer.Write (BF.Bytes8);
-                               writer.Write ((ushort) count);
-                               writer.Write (buffer, index, count);
-                       } else {
-                               writer.Write (BF.Bytes32);
-                               writer.Write (count);
-                               writer.Write (buffer, index, count);
-                       }
-               }
-
-               public override void WriteCData (string text)
-               {
-                       if (text.IndexOf ("]]>") >= 0)
-                               throw new ArgumentException ("CDATA section cannot contain text \"]]>\".");
-
-                       ProcessStateForContent ();
-
-                       WriteTextBinary (text);
-               }
-
-               public override void WriteCharEntity (char ch)
-               {
-                       WriteChars (new char [] {ch}, 0, 1);
-               }
-
-               public override void WriteChars (char[] buffer, int index, int count)
-               {
-                       ProcessStateForContent ();
-
-                       int blen = Encoding.UTF8.GetByteCount (buffer, index, count);
-
-                       if (blen == 0)
-                               writer.Write (BF.EmptyText);
-                       else if (count == 1 && buffer [0] == '0')
-                               writer.Write (BF.Zero);
-                       else if (count == 1 && buffer [0] == '1')
-                               writer.Write (BF.One);
-                       else if (blen < 0x100) {
-                               writer.Write (BF.Chars8);
-                               writer.Write ((byte) blen);
-                               writer.Write (buffer, index, count);
-                       } else if (blen < 0x10000) {
-                               writer.Write (BF.Chars16);
-                               writer.Write ((ushort) blen);
-                               writer.Write (buffer, index, count);
-                       } else {
-                               writer.Write (BF.Chars32);
-                               writer.Write (blen);
-                               writer.Write (buffer, index, count);
-                       }
-               }
-
-               public override void WriteComment (string text)
-               {
-                       if (text.EndsWith("-"))
-                               throw new ArgumentException ("An XML comment cannot contain \"--\" inside.");
-                       else if (text.IndexOf("--") > 0)
-                               throw new ArgumentException ("An XML comment cannot end with \"-\".");
-
-                       ProcessStateForContent ();
-
-                       if (state == WriteState.Attribute)
-                               throw new InvalidOperationException ("Comment node is not allowed inside an attribute");
-
-                       writer.Write (BF.Comment);
-                       writer.Write (text);
-               }
-
-               public override void WriteDocType (string name, string pubid, string sysid, string subset)
-               {
-                       throw new NotSupportedException ("This XmlWriter implementation does not support document type.");
-               }
-
-               public override void WriteEndAttribute ()
-               {
-                       if (state != WriteState.Attribute)
-                               throw new InvalidOperationException("Token EndAttribute in state Start would result in an invalid XML document.");
-
-                       CheckState ();
-
-                       if (attr_value == null)
-                               attr_value = String.Empty;
-
-                       switch (save_target) {
-                       case SaveTarget.XmlLang:
-                               xml_lang = attr_value;
-                               goto default;
-                       case SaveTarget.XmlSpace:
-                               switch (attr_value) {
-                               case "preserve":
-                                       xml_space = XmlSpace.Preserve;
-                                       break;
-                               case "default":
-                                       xml_space = XmlSpace.Default;
-                                       break;
-                               default:
-                                       throw new ArgumentException (String.Format ("Invalid xml:space value: '{0}'", attr_value));
-                               }
-                               goto default;
-                       case SaveTarget.Namespaces:
-                               if (current_attr_name.ToString ().Length > 0 && attr_value.Length == 0)
-                                       throw new ArgumentException ("Cannot use prefix with an empty namespace.");
-
-                               AddNamespaceChecked (current_attr_name.ToString (), attr_value);
-                               break;
-                       default:
-                               if (!attr_typed_value)
-                                       WriteTextBinary (attr_value);
-                               break;
-                       }
-
-                       if (current_attr_prefix.Length > 0 && save_target != SaveTarget.Namespaces)
-                               AddNamespaceChecked (current_attr_prefix, current_attr_ns);
-
-                       state = WriteState.Element;
-                       current_attr_prefix = null;
-                       current_attr_name = null;
-                       current_attr_ns = null;
-                       attr_value = null;
-                       attr_typed_value = false;
-               }
-
-               public override void WriteEndDocument ()
-               {
-                       CloseOpenAttributeAndElements ();
-
-                       switch (state) {
-                       case WriteState.Start:
-                               throw new InvalidOperationException ("Document has not started.");
-                       case WriteState.Prolog:
-                               throw new ArgumentException ("This document does not have a root element.");
-                       }
-
-                       state = WriteState.Start;
-               }
-
-               bool SupportsCombinedEndElementSupport (byte operation)
-               {
-                       switch (operation) {
-                       case BF.Comment:
-                               return false;
-                       }
-                       return true;
-               }
-
-               public override void WriteEndElement ()
-               {
-                       if (element_count-- == 0)
-                               throw new InvalidOperationException("There was no XML start tag open.");
-
-                       if (state == WriteState.Attribute)
-                               WriteEndAttribute ();
-
-                       // Comment+EndElement does not exist
-                       bool needExplicitEndElement = buffer.Position == 0 || !SupportsCombinedEndElementSupport (buffer.GetBuffer () [0]);
-                       ProcessPendingBuffer (true, !needExplicitEndElement);
-                       CheckState ();
-                       AddMissingElementXmlns ();
-
-                       if (needExplicitEndElement)
-                               writer.Write (BF.EndElement);
-
-                       element_ns = element_ns_stack.Pop ();
-                       xml_lang = xml_lang_stack.Pop ();
-                       xml_space = xml_space_stack.Pop ();
-                       int cur = namespaces.Count;
-                       ns_index = ns_index_stack.Pop ();
-                       namespaces.RemoveRange (ns_index, cur - ns_index);
-                       open_start_element = false;
-
-                       Depth--;
-               }
-
-               public override void WriteEntityRef (string name)
-               {
-                       throw new NotSupportedException ("This XmlWriter implementation does not support entity references.");
-               }
-
-               public override void WriteFullEndElement ()
-               {
-                       WriteEndElement ();
-               }
-
-               public override void WriteProcessingInstruction (string name, string text)
-               {
-                       if (name != "xml")
-                               throw new ArgumentException ("Processing instructions are not supported. ('xml' is allowed for XmlDeclaration; this is because of design problem of ECMA XmlWriter)");
-                       // Otherwise, silently ignored. WriteStartDocument()
-                       // is still callable after this method(!)
-               }
-
-               public override void WriteQualifiedName (XmlDictionaryString local, XmlDictionaryString ns)
-               {
-                       string prefix = namespaces.LastOrDefault (i => i.Value.ToString () == ns.ToString ()).Key;
-                       bool use_dic = prefix != null;
-                       if (prefix == null)
-                               prefix = LookupPrefix (ns.Value);
-                       if (prefix == null)
-                               throw new ArgumentException (String.Format ("Namespace URI '{0}' is not bound to any of the prefixes", ns));
-
-                       ProcessTypedValue ();
-
-                       if (use_dic && prefix.Length == 1) {
-                               writer.Write (BF.QNameIndex);
-                               writer.Write ((byte) (prefix [0] - 'a'));
-                               WriteDictionaryIndex (local);
-                       } else {
-                               // QNameIndex is not applicable.
-                               WriteString (prefix);
-                               WriteString (":");
-                               WriteString (local);
-                       }
-               }
-
-               public override void WriteRaw (string data)
-               {
-                       WriteString (data);
-               }
-
-               public override void WriteRaw (char[] buffer, int index, int count)
-               {
-                       WriteChars (buffer, index, count);
-               }
-
-               void CheckStateForAttribute ()
-               {
-                       CheckState ();
-
-                       if (state != WriteState.Element)
-                               throw new InvalidOperationException ("Token StartAttribute in state " + WriteState + " would result in an invalid XML document.");
-               }
-
-               string CreateNewPrefix ()
-               {
-                       return CreateNewPrefix (String.Empty);
-               }
-               
-               string CreateNewPrefix (string p)
-               {
-                       for (char c = 'a'; c <= 'z'; c++)
-                               if (!namespaces.Any (iter => iter.Key == p + c))
-                                       return p + c;
-                       for (char c = 'a'; c <= 'z'; c++) {
-                               var s = CreateNewPrefix (c.ToString ());
-                               if (s != null)
-                                       return s;
-                       }
-                       throw new InvalidOperationException ("too many prefix population");
-               }
-
-               bool CollectionContains (ICollection col, string value)
-               {
-                       foreach (string v in col)
-                               if (v == value)
-                                       return true;
-                       return false;
-               }
-
-               void ProcessStartAttributeCommon (ref string prefix, string localName, string ns, object nameObj, object nsObj)
-               {
-                       // dummy prefix is created here, while the caller
-                       // still uses empty string as the prefix there.
-                       if (prefix.Length == 0 && ns.Length > 0) {
-                               prefix = LookupPrefix (ns);
-                               // Not only null but also ""; when the returned
-                               // string is empty, then it still needs a dummy
-                               // prefix, since default namespace does not
-                               // apply to attribute
-                               if (String.IsNullOrEmpty (prefix))
-                                       prefix = CreateNewPrefix ();
-                       }
-                       else if (prefix.Length > 0 && ns.Length == 0) {
-                               switch (prefix) {
-                               case "xml":
-                                       nsObj = ns = XmlNamespace;
-                                       break;
-                               case "xmlns":
-                                       nsObj = ns = XmlnsNamespace;
-                                       break;
-                               default:
-                                       throw new ArgumentException ("Cannot use prefix with an empty namespace.");
-                               }
-                       }
-                       // here we omit such cases that it is used for writing
-                       // namespace-less xml, unlike XmlTextWriter.
-                       if (prefix == "xmlns" && ns != XmlnsNamespace)
-                               throw new ArgumentException (String.Format ("The 'xmlns' attribute is bound to the reserved namespace '{0}'", XmlnsNamespace));
-
-                       CheckStateForAttribute ();
-
-                       state = WriteState.Attribute;
-
-                       save_target = SaveTarget.None;
-                       switch (prefix) {
-                       case "xml":
-                               // MS.NET looks to allow other names than 
-                               // lang and space (e.g. xml:link, xml:hack).
-                               ns = XmlNamespace;
-                               switch (localName) {
-                               case "lang":
-                                       save_target = SaveTarget.XmlLang;
-                                       break;
-                               case "space":
-                                       save_target = SaveTarget.XmlSpace;
-                                       break;
-                               }
-                               break;
-                       case "xmlns":
-                               save_target = SaveTarget.Namespaces;
-                               break;
-                       }
-
-                       current_attr_prefix = prefix;
-                       current_attr_name = nameObj;
-                       current_attr_ns = nsObj;
-               }
-
-               public override void WriteStartAttribute (string prefix, string localName, string ns)
-               {
-                       if (prefix == null)
-                               prefix = String.Empty;
-                       if (ns == null)
-                               ns = String.Empty;
-                       if (localName == "xmlns" && prefix.Length == 0) {
-                               prefix = "xmlns";
-                               localName = String.Empty;
-                       }
-
-                       ProcessStartAttributeCommon (ref prefix, localName, ns, localName, ns);
-
-                       // for namespace nodes we don't write attribute node here.
-                       if (save_target == SaveTarget.Namespaces)
-                               return;
-
-                       byte op = prefix.Length == 1 && 'a' <= prefix [0] && prefix [0] <= 'z' ?
-                                 (byte) (prefix [0] - 'a' + BF.PrefixNAttrStringStart) :
-                                 prefix.Length == 0 ? BF.AttrString :
-                                 BF.AttrStringPrefix;
-
-                       if (BF.PrefixNAttrStringStart <= op && op <= BF.PrefixNAttrStringEnd) {
-                               writer.Write (op);
-                               writer.Write (localName);
-                       } else {
-                               writer.Write (op);
-                               if (prefix.Length > 0)
-                                       writer.Write (prefix);
-                               writer.Write (localName);
-                       }
-               }
-
-               public override void WriteStartDocument ()
-               {
-                       WriteStartDocument (false);
-               }
-
-               public override void WriteStartDocument (bool standalone)
-               {
-                       if (state != WriteState.Start)
-                               throw new InvalidOperationException("WriteStartDocument should be the first call.");
-
-                       CheckState ();
-
-                       // write nothing to stream.
-
-                       state = WriteState.Prolog;
-               }
-
-               void PrepareStartElement ()
-               {
-                       ProcessPendingBuffer (true, false);
-                       CheckState ();
-                       CloseStartElement ();
-
-                       Depth++;
-
-                       element_ns_stack.Push (element_ns);
-                       xml_lang_stack.Push (xml_lang);
-                       xml_space_stack.Push (xml_space);
-                       ns_index_stack.Push (ns_index);
-               }
-
-               public override void WriteStartElement (string prefix, string localName, string ns)
-               {
-                       PrepareStartElement ();
-
-                       if ((prefix != null && prefix != String.Empty) && ((ns == null) || (ns == String.Empty)))
-                               throw new ArgumentException ("Cannot use a prefix with an empty namespace.");
-
-                       if (ns == null)
-                               ns = String.Empty;
-                       if (ns == String.Empty)
-                               prefix = String.Empty;
-                       if (prefix == null)
-                               prefix = String.Empty;
-
-                       byte op = prefix.Length == 1 && 'a' <= prefix [0] && prefix [0] <= 'z' ?
-                                 (byte) (prefix [0] - 'a' + BF.PrefixNElemStringStart) :
-                                 prefix.Length == 0 ? BF.ElemString :
-                                 BF.ElemStringPrefix;
-
-                       if (BF.PrefixNElemStringStart <= op && op <= BF.PrefixNElemStringEnd) {
-                               writer.Write (op);
-                               writer.Write (localName);
-                       } else {
-                               writer.Write (op);
-                               if (prefix.Length > 0)
-                                       writer.Write (prefix);
-                               writer.Write (localName);
-                       }
-
-                       OpenElement (prefix, ns);
-               }
-
-               void OpenElement (string prefix, object nsobj)
-               {
-                       string ns = nsobj.ToString ();
-
-                       state = WriteState.Element;
-                       open_start_element = true;
-                       element_prefix = prefix;
-                       element_count++;
-                       element_ns = nsobj.ToString ();
-
-                       if (element_ns != String.Empty && LookupPrefix (element_ns) != prefix)
-                               AddNamespace (prefix, nsobj);
-               }
-
-               void AddNamespace (string prefix, object nsobj)
-               {
-                       namespaces.Add (new KeyValuePair<string,object> (prefix, nsobj));
-               }
-
-               void CheckIfTextAllowed ()
-               {
-                       switch (state) {
-                       case WriteState.Start:
-                       case WriteState.Prolog:
-                               throw new InvalidOperationException ("Token content in state Prolog would result in an invalid XML document.");
-                       }
-               }
-
-               public override void WriteString (string text)
-               {
-                       if (text == null)
-                               throw new ArgumentNullException ("text");
-                       CheckIfTextAllowed ();
-
-                       if (text == null)
-                               text = String.Empty;
-
-                       ProcessStateForContent ();
-
-                       if (state == WriteState.Attribute)
-                               attr_value += text;
-                       else
-                               WriteTextBinary (text);
-               }
-
-               public override void WriteString (XmlDictionaryString text)
-               {
-                       if (text == null)
-                               throw new ArgumentNullException ("text");
-                       CheckIfTextAllowed ();
-
-                       if (text == null)
-                               text = XmlDictionaryString.Empty;
-
-                       ProcessStateForContent ();
-
-                       if (state == WriteState.Attribute)
-                               attr_value += text.Value;
-                       else if (text.Equals (XmlDictionary.Empty))
-                               writer.Write (BF.EmptyText);
-                       else {
-                               writer.Write (BF.TextIndex);
-                               WriteDictionaryIndex (text);
-                       }
-               }
-
-               public override void WriteSurrogateCharEntity (char lowChar, char highChar)
-               {
-                       WriteChars (new char [] {highChar, lowChar}, 0, 2);
-               }
-
-               public override void WriteWhitespace (string ws)
-               {
-                       for (int i = 0; i < ws.Length; i++) {
-                               switch (ws [i]) {
-                               case ' ': case '\t': case '\r': case '\n':
-                                       continue;
-                               default:
-                                       throw new ArgumentException ("Invalid Whitespace");
-                               }
-                       }
-
-                       ProcessStateForContent ();
-
-                       WriteTextBinary (ws);
-               }
-
-               public override void WriteXmlnsAttribute (string prefix, string namespaceUri)
-               {
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-
-                       if (String.IsNullOrEmpty (prefix))
-                               prefix = CreateNewPrefix ();
-
-                       CheckStateForAttribute ();
-
-                       AddNamespaceChecked (prefix, namespaceUri);
-
-                       state = WriteState.Element;
-               }
-
-               void AddNamespaceChecked (string prefix, object ns)
-               {
-                       switch (ns.ToString ()) {
-                       case XmlnsNamespace:
-                       case XmlNamespace:
-                               return;
-                       }
-
-                       if (prefix == null)
-                               throw new InvalidOperationException ();
-                       var o = namespaces.LastOrDefault (i => i.Key == prefix);
-                       if (o.Key != null) { // i.e. exists
-                               if (o.Value.ToString () != ns.ToString ()) {
-                                       if (namespaces.LastIndexOf (o) >= ns_index)
-                                               throw new ArgumentException (String.Format ("The prefix '{0}' is already mapped to another namespace URI '{1}' in this element scope and cannot be mapped to '{2}'", prefix ?? "(null)", o.Value ?? "(null)", ns.ToString ()));
-                                       else
-                                               AddNamespace  (prefix, ns);
-                               }
-                       }
-                       else
-                               AddNamespace  (prefix, ns);
-               }
-
-               #region DictionaryString
-
-               void WriteDictionaryIndex (XmlDictionaryString ds)
-               {
-                       XmlDictionaryString ds2;
-                       bool isSession = false;
-                       int idx = ds.Key;
-                       if (ds.Dictionary != dict_ext) {
-                               isSession = true;
-                               if (dict_int.TryLookup (ds.Value, out ds2))
-                                       ds = ds2;
-                               if (!session.TryLookup (ds, out idx))
-                                       session.TryAdd (dict_int.Add (ds.Value), out idx);
-                       }
-                       if (idx >= 0x80) {
-                               writer.Write ((byte) (0x80 + ((idx % 0x80) << 1) + (isSession ? 1 : 0)));
-                               writer.Write ((byte) ((byte) (idx / 0x80) << 1));
-                       }
-                       else
-                               writer.Write ((byte) (((idx % 0x80) << 1) + (isSession ? 1 : 0)));
-               }
-
-               public override void WriteStartElement (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       PrepareStartElement ();
-
-                       if (prefix == null)
-                               prefix = String.Empty;
-
-                       byte op = prefix.Length == 1 && 'a' <= prefix [0] && prefix [0] <= 'z' ?
-                                 (byte) (prefix [0] - 'a' + BF.PrefixNElemIndexStart) :
-                                 prefix.Length == 0 ? BF.ElemIndex :
-                                 BF.ElemIndexPrefix;
-
-                       if (BF.PrefixNElemIndexStart <= op && op <= BF.PrefixNElemIndexEnd) {
-                               writer.Write (op);
-                               WriteDictionaryIndex (localName);
-                       } else {
-                               writer.Write (op);
-                               if (prefix.Length > 0)
-                                       writer.Write (prefix);
-                               WriteDictionaryIndex (localName);
-                       }
-
-                       OpenElement (prefix, namespaceUri);
-               }
-
-               public override void WriteStartAttribute (string prefix, XmlDictionaryString localName, XmlDictionaryString ns)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (prefix == null)
-                               prefix = String.Empty;
-                       if (ns == null)
-                               ns = XmlDictionaryString.Empty;
-                       if (localName.Value == "xmlns" && prefix.Length == 0) {
-                               prefix = "xmlns";
-                               localName = XmlDictionaryString.Empty;
-                       }
-
-                       ProcessStartAttributeCommon (ref prefix, localName.Value, ns.Value, localName, ns);
-
-                       if (save_target == SaveTarget.Namespaces)
-                               return;
-
-                       if (prefix.Length == 1 && 'a' <= prefix [0] && prefix [0] <= 'z') {
-                               writer.Write ((byte) (prefix [0] - 'a' + BF.PrefixNAttrIndexStart));
-                               WriteDictionaryIndex (localName);
-                       } else {
-                               byte op = ns.Value.Length == 0 ? BF.AttrIndex :BF.AttrIndexPrefix;
-                               // Write to Stream
-                               writer.Write (op);
-                               if (prefix.Length > 0)
-                                       writer.Write (prefix);
-                               WriteDictionaryIndex (localName);
-                       }
-               }
-
-               public override void WriteXmlnsAttribute (string prefix, XmlDictionaryString namespaceUri)
-               {
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-
-                       if (String.IsNullOrEmpty (prefix))
-                               prefix = CreateNewPrefix ();
-
-                       CheckStateForAttribute ();
-
-                       AddNamespaceChecked (prefix, namespaceUri);
-
-                       state = WriteState.Element;
-               }
-               #endregion
-
-               #region WriteValue
-               public override void WriteValue (bool value)
-               {
-                       ProcessTypedValue ();
-                       writer.Write ((byte) (value ? BF.BoolTrue : BF.BoolFalse));
-               }
-
-               public override void WriteValue (int value)
-               {
-                       WriteValue ((long) value);
-               }
-
-               public override void WriteValue (long value)
-               {
-                       ProcessTypedValue ();
-
-                       if (value == 0)
-                               writer.Write (BF.Zero);
-                       else if (value == 1)
-                               writer.Write (BF.One);
-                       else if (value < 0 || value > uint.MaxValue) {
-                               writer.Write (BF.Int64);
-                               for (int i = 0; i < 8; i++) {
-                                       writer.Write ((byte) (value & 0xFF));
-                                       value >>= 8;
-                               }
-                       } else if (value <= byte.MaxValue) {
-                               writer.Write (BF.Int8);
-                               writer.Write ((byte) value);
-                       } else if (value <= short.MaxValue) {
-                               writer.Write (BF.Int16);
-                               writer.Write ((byte) (value & 0xFF));
-                               writer.Write ((byte) (value >> 8));
-                       } else if (value <= int.MaxValue) {
-                               writer.Write (BF.Int32);
-                               for (int i = 0; i < 4; i++) {
-                                       writer.Write ((byte) (value & 0xFF));
-                                       value >>= 8;
-                               }
-                       }
-               }
-
-               public override void WriteValue (float value)
-               {
-                       ProcessTypedValue ();
-                       writer.Write (BF.Single);
-                       WriteValueContent (value);
-               }
-
-               void WriteValueContent (float value)
-               {
-                       writer.Write (value);
-               }
-
-               public override void WriteValue (double value)
-               {
-                       ProcessTypedValue ();
-                       writer.Write (BF.Double);
-                       WriteValueContent (value);
-               }
-
-               void WriteValueContent (double value)
-               {
-                       writer.Write (value);
-               }
-
-               public override void WriteValue (decimal value)
-               {
-                       ProcessTypedValue ();
-                       writer.Write (BF.Decimal);
-                       WriteValueContent (value);
-               }
-
-               void WriteValueContent (decimal value)
-               {
-                       int [] bits = Decimal.GetBits (value);
-                       // so, looks like it is saved as its internal form,
-                       // not the returned order.
-                       // BinaryWriter.Write(Decimal) is useless here.
-                       writer.Write (bits [3]);
-                       writer.Write (bits [2]);
-                       writer.Write (bits [0]);
-                       writer.Write (bits [1]);
-               }
-
-               public override void WriteValue (DateTime value)
-               {
-                       ProcessTypedValue ();
-                       writer.Write (BF.DateTime);
-                       WriteValueContent (value);
-               }
-
-               void WriteValueContent (DateTime value)
-               {
-                       writer.Write (value.ToBinary ());
-               }
-
-               public override void WriteValue (Guid value)
-               {
-                       ProcessTypedValue ();
-                       writer.Write (BF.Guid);
-                       WriteValueContent (value);
-               }
-
-               void WriteValueContent (Guid value)
-               {
-                       byte [] bytes = value.ToByteArray ();
-                       writer.Write (bytes, 0, bytes.Length);
-               }
-
-               public override void WriteValue (UniqueId value)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-
-                       Guid guid;
-                       if (value.TryGetGuid (out guid)) {
-                               // this conditional branching is required for
-                               // attr_typed_value not being true.
-                               ProcessTypedValue ();
-
-                               writer.Write (BF.UniqueId);
-                               byte [] bytes = guid.ToByteArray ();
-                               writer.Write (bytes, 0, bytes.Length);
-                       } else {
-                               WriteValue (value.ToString ());
-                       }
-               }
-
-               public override void WriteValue (TimeSpan value)
-               {
-                       ProcessTypedValue ();
-
-                       writer.Write (BF.TimeSpan);
-                       WriteValueContent (value);
-               }
-
-               void WriteValueContent (TimeSpan value)
-               {
-                       WriteBigEndian (value.Ticks, 8);
-               }
-               #endregion
-
-               private void WriteBigEndian (long value, int digits)
-               {
-                       long v = 0;
-                       for (int i = 0; i < digits; i++) {
-                               v = (v << 8) + (value & 0xFF);
-                               value >>= 8;
-                       }
-                       for (int i = 0; i < digits; i++) {
-                               writer.Write ((byte) (v & 0xFF));
-                               v >>= 8;
-                       }
-               }
-
-               private void WriteTextBinary (string text)
-               {
-                       if (text.Length == 0)
-                               writer.Write (BF.EmptyText);
-                       else {
-                               char [] arr = text.ToCharArray ();
-                               WriteChars (arr, 0, arr.Length);
-                       }
-               }
-
-               #endregion
-
-               #region Write typed array content
-
-               // they are packed in WriteValue(), so we cannot reuse
-               // them for array content.
-
-               void WriteValueContent (bool value)
-               {
-                       writer.Write (value ? (byte) 1 : (byte) 0);
-               }
-
-               void WriteValueContent (short value)
-               {
-                       writer.Write (value);
-               }
-
-               void WriteValueContent (int value)
-               {
-                       writer.Write (value);
-               }
-
-               void WriteValueContent (long value)
-               {
-                       writer.Write (value);
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriterAutoGen.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriterAutoGen.cs
deleted file mode 100644 (file)
index fb1c7ea..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-
-using System;
-using BF = System.Xml.XmlBinaryFormat;
-
-namespace System.Xml
-{
-       internal partial class XmlBinaryDictionaryWriter : XmlDictionaryWriter
-       {
-               void CheckWriteArrayArguments (Array array, int offset, int length)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException ("array");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException ("offset is negative");
-                       if (offset > array.Length)
-                               throw new ArgumentOutOfRangeException ("offset exceeds the length of the destination array");
-                       if (length < 0)
-                               throw new ArgumentOutOfRangeException ("length is negative");
-                       if (length > array.Length - offset)
-                               throw new ArgumentOutOfRangeException ("length + offset exceeds the length of the destination array");
-               }
-
-               void CheckDictionaryStringArgs (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-               }
-
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, bool [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, bool [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (bool [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0xB5); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, DateTime [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, DateTime [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (DateTime [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x97); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, decimal [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, decimal [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (decimal [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x95); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, double [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, double [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (double [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x93); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Guid [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, Guid [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (Guid [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0xB1); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, short [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, short [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (short [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x8B); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, int [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, int [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (int [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x8D); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, long [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, long [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (long [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x8F); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, float [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, float [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (float [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x91); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, TimeSpan [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (TimeSpan [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0xAF); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryFormat.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryFormat.cs
deleted file mode 100644 (file)
index 2d95052..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-//
-// XmlBinaryFormat.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2007 Novell, Inc.  http://www.novell.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Xml
-{
-       internal class XmlBinaryFormat
-       {
-               public const byte EndElement = 0x01;
-               public const byte Comment = 0x02;
-               public const byte Array = 0x03;
-               public const byte AttrString = 0x04;
-               public const byte AttrStringPrefix = 0x05;
-               public const byte AttrIndex = 0x06;
-               public const byte AttrIndexPrefix = 0x07;
-               public const byte DefaultNSString = 0x08;
-               public const byte PrefixNSString = 0x09;
-               public const byte DefaultNSIndex = 0x0A;
-               public const byte PrefixNSIndex = 0x0B;
-               public const byte PrefixNAttrIndexStart = 0x0C;
-               public const byte PrefixNAttrIndexEnd = 0x0C + 26 - 1;
-               public const byte PrefixNAttrStringStart = 0x26;
-               public const byte PrefixNAttrStringEnd = 0x26 + 26 - 1;
-               public const byte ElemString = 0x40;
-               public const byte ElemStringPrefix = 0x41;
-               public const byte ElemIndex = 0x42;
-               public const byte ElemIndexPrefix = 0x43;
-               public const byte PrefixNElemIndexStart = 0x44;
-               public const byte PrefixNElemIndexEnd = 0x44 + 26 - 1;
-               public const byte PrefixNElemStringStart = 0x5E;
-               public const byte PrefixNElemStringEnd = 0x5E + 26 - 1;
-
-               public const byte Zero = 0x80;
-               public const byte One = 0x82;
-               public const byte BoolFalse = 0x84;
-               public const byte BoolTrue = 0x86;
-               public const byte Int8 = 0x88;
-               public const byte Int16 = 0x8A;
-               public const byte Int32 = 0x8C;
-               public const byte Int64 = 0x8E;
-               public const byte Single = 0x90;
-               public const byte Double = 0x92;
-               public const byte Decimal = 0x94;
-               public const byte DateTime = 0x96;
-               public const byte Chars8 = 0x98;
-               public const byte Chars16 = 0x9A;
-               public const byte Chars32 = 0x9C;
-               public const byte Bytes8 = 0x9E;
-               public const byte Bytes16 = 0xA0;
-               public const byte Bytes32 = 0xA2;
-
-               public const byte EmptyText = 0xA8;
-               public const byte TextIndex = 0xAA;
-               public const byte UniqueId = 0xAC;
-               public const byte TimeSpan = 0xAE;
-               public const byte Guid = 0xB0;
-               public const byte UInt64 = 0xB2;
-               public const byte Bool = 0xB4; // e.g. for typed array
-               public const byte Utf16_8 = 0xB6;
-               public const byte Utf16_16 = 0xB8;
-               public const byte Utf16_32 = 0xBA;
-               public const byte QNameIndex = 0xBC;
-       }
-
-       /* Binary Format (incomplete):
-
-               Literal strings are represented as UTF-8 string, with a length
-               prefixed to the string itself.
-
-               Key indices are based on the rules below:
-               - dictionary strings which can be found in IXmlDictionary are 
-                 doubled its Key. e.g. if the string.Key is 4, then the
-                 output is 8.
-               - dictionary strings which cannot be found in IXmlDictionary
-                 are stored in the XmlBinaryWriterSession, and its output
-                 number is doubled + 1 e.g. if the string is the first
-                 non-dictionary entry, then the output is 1, and 7 for the
-                 fourth one.
-               - When the index goes beyond 128, then it becomes 2 bytes,
-                 where the first byte becomes 0x80 + idx % 0x80 and
-                 the second byte becomes idx / 0x80.
-
-               Below are operations. Prefixes are always raw strings.
-               $string is length-prefixed string. @index is index as
-               described above. [value] is length-prefixed raw array.
-
-               // 2009-03-25: now that the binary format is open under OSP
-               // [MC-NBFX], I have added some notes beyond current
-               // implementation status (marked as TODO).
-
-               01                      : EndElement
-               02 $value               : Comment
-               03                      : array
-               04 $name                : local attribute by string
-               05 $prefix $name        : global attribute by string
-               06 @name                : local attribute by index
-               07 $prefix @name        : global attribute by index
-               08 $name                : default namespace by string
-               09 $prefix $name        : prefixed namespace by string
-               0A @name                : default namespace by index
-               0B $prefix @name        : prefixed namespace by index
-               0C @name                : global attribute by index,
-               ... 0x25                : in current element's namespace
-               26 ... 0x3F             : attributes with prefix
-               40 $name                : element w/o namespace by string
-               41 $prefix $name        : element with namespace by string
-               42 @name                : element w/o namespace by index
-               43 $prefix @name        : element with namespace by index
-               44 @name                : global element by index,
-               ... 0x5D                : in current element's namespace
-               5E ... 0x77             : elements with prefix
-               98 $value               : text/cdata/chars
-               99 $value               : text/cdata/chars + EndElement
-
-               FIXME: Below are not implemented:
-               (Uri is simply 98, QName is 98 '{' ns '}' 98 name)
-
-               Combined EndElement for below are supported:
-               80 : 0 (integer)
-               82 : 1 (integer)
-               84 : false (bool)
-               86 : true (bool)
-               88 : 1-byte integer
-               8A : 2-bytes integer
-               8C : 4-bytes integer
-               8E : 8-bytes integer
-               90 : single
-               92 : double
-               94 : decimal
-               96 : DateTime
-               98 : chars8
-               9A : chars16
-               9C : chars32
-               9E : bytes8 (base64)
-               A0 : bytes16 (base64)
-               A2 : bytes32 (base64)
-               A4 : TODO: start of list
-               A6 : TODO: end of list
-               A8 : empty text
-               AA : text index
-               AC : UniqueId (IsGuid = true)
-               AE : TimeSpan
-               B0 : UUID
-               B2 : UInt64
-               B4 : bool text
-               B6 : utf16_8
-               B8 : utf16_16
-               BA : utf16_32
-               BC : QName index
-
-               Error: PIs, doctype
-               Ignored: XMLdecl
-       */
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryReaderSession.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryReaderSession.cs
deleted file mode 100644 (file)
index 94c1438..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// XmlBinaryReaderSession.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-
-namespace System.Xml
-{
-       public class XmlBinaryReaderSession : IXmlDictionary
-       {
-               XmlDictionary dic = new XmlDictionary ();
-               Dictionary<int,XmlDictionaryString> store = new Dictionary<int,XmlDictionaryString> ();
-
-               public XmlBinaryReaderSession ()
-               {
-               }
-
-               public XmlDictionaryString Add (int id, string value)
-               {
-                       var v = dic.Add (value);
-                       store [id] = v;
-                       return v;
-               }
-
-               public void Clear ()
-               {
-                       store.Clear ();
-               }
-
-               public bool TryLookup (int key, out XmlDictionaryString result)
-               {
-                       return store.TryGetValue (key, out result);
-               }
-
-               public bool TryLookup (string value, out XmlDictionaryString result)
-               {
-                       foreach (var v in store.Values)
-                               if (v.Value == value) {
-                                       result = v;
-                                       return true;
-                               }
-                       result = null;
-                       return false;
-               }
-
-               public bool TryLookup (XmlDictionaryString value,
-                       out XmlDictionaryString result)
-               {
-                       foreach (var v in store.Values)
-                               if (v == value) {
-                                       result = v;
-                                       return true;
-                               }
-                       result = null;
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryWriterSession.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryWriterSession.cs
deleted file mode 100644 (file)
index 64753b8..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// XmlBinaryWriterSession.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005, 2007 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Collections.Generic;
-
-namespace System.Xml
-{
-       public class XmlBinaryWriterSession
-       {
-               Dictionary<int,XmlDictionaryString> dic =
-                       new Dictionary<int,XmlDictionaryString> ();
-
-               public XmlBinaryWriterSession ()
-               {
-               }
-
-               public void Reset ()
-               {
-                       dic.Clear ();
-               }
-
-               // Unlike XmlDictionary, it throws an InvalidOperationException
-               // if the same string already exists.
-               public virtual bool TryAdd (XmlDictionaryString value,
-                       out int key)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-                       if (TryLookup (value, out key))
-                               throw new InvalidOperationException ("Argument XmlDictionaryString was already added to the writer session");
-                       key = dic.Count;
-                       dic.Add (key, value);
-                       return true;
-               }
-
-               internal bool TryLookup (XmlDictionaryString value,
-                       out int key)
-               {
-                       foreach (KeyValuePair<int,XmlDictionaryString> e in dic)
-                               if (e.Value.Value == value.Value) {
-                                       key = e.Key;
-                                       return true;
-                               }
-                       key = -1;
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlC14NWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlC14NWriter.cs
deleted file mode 100644 (file)
index bedf337..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-//
-// XmlC14NWriter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#if USE_DEPRECATED
-using System;
-using System.IO;
-
-namespace System.Xml
-{
-       [MonoTODO]
-       public sealed class XmlC14NWriter : XmlCanonicalWriter
-       {
-               bool include_comments;
-
-               public XmlC14NWriter (Stream stream)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public XmlC14NWriter (Stream stream, bool includeComments,
-                       params string [] inclusivePrefixes)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public bool IncludeComments {
-                       get { return include_comments; }
-                       set {
-                               throw new NotImplementedException ();
-                       }
-               }
-
-               public override void Close ()
-               {
-                       Flush ();
-               }
-
-               public override void Flush ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public void SetOutput (Stream stream)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public void SetOutput (Stream stream, bool includeComments,
-                       params string [] inclusivePrefixes)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteBase64 (byte [] buffer, int index, int count)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteCharEntity (int ch)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteComment (string text)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteComment (byte [] data, int offset, int count)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteDeclaration ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEndAttribute ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEndElement (string prefix, string localName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEndElement (byte [] prefix, int offset1, int count1, byte [] localName, int offset2, int count2)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEndStartElement (bool isEmpty)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEscapedText (string text)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEscapedText (byte [] text, int offset, int count)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteNode (XmlReader reader)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteStartAttribute (string prefix, string localName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteStartAttribute (byte [] prefix, int offset1, int count1, byte [] localName, int offset2, int count2)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteStartElement (string prefix, string localName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteStartElement (byte [] prefix, int offset1, int count1, byte [] localName, int offset2, int count2)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteText (string text)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteText (int ch)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteText (byte [] text, int offset, int count)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteXmlnsAttribute (
-                       string prefix, string namespaceUri)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteXmlnsAttribute (byte [] prefix, int offset1, int count1, byte [] namespaceUri, int offset2, int count2)
-               {
-                       throw new NotImplementedException ();
-               }
-       }
-}
-#endif
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlCanonicalWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlCanonicalWriter.cs
deleted file mode 100644 (file)
index e0bdd38..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// XmlCanonicalWriter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#if USE_DEPRECATED
-using System;
-using System.IO;
-
-namespace System.Xml
-{
-       [MonoTODO]
-       public abstract class XmlCanonicalWriter
-       {
-               protected XmlCanonicalWriter ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public abstract void Close ();
-
-               public abstract void Flush ();
-
-               public abstract void WriteBase64 (byte [] buffer, int index, int count);
-
-               public abstract void WriteCharEntity (int ch);
-
-               public abstract void WriteComment (string text);
-
-               public abstract void WriteComment (byte [] data, int offset, int count);
-
-               public abstract void WriteDeclaration ();
-
-               public abstract void WriteEndAttribute ();
-
-               public abstract void WriteEndElement (string prefix, string localName);
-
-               public abstract void WriteEndElement (byte [] prefix, int offset1, int count1, byte [] localName, int offset2, int count2);
-
-               public abstract void WriteEndStartElement (bool isEmpty);
-
-               public abstract void WriteEscapedText (string text);
-
-               public abstract void WriteEscapedText (byte [] text, int offset, int count);
-
-               public abstract void WriteNode (XmlReader reader);
-
-               public abstract void WriteStartAttribute (string prefix, string localName);
-
-               public abstract void WriteStartAttribute (byte [] prefix, int offset1, int count1, byte [] localName, int offset2, int count2);
-
-               public abstract void WriteStartElement (string prefix, string localName);
-
-               public abstract void WriteStartElement (byte [] prefix, int offset1, int count1, byte [] localName, int offset2, int count2);
-
-               public abstract void WriteText (string text);
-
-               public abstract void WriteText (byte [] text, int offset, int count);
-
-               public abstract void WriteText (int ch);
-
-               public abstract void WriteXmlnsAttribute (
-                       string prefix, string namespaceUri);
-
-               public abstract void WriteXmlnsAttribute (byte [] prefix, int offset1, int count1, byte [] namespaceUri, int offset2, int count2);
-       }
-}
-#endif
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionary.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionary.cs
deleted file mode 100644 (file)
index 7537274..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// XmlDictionary.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-namespace System.Xml
-{
-       public class XmlDictionary : IXmlDictionary
-       {
-               internal class EmptyDictionary : XmlDictionary
-               {
-                       public static readonly EmptyDictionary Instance =
-                               new EmptyDictionary ();
-
-                       public EmptyDictionary ()
-                               : base (1)
-                       {
-                       }
-               }
-
-               static XmlDictionary empty = new XmlDictionary (true);
-
-               public static IXmlDictionary Empty {
-                       get { return empty; }
-               }
-
-               readonly bool is_readonly;
-               Dictionary<string, XmlDictionaryString> dict;
-               List<XmlDictionaryString> list;
-
-               public XmlDictionary ()
-               {
-                       dict = new Dictionary<string, XmlDictionaryString> ();
-                       list = new List<XmlDictionaryString> ();
-               }
-
-               public XmlDictionary (int capacity)
-               {
-                       dict = new Dictionary<string, XmlDictionaryString> (capacity);
-                       list = new List<XmlDictionaryString> (capacity);
-               }
-
-               // for static empty.
-               private XmlDictionary (bool isReadOnly)
-                       : this (1)
-               {
-                       is_readonly = isReadOnly;
-               }
-
-               public virtual XmlDictionaryString Add (string value)
-               {
-                       if (is_readonly)
-                               throw new InvalidOperationException ();
-                       XmlDictionaryString ret;
-                       if (dict.TryGetValue (value, out ret))
-                               return ret;
-                       ret = new XmlDictionaryString (this, value, dict.Count);
-                       dict.Add (value, ret);
-                       list.Add (ret);
-                       return ret;
-               }
-
-               public virtual bool TryLookup (
-                       int key, out XmlDictionaryString result)
-               {
-                       if (key < 0 || dict.Count <= key) {
-                               result = null;
-                               return false;
-                       }
-                       result = list [key];
-                       return true;
-               }
-
-               public virtual bool TryLookup (string value,
-                       out XmlDictionaryString result)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ();
-                       return dict.TryGetValue (value, out result);
-               }
-
-               public virtual bool TryLookup (XmlDictionaryString value,
-                       out XmlDictionaryString result)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ();
-                       if (value.Dictionary != this) {
-                               result = null;
-                               return false;
-                       }
-                       for (int i = 0; i < list.Count; i++) {
-                               if (object.ReferenceEquals (list [i], value)) {
-                                       result = value;
-                                       return true;
-                               }
-                       }
-                       result = null;
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReader.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReader.cs
deleted file mode 100644 (file)
index f1407dc..0000000
+++ /dev/null
@@ -1,662 +0,0 @@
-//
-// XmlDictionaryReader.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005, 2007 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Reflection;
-using System.Text;
-using System.Xml;
-
-namespace System.Xml
-{
-       public abstract partial class XmlDictionaryReader : XmlReader
-       {
-               protected XmlDictionaryReader ()
-               {
-               }
-
-               XmlDictionaryReaderQuotas quotas;
-
-               public virtual bool CanCanonicalize {
-                       get { return false; }
-               }
-
-               public virtual XmlDictionaryReaderQuotas Quotas {
-                       get {
-                               if (quotas == null)
-                                       quotas = new XmlDictionaryReaderQuotas ();
-                               return quotas;
-                       }
-               }
-
-               public virtual void EndCanonicalization ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public virtual string GetAttribute (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       return GetAttribute (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int IndexOfLocalName (
-                       string [] localNames, string namespaceUri)
-               {
-                       if (localNames == null)
-                               throw new ArgumentNullException ("localNames");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       if (NamespaceURI != namespaceUri)
-                               return -1;
-                       for (int i = 0; i < localNames.Length; i++)
-                               if (localNames [i] == LocalName)
-                                       return i;
-                       return -1;
-               }
-
-               public virtual int IndexOfLocalName (
-                       XmlDictionaryString [] localNames,
-                       XmlDictionaryString namespaceUri)
-               {
-                       if (localNames == null)
-                               throw new ArgumentNullException ("localNames");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       if (NamespaceURI != namespaceUri.Value)
-                               return -1;
-                       XmlDictionaryString localName;
-                       if (!TryGetLocalNameAsDictionaryString (out localName))
-                               return -1;
-                       IXmlDictionary dict = localName.Dictionary;
-                       XmlDictionaryString iter;
-                       for (int i = 0; i < localNames.Length; i++)
-                               if (dict.TryLookup (localNames [i], out iter) && object.ReferenceEquals (iter, localName))
-                                       return i;
-                       return -1;
-               }
-
-               public virtual bool IsArray (out Type type)
-               {
-                       type = null;
-                       return false;
-               }
-
-               public virtual bool IsLocalName (string localName)
-               {
-                       return LocalName == localName;
-               }
-
-               public virtual bool IsLocalName (XmlDictionaryString localName)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       return LocalName == localName.Value;
-               }
-
-               public virtual bool IsNamespaceUri (string namespaceUri)
-               {
-                       return NamespaceURI == namespaceUri;
-               }
-
-               public virtual bool IsNamespaceUri (XmlDictionaryString namespaceUri)
-               {
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       return NamespaceURI == namespaceUri.Value;
-               }
-
-               public virtual bool IsStartArray (out Type type)
-               {
-                       type = null;
-                       return false;
-               }
-
-               public virtual bool IsStartElement (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       return IsStartElement (localName.Value, namespaceUri.Value);
-               }
-
-               protected bool IsTextNode (XmlNodeType nodeType)
-               {
-                       switch (nodeType) {
-                       case XmlNodeType.Attribute: // wow, it isn't indeed.
-                       case XmlNodeType.Text:
-                       case XmlNodeType.CDATA:
-                       case XmlNodeType.Whitespace:
-                       case XmlNodeType.SignificantWhitespace:
-                               return true;
-                       default:
-                               return false;
-                       }
-               }
-
-               XmlException XmlError (string message)
-               {
-                       IXmlLineInfo li = this as IXmlLineInfo;
-                       if (li == null || !li.HasLineInfo ())
-                               return new XmlException (message);
-                       else
-                               return new XmlException (String.Format ("{0} in {1} , at ({2},{3})", message, BaseURI, li.LineNumber, li.LinePosition));
-               }
-
-               public virtual void MoveToStartElement ()
-               {
-                       MoveToContent ();
-                       if (NodeType != XmlNodeType.Element)
-                               throw XmlError (String.Format ("Element node is expected, but got {0} node.", NodeType));
-               }
-
-               public virtual void MoveToStartElement (string name)
-               {
-                       if (name == null)
-                               throw new ArgumentNullException ("name");
-                       MoveToStartElement ();
-                       if (Name != name)
-                               throw XmlError (String.Format ("Element node '{0}' is expected, but got '{1}' element.", name, Name));
-               }
-
-               public virtual void MoveToStartElement (
-                       string localName, string namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       MoveToStartElement ();
-                       if (LocalName != localName || NamespaceURI != namespaceUri)
-                               throw XmlError (String.Format ("Element node '{0}' in namespace '{1}' is expected, but got '{2}' in namespace '{3}' element.", localName, namespaceUri, LocalName, NamespaceURI));
-               }
-
-               public virtual void MoveToStartElement (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       MoveToStartElement (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual void StartCanonicalization (
-                       Stream stream, bool includeComments,
-                       string [] inclusivePrefixes)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public virtual bool TryGetArrayLength (out int count)
-               {
-                       count = -1;
-                       return false;
-               }
-
-               public virtual bool TryGetBase64ContentLength (out int count)
-               {
-                       count = -1;
-                       return false;
-               }
-
-               public virtual bool TryGetLocalNameAsDictionaryString (
-                       out XmlDictionaryString localName)
-               {
-                       localName = null;
-                       return false;
-               }
-
-               public virtual bool TryGetNamespaceUriAsDictionaryString (
-                       out XmlDictionaryString namespaceUri)
-               {
-                       namespaceUri = null;
-                       return false;
-               }
-
-               #region Content Reader Methods
-
-               public override object ReadContentAs (Type type, IXmlNamespaceResolver nsResolver)
-               {
-                       return base.ReadContentAs (type, nsResolver);
-               }
-
-               public virtual byte [] ReadContentAsBase64 ()
-               {
-                       int len;
-                       if (!TryGetBase64ContentLength (out len))
-                               return Convert.FromBase64String (ReadContentAsString ());
-                       byte [] bytes = new byte [len];
-                       ReadContentAsBase64 (bytes, 0, len);
-                       return bytes;
-               }
-
-               MethodInfo xmlconv_from_bin_hex = typeof (XmlConvert).GetMethod ("FromBinHexString", BindingFlags.Static | BindingFlags.NonPublic, null, new Type [] {typeof (string)}, null);
-
-               byte [] FromBinHexString (string s)
-               {
-                       return (byte []) xmlconv_from_bin_hex.Invoke (null, new object [] {s});
-               }
-
-               public virtual byte [] ReadContentAsBinHex ()
-               {
-                       int len;
-                       if (!TryGetArrayLength (out len))
-                               return FromBinHexString (ReadContentAsString ());
-                       return ReadContentAsBinHex (len);
-               }
-
-               protected byte [] ReadContentAsBinHex (int maxByteArrayContentLength)
-               {
-                       byte [] bytes = new byte [maxByteArrayContentLength];
-                       ReadContentAsBinHex (bytes, 0, maxByteArrayContentLength);
-                       return bytes;
-               }
-
-               [MonoTODO]
-               public virtual int ReadContentAsChars (char [] chars, int offset, int count)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override decimal ReadContentAsDecimal ()
-               {
-                       return base.ReadContentAsDecimal ();
-               }
-
-               public override float ReadContentAsFloat ()
-               {
-                       return base.ReadContentAsFloat ();
-               }
-
-               public virtual Guid ReadContentAsGuid ()
-               {
-                       return XmlConvert.ToGuid (ReadContentAsString ());
-               }
-
-               public virtual void ReadContentAsQualifiedName (out string localName, out string namespaceUri)
-               {
-                       XmlQualifiedName qname = (XmlQualifiedName) ReadContentAs (typeof (XmlQualifiedName), this as IXmlNamespaceResolver);
-                       localName = qname.Name;
-                       namespaceUri = qname.Namespace;
-               }
-
-               public override string ReadContentAsString ()
-               {
-                       return ReadContentAsString (Quotas.MaxStringContentLength);
-               }
-
-               [MonoTODO]
-               protected string ReadContentAsString (int maxStringContentLength)
-               {
-                       return base.ReadContentAsString ();
-               }
-
-               [MonoTODO ("there is exactly no information on the web")]
-               public virtual string ReadContentAsString (string [] strings, out int index)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO ("there is exactly no information on the web")]
-               public virtual string ReadContentAsString (XmlDictionaryString [] strings, out int index)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public virtual TimeSpan ReadContentAsTimeSpan ()
-               {
-                       return XmlConvert.ToTimeSpan (ReadContentAsString ());
-               }
-
-               public virtual UniqueId ReadContentAsUniqueId ()
-               {
-                       return new UniqueId (ReadContentAsString ());
-               }
-
-               public virtual byte [] ReadElementContentAsBase64 ()
-               {
-                       ReadStartElement ();
-                       byte [] ret = ReadContentAsBase64 ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public virtual byte [] ReadElementContentAsBinHex ()
-               {
-                       ReadStartElement ();
-                       byte [] ret = ReadContentAsBinHex ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public virtual Guid ReadElementContentAsGuid ()
-               {
-                       ReadStartElement ();
-                       Guid ret = ReadContentAsGuid ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public virtual TimeSpan ReadElementContentAsTimeSpan ()
-               {
-                       ReadStartElement ();
-                       TimeSpan ret = ReadContentAsTimeSpan ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public virtual UniqueId ReadElementContentAsUniqueId ()
-               {
-                       ReadStartElement ();
-                       UniqueId ret = ReadContentAsUniqueId ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override string ReadElementContentAsString ()
-               {
-                       if (IsEmptyElement) {
-                               Read ();
-                               return String.Empty;
-                       } else {
-                               ReadStartElement ();
-                               string s;
-                               if (NodeType == XmlNodeType.EndElement)
-                                       s = String.Empty;
-                               else
-                                       s = ReadContentAsString ();
-                               ReadEndElement ();
-                               return s;
-                       }
-               }
-
-               public virtual void ReadFullStartElement ()
-               {
-                       if (!IsStartElement ())
-                               throw new XmlException ("Current node is not a start element");
-                       ReadStartElement ();
-               }
-
-               public virtual void ReadFullStartElement (string name)
-               {
-                       if (!IsStartElement (name))
-                               throw new XmlException (String.Format ("Current node is not a start element '{0}'", name));
-                       ReadStartElement (name);
-               }
-
-               public virtual void ReadFullStartElement (string localName, string namespaceUri)
-               {
-                       if (!IsStartElement (localName, namespaceUri))
-                               throw new XmlException (String.Format ("Current node is not a start element '{0}' in namesapce '{1}'", localName, namespaceUri));
-                       ReadStartElement (localName, namespaceUri);
-               }
-
-               public virtual void ReadFullStartElement (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (!IsStartElement (localName, namespaceUri))
-                               throw new XmlException (String.Format ("Current node is not a start element '{0}' in namesapce '{1}'", localName, namespaceUri));
-                       ReadStartElement (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual void ReadStartElement (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       ReadStartElement (localName.Value, namespaceUri.Value);
-               }
-
-               public override string ReadString ()
-               {
-                       return ReadString (Quotas.MaxStringContentLength);
-               }
-
-               [MonoTODO]
-               protected string ReadString (int maxStringContentLength)
-               {
-                       return base.ReadString ();
-               }
-
-               public virtual int ReadValueAsBase64 (byte [] bytes, int start, int length)
-               {
-                       throw new NotSupportedException (); // as it is documented ...
-               }
-
-               public virtual bool TryGetValueAsDictionaryString (out XmlDictionaryString value)
-               {
-                       throw new NotSupportedException (); // as documented
-               }
-
-               #endregion
-
-               #region Factory Methods
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       byte [] buffer, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateBinaryReader (buffer, 0, buffer.Length, quotas);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       byte [] buffer, int offset, int count, 
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateBinaryReader (buffer, offset, count, new XmlDictionary (), quotas);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       byte [] buffer, int offset, int count,
-                       IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateBinaryReader (buffer, offset, count,
-                               dictionary, quotas,
-                               new XmlBinaryReaderSession (), null);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       byte [] buffer, int offset, int count,
-                       IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quotas,
-                       XmlBinaryReaderSession session)
-               {
-                       return CreateBinaryReader (buffer, offset, count,
-                               dictionary, quotas,
-                               session, null);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       byte [] buffer, int offset, int count,
-                       IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quotas,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       return new XmlBinaryDictionaryReader (buffer,
-                               offset, count,
-                               dictionary, quotas, session, onClose);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       Stream stream, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateBinaryReader (stream, new XmlDictionary (), quotas);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       Stream stream, IXmlDictionary dictionary, 
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateBinaryReader (stream, dictionary, quotas,
-                               new XmlBinaryReaderSession (), null);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       Stream stream, IXmlDictionary dictionary, 
-                       XmlDictionaryReaderQuotas quotas,
-                       XmlBinaryReaderSession session)
-               {
-                       return CreateBinaryReader (stream, dictionary, quotas,
-                               session, null);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       Stream stream, IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quotas,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       return new XmlBinaryDictionaryReader (stream,
-                               dictionary, quotas, session, onClose);
-               }
-
-               public static XmlDictionaryReader CreateDictionaryReader (
-                       XmlReader reader)
-               {
-                       return new XmlSimpleDictionaryReader (reader);
-               }
-
-#if !NET_2_1
-               public static XmlDictionaryReader CreateMtomReader (
-                       Stream stream, Encoding encoding,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return new XmlMtomDictionaryReader (stream, encoding, quotas);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       Stream stream, Encoding [] encodings,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateMtomReader (stream, encodings, null, quotas);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       Stream stream, Encoding [] encodings, string contentType,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateMtomReader (stream, encodings, contentType, quotas, int.MaxValue, null);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       Stream stream, Encoding [] encodings, string contentType,
-                       XmlDictionaryReaderQuotas quotas,
-                       int maxBufferSize,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       return new XmlMtomDictionaryReader (stream, encodings, contentType, quotas, maxBufferSize, onClose);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       byte [] buffer, int offset, int count,
-                       Encoding encoding, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateMtomReader (new MemoryStream (buffer, offset, count), encoding, quotas);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       byte [] buffer, int offset, int count,
-                       Encoding [] encodings, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateMtomReader (new MemoryStream (buffer, offset, count), encodings, quotas);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       byte [] buffer, int offset, int count,
-                       Encoding [] encodings, string contentType,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateMtomReader (new MemoryStream (buffer, offset, count), encodings, contentType, quotas);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       byte [] buffer, int offset, int count,
-                       Encoding [] encodings, string contentType,
-                       XmlDictionaryReaderQuotas quotas,
-                       int maxBufferSize,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       return CreateMtomReader (new MemoryStream (buffer, offset, count), encodings, contentType, quotas, maxBufferSize, onClose);
-               }
-#endif
-
-               public static XmlDictionaryReader CreateTextReader (byte [] buffer, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateTextReader (buffer, 0, buffer.Length, quotas);
-               }
-
-               public static XmlDictionaryReader CreateTextReader (
-                       byte [] buffer, int offset, int count,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateTextReader (buffer, offset, count,
-                               Encoding.UTF8, quotas, null);
-               }
-
-               public static XmlDictionaryReader CreateTextReader (
-                       byte [] buffer, int offset, int count,
-                       Encoding encoding,
-                       XmlDictionaryReaderQuotas quotas,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       return CreateTextReader (new MemoryStream (buffer, offset, count), encoding, quotas, onClose);
-               }
-
-               public static XmlDictionaryReader CreateTextReader (
-                       Stream stream, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateTextReader (stream, Encoding.UTF8, quotas, null);
-               }
-
-               public static XmlDictionaryReader CreateTextReader (
-                       Stream stream, Encoding encoding,
-                       XmlDictionaryReaderQuotas quotas,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       XmlReaderSettings s = new XmlReaderSettings ();
-                       XmlNameTable nt = new NameTable ();
-                       XmlParserContext c = new XmlParserContext (nt, new XmlNamespaceManager (nt), String.Empty, XmlSpace.None, encoding);
-                       XmlDictionaryReader res = new XmlSimpleDictionaryReader (XmlReader.Create (stream, s, c), null, onClose);
-                       res.quotas = quotas;
-                       return res;
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReaderAutoGen.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReaderAutoGen.cs
deleted file mode 100644 (file)
index 46c8456..0000000
+++ /dev/null
@@ -1,522 +0,0 @@
-
-#pragma warning disable 612
-using System;
-using System.Collections.Generic;
-
-namespace System.Xml
-{
-       public abstract partial class XmlDictionaryReader : XmlReader
-       {
-               static readonly char [] wsChars = new char [] {' ', '\t', '\n', '\r'};
-
-               void CheckReadArrayArguments (Array array, int offset, int length)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException ("array");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException ("offset is negative");
-                       if (offset > array.Length)
-                               throw new ArgumentOutOfRangeException ("offset exceeds the length of the destination array");
-                       if (length < 0)
-                               throw new ArgumentOutOfRangeException ("length is negative");
-                       if (length > array.Length - offset)
-                               throw new ArgumentOutOfRangeException ("length + offset exceeds the length of the destination array");
-               }
-
-               void CheckDictionaryStringArgs (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-               }
-
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, bool [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, bool [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToBoolean (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual bool [] ReadBooleanArray (string localName, string namespaceUri)
-               {
-                       List<bool> list = new List<bool> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToBoolean (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual bool [] ReadBooleanArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadBooleanArray (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, DateTime [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, DateTime [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToDateTime (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual DateTime [] ReadDateTimeArray (string localName, string namespaceUri)
-               {
-                       List<DateTime> list = new List<DateTime> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToDateTime (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual DateTime [] ReadDateTimeArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadDateTimeArray (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, decimal [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, decimal [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToDecimal (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual decimal [] ReadDecimalArray (string localName, string namespaceUri)
-               {
-                       List<decimal> list = new List<decimal> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToDecimal (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual decimal [] ReadDecimalArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadDecimalArray (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, double [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, double [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToDouble (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual double [] ReadDoubleArray (string localName, string namespaceUri)
-               {
-                       List<double> list = new List<double> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToDouble (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual double [] ReadDoubleArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadDoubleArray (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, Guid [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, Guid [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToGuid (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual Guid [] ReadGuidArray (string localName, string namespaceUri)
-               {
-                       List<Guid> list = new List<Guid> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToGuid (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual Guid [] ReadGuidArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadGuidArray (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, short [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, short [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToInt16 (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual short [] ReadInt16Array (string localName, string namespaceUri)
-               {
-                       List<short> list = new List<short> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToInt16 (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual short [] ReadInt16Array (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadInt16Array (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, int [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, int [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToInt32 (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual int [] ReadInt32Array (string localName, string namespaceUri)
-               {
-                       List<int> list = new List<int> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToInt32 (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual int [] ReadInt32Array (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadInt32Array (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, long [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, long [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToInt64 (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual long [] ReadInt64Array (string localName, string namespaceUri)
-               {
-                       List<long> list = new List<long> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToInt64 (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual long [] ReadInt64Array (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadInt64Array (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, float [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, float [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToSingle (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual float [] ReadSingleArray (string localName, string namespaceUri)
-               {
-                       List<float> list = new List<float> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToSingle (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual float [] ReadSingleArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadSingleArray (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, TimeSpan [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToTimeSpan (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual TimeSpan [] ReadTimeSpanArray (string localName, string namespaceUri)
-               {
-                       List<TimeSpan> list = new List<TimeSpan> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToTimeSpan (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual TimeSpan [] ReadTimeSpanArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadTimeSpanArray (localName.Value, namespaceUri.Value);
-               }
-
-               public override bool ReadElementContentAsBoolean ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       bool ret = ReadContentAsBoolean ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override DateTime ReadElementContentAsDateTime ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       DateTime ret = ReadContentAsDateTime ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override decimal ReadElementContentAsDecimal ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       decimal ret = ReadContentAsDecimal ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override double ReadElementContentAsDouble ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       double ret = ReadContentAsDouble ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override float ReadElementContentAsFloat ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       float ret = ReadContentAsFloat ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override int ReadElementContentAsInt ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       int ret = ReadContentAsInt ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override long ReadElementContentAsLong ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       long ret = ReadContentAsLong ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReaderQuotas.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReaderQuotas.cs
deleted file mode 100644 (file)
index 1a8ad4a..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// XmlDictionaryReaderQuotas.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Xml
-{
-       public sealed class XmlDictionaryReaderQuotas
-       {
-               static XmlDictionaryReaderQuotas max;
-
-               static XmlDictionaryReaderQuotas ()
-               {
-                       max = new XmlDictionaryReaderQuotas (true);
-               }
-
-               readonly bool is_readonly;
-               int array_len, bytes, depth, nt_chars, text_len;
-
-               public XmlDictionaryReaderQuotas ()
-                       : this (false)
-               {
-               }
-
-               private XmlDictionaryReaderQuotas (bool max)
-               {
-                       is_readonly = max;
-                       array_len = max ? int.MaxValue : 0x4000;
-                       bytes = max ? int.MaxValue : 0x1000;
-                       depth = max ? int.MaxValue : 0x20;
-                       nt_chars = max ? int.MaxValue : 0x4000;
-                       text_len = max ? int.MaxValue : 0x2000;
-               }
-
-               public static XmlDictionaryReaderQuotas Max {
-                       get { return max; }
-               }
-
-               public int MaxArrayLength {
-                       get { return array_len; }
-                       set { array_len = Check (value); }
-               }
-
-               public int MaxBytesPerRead {
-                       get { return bytes; }
-                       set { bytes = Check (value); }
-               }
-
-               public int MaxDepth {
-                       get { return depth; }
-                       set { depth = Check (value); }
-               }
-
-               public int MaxNameTableCharCount {
-                       get { return nt_chars; }
-                       set { nt_chars = Check (value); }
-               }
-
-               public int MaxStringContentLength {
-                       get { return text_len; }
-                       set { text_len = Check (value); }
-               }
-
-               private int Check (int value)
-               {
-                       if (is_readonly)
-                               throw new InvalidOperationException ("This quota is read-only.");
-                       if (value <= 0)
-                               throw new ArgumentException ("Value must be positive integer.");
-                       return value;
-               }
-
-               public void CopyTo (XmlDictionaryReaderQuotas quota)
-               {
-                       quota.array_len = array_len;
-                       quota.bytes = bytes;
-                       quota.depth = depth;
-                       quota.nt_chars = nt_chars;
-                       quota.text_len = text_len;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryString.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryString.cs
deleted file mode 100644 (file)
index 374b451..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// XmlDictionaryString.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
-       public class XmlDictionaryString
-       {
-               static XmlDictionaryString empty = new XmlDictionaryString (
-                       XmlDictionary.EmptyDictionary.Instance,
-                       String.Empty, 0);
-
-               public static XmlDictionaryString Empty {
-                       get { return empty; }
-               }
-
-               readonly IXmlDictionary dict;
-               readonly string value;
-               readonly int key;
-
-               public XmlDictionaryString (IXmlDictionary dictionary,
-                       string value, int key)
-               {
-                       if (dictionary == null)
-                               throw new ArgumentNullException ("dictionary");
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-                       if (key < 0 || key > (int.MaxValue/4))
-                               throw new ArgumentOutOfRangeException ("key");
-                       this.dict = dictionary;
-                       this.value = value;
-                       this.key = key;
-               }
-
-               public IXmlDictionary Dictionary {
-                       get { return dict; }
-               }
-
-               public int Key {
-                       get { return key; }
-               }
-
-               public string Value {
-                       get { return value; }
-               }
-
-               public override string ToString ()
-               {
-                       return value;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriter.cs
deleted file mode 100644 (file)
index 6e909a8..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-//
-// XmlDictionaryWriter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
-       public abstract partial class XmlDictionaryWriter : XmlWriter
-       {
-               static readonly Encoding utf8_unmarked = new UTF8Encoding (false);
-
-               protected XmlDictionaryWriter ()
-               {
-               }
-
-               internal int Depth { get; set; }
-
-               internal int NSIndex { get; set; }
-
-               public virtual bool CanCanonicalize {
-                       get { return false; }
-               }
-
-               public static XmlDictionaryWriter CreateBinaryWriter (
-                       Stream stream)
-               {
-                       return CreateBinaryWriter (stream, null, null, false);
-               }
-
-               public static XmlDictionaryWriter CreateBinaryWriter (
-                       Stream stream, IXmlDictionary dictionary)
-               {
-                       return CreateBinaryWriter (stream, dictionary, null, false);
-               }
-
-               public static XmlDictionaryWriter CreateBinaryWriter (
-                       Stream stream, IXmlDictionary dictionary,
-                       XmlBinaryWriterSession session)
-               {
-                       return CreateBinaryWriter (stream, dictionary, session, false);
-               }
-
-               public static XmlDictionaryWriter CreateBinaryWriter (
-                       Stream stream, IXmlDictionary dictionary,
-                       XmlBinaryWriterSession session, bool ownsStream)
-               {
-                       return new XmlBinaryDictionaryWriter (stream,
-                               dictionary, session, ownsStream);
-               }
-
-               public static XmlDictionaryWriter CreateDictionaryWriter (XmlWriter writer)
-               {
-                       return new XmlSimpleDictionaryWriter (writer);
-               }
-#if !NET_2_1
-               public static XmlDictionaryWriter CreateMtomWriter (
-                       Stream stream, Encoding encoding, int maxSizeInBytes,
-                       string startInfo)
-               {
-                       return CreateMtomWriter (stream, encoding,
-                               maxSizeInBytes, startInfo, Guid.NewGuid () + "id=1", "http://tempuri.org/0/" + DateTime.Now.Ticks, true, false);
-               }
-
-               public static XmlDictionaryWriter CreateMtomWriter (
-                       Stream stream, Encoding encoding, int maxSizeInBytes,
-                       string startInfo, string boundary, string startUri,
-                       bool writeMessageHeaders, bool ownsStream)
-               {
-                       return new XmlMtomDictionaryWriter (stream, encoding, maxSizeInBytes, startInfo, boundary, startUri, writeMessageHeaders, ownsStream);
-               }
-#endif
-               public static XmlDictionaryWriter CreateTextWriter (
-                       Stream stream)
-               {
-                       return CreateTextWriter (stream, Encoding.UTF8);
-               }
-
-               public static XmlDictionaryWriter CreateTextWriter (
-                       Stream stream, Encoding encoding)
-               {
-                       return CreateTextWriter (stream, encoding, false);
-               }
-
-               // BTW looks like it creates an instance of different
-               // implementation than those from XmlWriter.Create().
-               public static XmlDictionaryWriter CreateTextWriter (
-                       Stream stream, Encoding encoding, bool ownsStream)
-               {
-                       if (stream == null)
-                               throw new ArgumentNullException ("stream");
-                       if (encoding == null)
-                               throw new ArgumentNullException ("encoding");
-
-                       switch (encoding.CodePage) {
-                       case 1200:
-                       case 1201: // utf-16
-                       case 65001: // utf-8
-                               encoding = utf8_unmarked;
-                               break;
-                       default:
-                               throw new XmlException (String.Format ("XML declaration is required for encoding code page {0} but this XmlWriter does not support XML declaration.", encoding.CodePage));
-                       }
-
-                       XmlWriterSettings s = new XmlWriterSettings ();
-                       s.Encoding = encoding;
-                       s.CloseOutput = ownsStream;
-                       s.OmitXmlDeclaration = true;
-                       return CreateDictionaryWriter (XmlWriter.Create (stream, s));
-               }
-
-               
-
-               public virtual void EndCanonicalization ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public virtual void StartCanonicalization (
-                       Stream stream, bool includeComments,
-                       string [] inclusivePrefixes)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void WriteAttributeString (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri,
-                       string value)
-               {
-                       WriteAttributeString (null, localName, namespaceUri, value);
-               }
-
-               public void WriteAttributeString (string prefix,
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri,
-                       string value)
-               {
-                       WriteStartAttribute (prefix, localName, namespaceUri);
-                       WriteString (value);
-                       WriteEndAttribute ();
-               }
-
-               public void WriteElementString (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri,
-                       string value)
-               {
-                       WriteElementString (null, localName, namespaceUri, value);
-               }
-
-               public void WriteElementString (string prefix,
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri,
-                       string value)
-               {
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteString (value);
-                       WriteEndElement ();
-               }
-
-               public virtual void WriteNode (XmlDictionaryReader reader,
-                       bool defattr)
-               {
-                       if (reader == null)
-                               throw new ArgumentNullException ("reader");
-
-                       if (reader.ReadState == ReadState.Initial)
-                               reader.Read ();
-                       
-                       switch (reader.NodeType) {
-                       case XmlNodeType.Element:
-                               // gratuitously copied from System.XML/System.Xml/XmlWriter.cs:WriteNode(XmlReader,bool)
-                               // as there doesn't seem to be a way to hook into attribute writing w/o handling Element.
-                               XmlDictionaryString ename, ens;
-                               if (reader.TryGetLocalNameAsDictionaryString (out ename) && reader.TryGetLocalNameAsDictionaryString (out ens))
-                                       WriteStartElement (reader.Prefix, ename, ens);
-                               else
-                                       WriteStartElement (reader.Prefix, reader.LocalName, reader.NamespaceURI);
-                               // Well, I found that MS.NET took this way, since
-                               // there was a error-prone SgmlReader that fails
-                               // MoveToNextAttribute().
-                               if (reader.HasAttributes) {
-                                       for (int i = 0; i < reader.AttributeCount; i++) {
-                                               reader.MoveToAttribute (i);
-                                               WriteAttribute (reader, defattr);
-                                       }
-                                       reader.MoveToElement ();
-                               }
-                               if (reader.IsEmptyElement)
-                                       WriteEndElement ();
-                               else {
-                                       int depth = reader.Depth;
-                                       reader.Read ();
-                                       if (reader.NodeType != XmlNodeType.EndElement) {
-                                               do {
-                                                       WriteNode (reader, defattr);
-                                               } while (depth < reader.Depth);
-                                       }
-                                       WriteFullEndElement ();
-                               }
-                               reader.Read ();
-                               break;
-                       case XmlNodeType.Attribute:
-                       case XmlNodeType.Text:
-                               WriteTextNode (reader, defattr);
-                               break;
-                       default:
-                               base.WriteNode (reader, defattr);
-                               break;
-                       }
-               }
-
-               private void WriteAttribute (XmlDictionaryReader reader, bool defattr)
-               {
-                       if (!defattr && reader.IsDefault)
-                               return;
-
-                       XmlDictionaryString name, ns;
-                       if (reader.TryGetLocalNameAsDictionaryString (out name) && reader.TryGetLocalNameAsDictionaryString (out ns))
-                               WriteStartAttribute (reader.Prefix, name, ns);
-                       else
-                               WriteStartAttribute (reader.Prefix, reader.LocalName, reader.NamespaceURI);
-#if NET_2_1
-                       // no ReadAttributeValue() in 2.1 profile.
-                       WriteTextNode (reader, true);
-#else
-                       while (reader.ReadAttributeValue ()) {
-                               switch (reader.NodeType) {
-                               case XmlNodeType.Text:
-                                       WriteTextNode (reader, true);
-                                       break;
-                               case XmlNodeType.EntityReference:
-                                       WriteEntityRef (reader.Name);
-                                       break;
-                               }
-                       }
-#endif
-                       WriteEndAttribute ();
-               }
-
-               public override void WriteNode (XmlReader reader, bool defattr)
-               {
-                       if (reader == null)
-                               throw new ArgumentNullException ("reader");
-
-                       XmlDictionaryReader dr = reader as XmlDictionaryReader;
-                       if (dr != null)
-                               WriteNode (dr, defattr);
-                       else
-                               base.WriteNode (reader, defattr);
-               }
-
-               public virtual void WriteQualifiedName (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       WriteQualifiedName (localName.Value, namespaceUri.Value);
-               }
-
-               public void WriteStartAttribute (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       WriteStartAttribute (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual void WriteStartAttribute (string prefix,
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       WriteStartAttribute (prefix, localName.Value, namespaceUri.Value);
-               }
-
-               public void WriteStartElement (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       WriteStartElement (null, localName, namespaceUri);
-               }
-
-               public virtual void WriteStartElement (string prefix,
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentException ("localName must not be null.", "localName");
-                       WriteStartElement (prefix, localName.Value,
-                                       namespaceUri != null ? namespaceUri.Value : null);
-               }
-
-               public virtual void WriteString (XmlDictionaryString value)
-               {
-                       WriteString (value.Value);
-               }
-
-               protected virtual void WriteTextNode (XmlDictionaryReader reader, bool isAttribute)
-               {
-                       WriteString (reader.Value);
-                       if (!isAttribute)
-                               reader.Read ();
-               }
-
-               public virtual void WriteValue (Guid guid)
-               {
-                       WriteString (guid.ToString ());
-               }
-
-               public virtual void WriteValue (IStreamProvider value)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-
-                       Stream stream = value.GetStream ();
-                       byte[] buf = new byte [Math.Min (2048, stream.CanSeek ? stream.Length : 2048)];
-                       int read;
-                       while ((read = stream.Read (buf, 0, buf.Length)) > 0) {
-                               WriteBase64 (buf, 0, read);
-                       }
-                       value.ReleaseStream (stream);
-               }
-
-               public virtual void WriteValue (TimeSpan duration)
-               {
-                       WriteString (XmlConvert.ToString (duration));
-               }
-
-               public virtual void WriteValue (UniqueId id)
-               {
-                       if (id == null)
-                               throw new ArgumentNullException ("id");
-                       WriteString (id.ToString ());
-               }
-
-               public virtual void WriteValue (XmlDictionaryString value)
-               {
-                       WriteValue (value.Value);
-               }
-
-               public virtual void WriteXmlAttribute (string localName, string value)
-               {
-                       WriteAttributeString ("xml", localName, "http://www.w3.org/XML/1998/namespace", value);
-               }
-
-               public virtual void WriteXmlAttribute (XmlDictionaryString localName,
-                       XmlDictionaryString value)
-               {
-                       WriteXmlAttribute (localName.Value, value.Value);
-               }
-
-               public virtual void WriteXmlnsAttribute (
-                       string prefix, string namespaceUri)
-               {
-                       // BTW .NET 2.0 those XmlWriters from XmlWrite.Create()
-                       // rejects namespace overriding i.e.
-                       //
-                       //      xw.WriteStartElement ("foo", "urn:foo");
-                       //      xw.WriteXmlnsAttribute ("foo", "urn:bar");
-                       //
-                       // causes an XmlException. We need fix in sys.xml.dll
-
-                       // When the prefix is null, this writer must mock
-                       // a dummy namespace up. It is then up to the actual
-                       // writer how it is determined in the output. (When
-                       // there is a duplicate, then it will be further 
-                       // modified.)
-                       if (prefix == null && String.IsNullOrEmpty (namespaceUri))
-                               prefix = String.Empty;
-                       else if (prefix == null)
-                               prefix = "d" + Depth + "p" + (++NSIndex);
-
-                       if (prefix == String.Empty)
-                               WriteAttributeString ("xmlns", namespaceUri);
-                       else
-                               WriteAttributeString ("xmlns", prefix, "http://www.w3.org/2000/xmlns/", namespaceUri);
-               }
-
-               public virtual void WriteXmlnsAttribute (string prefix,
-                       XmlDictionaryString namespaceUri)
-               {
-                       WriteXmlnsAttribute (prefix, namespaceUri.Value);
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriterAutoGen.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriterAutoGen.cs
deleted file mode 100644 (file)
index 76bc185..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-
-using System;
-
-namespace System.Xml
-{
-       public abstract partial class XmlDictionaryWriter : XmlWriter
-       {
-               void CheckWriteArrayArguments (Array array, int offset, int length)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException ("array");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException ("offset is negative");
-                       if (offset > array.Length)
-                               throw new ArgumentOutOfRangeException ("offset exceeds the length of the destination array");
-                       if (length < 0)
-                               throw new ArgumentOutOfRangeException ("length is negative");
-                       if (length > array.Length - offset)
-                               throw new ArgumentOutOfRangeException ("length + offset exceeds the length of the destination array");
-               }
-
-               void CheckDictionaryStringArgs (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-               }
-
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, bool [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, bool [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, DateTime [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, DateTime [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, decimal [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, decimal [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, double [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, double [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Guid [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, Guid [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, short [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, short [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, int [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, int [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, long [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, long [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, float [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, float [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, TimeSpan [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlMtomDictionaryReader.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlMtomDictionaryReader.cs
deleted file mode 100644 (file)
index b2ca93c..0000000
+++ /dev/null
@@ -1,630 +0,0 @@
-//
-// XmlMtomDictionaryReader.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2009 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Net.Mime;
-using System.Reflection;
-using System.Text;
-using System.Xml;
-
-namespace System.Xml
-{
-       internal class XmlMtomDictionaryReader : XmlDictionaryReader
-       {
-               public XmlMtomDictionaryReader (
-                       Stream stream, Encoding encoding,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       this.stream = stream;
-                       this.encoding = encoding;
-                       this.quotas = quotas;
-
-                       Initialize ();
-               }
-
-               public XmlMtomDictionaryReader (
-                       Stream stream, Encoding [] encodings, string contentType,
-                       XmlDictionaryReaderQuotas quotas,
-                       int maxBufferSize,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       this.stream = stream;
-                       this.encodings = encodings;
-                       content_type = contentType != null ? CreateContentType (contentType) : null;
-                       this.quotas = quotas;
-                       this.max_buffer_size = maxBufferSize;
-                       on_close = onClose;
-
-                       Initialize ();
-               }
-
-               Stream stream;
-               Encoding encoding;
-               Encoding [] encodings;
-               ContentType content_type;
-               XmlDictionaryReaderQuotas quotas;
-               int max_buffer_size;
-               OnXmlDictionaryReaderClose on_close;
-
-               Dictionary<string,MimeEncodedStream> readers = new Dictionary<string,MimeEncodedStream> ();
-
-               void Initialize ()
-               {
-                       var nt = new NameTable ();
-                       initial_reader = new NonInteractiveStateXmlReader (String.Empty, nt, ReadState.Initial);
-                       eof_reader = new NonInteractiveStateXmlReader (String.Empty, nt, ReadState.EndOfFile);
-                       xml_reader = initial_reader;
-               }
-
-               ContentType CreateContentType (string contentTypeString)
-               {
-                       ContentType c = null;
-                       foreach (var s_ in contentTypeString.Split (';')) {
-                               var s = s_.Trim ();
-                               if (c == null) {
-                                       // first one
-                                       c = new ContentType (s);
-                                       continue;
-                               }
-                               int idx = s.IndexOf ('=');
-                               if (idx < 0)
-                                       throw new XmlException ("Invalid content type header");
-                               var val = StripBraces (s.Substring (idx + 1));
-                               c.Parameters [s.Substring (0, idx)] = val;
-                       }
-                       return c;
-               }
-
-               XmlReader xml_reader, initial_reader, eof_reader, part_reader;
-               XmlReader Reader {
-                       get { return part_reader ?? xml_reader; }
-               }
-
-               public override bool EOF {
-                       get { return Reader == eof_reader; }
-               }
-
-               public override void Close ()
-               {
-                       if (!EOF && on_close != null)
-                               on_close (this);
-                       xml_reader = eof_reader;
-               }
-
-               public override bool Read ()
-               {
-                       if (EOF)
-                               return false;
-
-                       if (Reader == initial_reader)
-                               SetupPrimaryReader ();
-
-                       if (part_reader != null)
-                               part_reader = null;
-
-                       if (!Reader.Read ()) {
-                               xml_reader = eof_reader;
-                               return false;
-                       }
-                       if (Reader.LocalName == "Include" && Reader.NamespaceURI == "http://www.w3.org/2004/08/xop/include") {
-                               string cid = Reader.GetAttribute ("href");
-                               if (!cid.StartsWith ("cid:"))
-                                       throw new XmlException ("Cannot resolve non-cid href attribute value in XOP Include element");
-                               cid = cid.Substring (4);
-                               if (!readers.ContainsKey (cid))
-                                       ReadToIdentifiedStream (cid);
-                               part_reader = new MultiPartedXmlReader (Reader, readers [cid]);
-                       }
-                       return true;
-               }
-
-               void SetupPrimaryReader ()
-               {
-                       ReadOptionalMimeHeaders ();
-                       if (current_content_type != null)
-                               content_type = current_content_type;
-
-                       if (content_type == null)
-                               throw new XmlException ("Content-Type header for the MTOM message was not found");
-                       if (content_type.Boundary == null)
-                               throw new XmlException ("Content-Type header for the MTOM message must contain 'boundary' parameter");
-
-                       if (encoding == null && content_type.CharSet != null)
-                               encoding = Encoding.GetEncoding (content_type.CharSet);
-                       if (encoding == null && encodings == null)
-                               throw new XmlException ("Encoding specification is required either in the constructor argument or the content-type header");
-
-                       // consume the first identifier.
-                       string ident = "--" + content_type.Boundary;
-                       string idline;
-
-                       while (true) {
-                               idline = ReadAsciiLine ().Trim ();
-                               if (idline == null)
-                                       return;
-                               if (idline.Length != 0)
-                                       break;
-                       }
-                       if (!idline.StartsWith (ident, StringComparison.Ordinal))
-                               throw new XmlException (String.Format ("Unexpected boundary line was found. Expected boundary is '{0}' but it was '{1}'", content_type.Boundary, idline));
-
-                       string start = content_type.Parameters ["start"];
-                       ReadToIdentifiedStream (start);
-
-                       xml_reader = XmlReader.Create (readers [start].CreateTextReader ());
-               }
-
-               int buffer_length;
-               byte [] buffer;
-               int peek_char;
-
-               ContentType current_content_type;
-               int content_index;
-               string current_content_id, current_content_encoding;
-
-               void ReadToIdentifiedStream (string id)
-               {
-                       while (true) {
-                               if (!ReadNextStream ())
-                                       throw new XmlException (String.Format ("The stream '{0}' did not appear", id));
-                               if (current_content_id == id || id == null)
-                                       break;
-                       }
-               }
-
-               bool ReadNextStream ()
-               {
-                       ReadOptionalMimeHeaders ();
-                       string ident = "--" + content_type.Boundary;
-
-                       StringBuilder sb = new StringBuilder ();
-                       while (true) {
-                               string n = ReadAsciiLine ();
-                               if (n == null && sb.Length == 0)
-                                       return false;
-                               else if (n == null || n.StartsWith (ident, StringComparison.Ordinal))
-                                       break;
-                               sb.Append (n);
-                       }
-                       readers.Add (current_content_id, new MimeEncodedStream (current_content_id, current_content_encoding, sb.ToString ()));
-                       return true;
-               }
-
-               void ReadOptionalMimeHeaders ()
-               {
-                       peek_char = stream.ReadByte ();
-                       if (peek_char == '-') // no header
-                               return;
-                       ReadMimeHeaders ();
-               }
-
-               string ReadAllHeaderLines ()
-               {
-                       string s = String.Empty;
-
-                       while (true) {
-                               var n = ReadAsciiLine ();
-                               if (n.Length == 0)
-                                       return s;
-                               n = n.TrimEnd ();
-                               s += n;
-                               if (n [n.Length - 1] != ';')
-                                       s += '\n';
-                       }
-               }
-
-               void ReadMimeHeaders ()
-               {
-                       foreach (var s in ReadAllHeaderLines ().Split ('\n')) {
-                               if (s.Length == 0)
-                                       continue;
-                               int idx = s.IndexOf (':');
-                               if (idx < 0)
-                                       throw new XmlException (String.Format ("Unexpected header string: {0}", s));
-                               string v = StripBraces (s.Substring (idx + 1).Trim ());
-                               switch (s.Substring (0, idx).ToLower ()) {
-                               case "content-type":
-                                       current_content_type = CreateContentType (v);
-                                       break;
-                               case "content-id":
-                                       current_content_id = v;
-                                       break;
-                               case "content-transfer-encoding":
-                                       current_content_encoding = v;
-                                       break;
-                               }
-                       }
-               }
-
-               string StripBraces (string s)
-               {
-                       // could be foo, <foo>, "foo" and "<foo>".
-                       if (s.Length >= 2 && s [0] == '"' && s [s.Length - 1] == '"')
-                               s = s.Substring (1, s.Length - 2);
-                       if (s.Length >= 2 && s [0] == '<' && s [s.Length - 1] == '>')
-                               s = s.Substring (1, s.Length - 2);
-                       return s;
-               }
-
-               string ReadAsciiLine ()
-               {
-                       if (buffer == null)
-                               buffer = new byte [1024];
-                       int bpos = 0;
-                       int b = peek_char;
-                       bool skipRead = b >= 0;
-                       peek_char = -1;
-                       while (true) {
-                               if (skipRead)
-                                       skipRead = false;
-                               else
-                                       b = stream.ReadByte ();
-                               if (b < 0) {
-                                       if (bpos > 0)
-                                               throw new XmlException ("The stream ends without end of line");
-                                       return null;
-                               }
-                               if (b == '\r') {
-                                       b = stream.ReadByte ();
-                                       if (b < 0) {
-                                               buffer [bpos++] = (byte) '\r';
-                                               break;
-                                       }
-                                       else if (b == '\n')
-                                               break;
-                                       buffer [bpos++] = (byte) '\r';
-                                       skipRead = true;
-                               }
-                               else
-                                       buffer [bpos++] = (byte) b;
-                               if (bpos == buffer.Length) {
-                                       var newbuf = new byte [buffer.Length << 1];
-                                       Array.Copy (buffer, 0, newbuf, 0, buffer.Length);
-                                       buffer = newbuf;
-                               }
-                       }
-                       return Encoding.ASCII.GetString (buffer, 0, bpos);
-               }
-
-               // The rest are just reader delegation.
-
-               public override int AttributeCount {
-                       get { return Reader.AttributeCount; }
-               }
-
-               public override string BaseURI {
-                       get { return Reader.BaseURI; }
-               }
-
-               public override int Depth {
-                       get { return Reader.Depth; }
-               }
-
-               public override bool HasValue {
-                       get { return Reader.HasValue; }
-               }
-
-               public override bool IsEmptyElement {
-                       get { return Reader.IsEmptyElement; }
-               }
-
-               public override string LocalName {
-                       get { return Reader.LocalName; }
-               }
-
-               public override string NamespaceURI {
-                       get { return Reader.NamespaceURI; }
-               }
-
-               public override XmlNameTable NameTable {
-                       get { return Reader.NameTable; }
-               }
-
-               public override XmlNodeType NodeType {
-                       get { return Reader.NodeType; }
-               }
-
-               public override string Prefix {
-                       get { return Reader.Prefix; }
-               }
-
-               public override ReadState ReadState {
-                       get { return Reader.ReadState; }
-               }
-
-               public override string Value {
-                       get { return Reader.Value; }
-               }
-
-               public override bool MoveToElement ()
-               {
-                       return Reader.MoveToElement ();
-               }
-
-               public override string GetAttribute (int index)
-               {
-                       return Reader.GetAttribute (index);
-               }
-
-               public override string GetAttribute (string name)
-               {
-                       return Reader.GetAttribute (name);
-               }
-
-               public override string GetAttribute (string localName, string namespaceURI)
-               {
-                       return Reader.GetAttribute (localName, namespaceURI);
-               }
-
-               public override void MoveToAttribute (int index)
-               {
-                       Reader.MoveToAttribute (index);
-               }
-
-               public override bool MoveToAttribute (string name)
-               {
-                       return Reader.MoveToAttribute (name);
-               }
-
-               public override bool MoveToAttribute (string localName, string namespaceURI)
-               {
-                       return Reader.MoveToAttribute (localName, namespaceURI);
-               }
-
-               public override bool MoveToFirstAttribute ()
-               {
-                       return Reader.MoveToFirstAttribute ();
-               }
-
-               public override bool MoveToNextAttribute ()
-               {
-                       return Reader.MoveToNextAttribute ();
-               }
-
-               public override string LookupNamespace (string prefix)
-               {
-                       return Reader.LookupNamespace (prefix);
-               }
-
-               public override bool ReadAttributeValue ()
-               {
-                       return Reader.ReadAttributeValue ();
-               }
-
-               public override void ResolveEntity ()
-               {
-                       Reader.ResolveEntity ();
-               }
-       }
-
-       class NonInteractiveStateXmlReader : DummyStateXmlReader
-       {
-               public NonInteractiveStateXmlReader (string baseUri, XmlNameTable nameTable, ReadState readState)
-                       : base (baseUri, nameTable, readState)
-               {
-               }
-
-               public override int Depth {
-                       get { return 0; }
-               }
-
-               public override bool HasValue {
-                       get { return false; }
-               }
-
-               public override string Value {
-                       get { return String.Empty; }
-               }
-
-               public override XmlNodeType NodeType {
-                       get { return XmlNodeType.None; }
-               }
-       }
-
-       class MultiPartedXmlReader : DummyStateXmlReader
-       {
-               public MultiPartedXmlReader (XmlReader reader, MimeEncodedStream value)
-                       : base (reader.BaseURI, reader.NameTable, reader.ReadState)
-               {
-                       this.owner = reader;
-                       this.value = value.CreateTextReader ().ReadToEnd ();
-               }
-
-               XmlReader owner;
-               string value;
-
-               public override int Depth {
-                       get { return owner.Depth; }
-               }
-
-               public override bool HasValue {
-                       get { return true; }
-               }
-
-               public override string Value {
-                       get { return value; }
-               }
-
-               public override XmlNodeType NodeType {
-                       get { return XmlNodeType.Text; }
-               }
-       }
-
-       abstract class DummyStateXmlReader : XmlReader
-       {
-               protected DummyStateXmlReader (string baseUri, XmlNameTable nameTable, ReadState readState)
-               {
-                       base_uri = baseUri;
-                       name_table = nameTable;
-                       read_state = readState;
-               }
-
-               string base_uri;
-               XmlNameTable name_table;
-               ReadState read_state;
-
-               public override string BaseURI {
-                       get { return base_uri; }
-               }
-
-               public override bool EOF {
-                       get { return false; }
-               }
-
-               public override void Close ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override bool Read ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               // The rest are just reader delegation.
-
-               public override int AttributeCount {
-                       get { return 0; }
-               }
-
-               public override bool IsEmptyElement {
-                       get { return false; }
-               }
-
-               public override string LocalName {
-                       get { return String.Empty; }
-               }
-
-               public override string NamespaceURI {
-                       get { return String.Empty; }
-               }
-
-               public override XmlNameTable NameTable {
-                       get { return name_table; }
-               }
-
-               public override string Prefix {
-                       get { return String.Empty; }
-               }
-
-               public override ReadState ReadState {
-                       get { return read_state; }
-               }
-
-               public override bool MoveToElement ()
-               {
-                       return false;
-               }
-
-               public override string GetAttribute (int index)
-               {
-                       return null;
-               }
-
-               public override string GetAttribute (string name)
-               {
-                       return null;
-               }
-
-               public override string GetAttribute (string localName, string namespaceURI)
-               {
-                       return null;
-               }
-
-               public override void MoveToAttribute (int index)
-               {
-                       throw new ArgumentOutOfRangeException ();
-               }
-
-               public override bool MoveToAttribute (string name)
-               {
-                       return false;
-               }
-
-               public override bool MoveToAttribute (string localName, string namespaceURI)
-               {
-                       return false;
-               }
-
-               public override bool MoveToFirstAttribute ()
-               {
-                       return false;
-               }
-
-               public override bool MoveToNextAttribute ()
-               {
-                       return false;
-               }
-
-               public override string LookupNamespace (string prefix)
-               {
-                       return null;
-               }
-
-               public override bool ReadAttributeValue ()
-               {
-                       return false;
-               }
-
-               public override void ResolveEntity ()
-               {
-                       throw new InvalidOperationException ();
-               }
-       }
-
-       class MimeEncodedStream
-       {
-               public MimeEncodedStream (string id, string contentEncoding, string value)
-               {
-                       Id = id;
-                       ContentEncoding = contentEncoding;
-                       EncodedString = value;
-               }
-
-               public string Id { get; set; }
-               public string ContentEncoding { get; set; }
-               public string EncodedString { get; set; }
-
-               public string DecodedBase64String {
-                       get { return Convert.ToBase64String (Encoding.ASCII.GetBytes (EncodedString)); }
-               }
-
-               public TextReader CreateTextReader ()
-               {
-                       switch (ContentEncoding) {
-                       case "7bit":
-                       case "8bit":
-                               return new StringReader (EncodedString);
-                       default:
-                               return new StringReader (DecodedBase64String);
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlMtomDictionaryWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlMtomDictionaryWriter.cs
deleted file mode 100644 (file)
index 0d1a081..0000000
+++ /dev/null
@@ -1,316 +0,0 @@
-//
-// XmlMtomDictionaryWriter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2009 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Net.Mime;
-using System.Text;
-
-namespace System.Xml
-{
-       internal class XmlMtomDictionaryWriter : XmlDictionaryWriter
-       {
-               public XmlMtomDictionaryWriter (Stream stream, Encoding encoding, int maxSizeInBytes, string startInfo, string boundary, string startUri, bool writeMessageHeaders, bool ownsStream)
-               {
-                       writer = new StreamWriter (stream, encoding);
-                       max_bytes = maxSizeInBytes;
-                       write_headers = writeMessageHeaders;
-                       owns_stream = ownsStream;
-
-                       var settings = new XmlWriterSettings ();
-                       settings.Encoding = encoding;
-                       settings.OmitXmlDeclaration = true;
-                       settings.ConformanceLevel = ConformanceLevel.Fragment;
-                       settings.NewLineChars = "\r\n";
-                       xml_writer_settings = settings;
-
-                       // FIXME: actually it does not likely use ContentType.ToString() but writes those header items by own.
-                       // (so that it could generate "start" header dynamically)
-                       var c = new ContentType ("multipart/related");
-                       c.Parameters ["type"] = "application/xop+xml";
-                       c.Boundary = boundary;
-                       c.Parameters ["start"] = "<" + startUri + ">";
-                       c.Parameters ["start-info"] = startInfo;
-                       content_type = c;
-               }
-
-               // constructor arguments
-               TextWriter writer;
-               XmlWriterSettings xml_writer_settings;
-               Encoding encoding;
-               int max_bytes;
-               bool write_headers;
-               bool owns_stream;
-               ContentType content_type;
-
-               // state
-               XmlWriter w;
-               int depth;
-               int section_count;
-
-               XmlWriter CreateWriter ()
-               {
-                       return XmlWriter.Create (writer, xml_writer_settings);
-               }
-
-               public override void Close ()
-               {
-                       w.Close ();
-                       if (owns_stream)
-                               writer.Close ();
-               }
-
-               public override void Flush ()
-               {
-                       w.Flush ();
-               }
-
-               public override string LookupPrefix (string namespaceUri)
-               {
-                       return w.LookupPrefix (namespaceUri);
-               }
-
-               public override void WriteBase64 (byte [] bytes, int start, int length)
-               {
-                       CheckState ();
-                       w.WriteBase64 (bytes, start, length);
-               }
-
-               public override void WriteCData (string text)
-               {
-                       CheckState ();
-                       w.WriteCData (text);
-               }
-
-               public override void WriteCharEntity (char c)
-               {
-                       CheckState ();
-                       w.WriteCharEntity (c);
-               }
-
-               public override void WriteChars (char [] buffer, int index, int count)
-               {
-                       CheckState ();
-                       w.WriteChars (buffer, index, count);
-               }
-
-               public override void WriteComment (string comment)
-               {
-                       CheckState ();
-                       w.WriteComment (comment);
-               }
-
-               public override void WriteDocType (string name, string pubid, string sysid, string intSubset)
-               {
-                       throw new NotSupportedException (); // indeed
-               }
-
-               public override void WriteEndAttribute ()
-               {
-                       w.WriteEndAttribute ();
-               }
-
-               public override void WriteEndDocument ()
-               {
-                       // We don't call w.WriteEndElement() because that causes state error
-                       // (which is correct; MTOM writer just does not expect it).
-               }
-
-               public override void WriteEndElement ()
-               {
-                       w.WriteEndElement ();
-                       if (--depth == 0)
-                               WriteEndOfMimeSection ();
-               }
-
-               public override void WriteEntityRef (string name)
-               {
-                       w.WriteEntityRef (name);
-               }
-
-               public override void WriteFullEndElement ()
-               {
-                       w.WriteFullEndElement ();
-                       if (--depth == 0)
-                               WriteEndOfMimeSection ();
-               }
-
-               public override void WriteProcessingInstruction (string name, string data)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override void WriteRaw (string raw)
-               {
-                       CheckState ();
-                       w.WriteRaw (raw);
-               }
-
-               public override void WriteRaw (char [] chars, int index, int count)
-               {
-                       CheckState ();
-                       w.WriteRaw (chars, index, count);
-               }
-
-               public override void WriteStartAttribute (string prefix, string localName, string namespaceURI)
-               {
-                       CheckState ();
-                       w.WriteStartAttribute (prefix, localName, namespaceURI);
-               }
-
-               public override void WriteStartDocument ()
-               {
-                       CheckState ();
-                       // We don't call w.WriteStartDocument() because that causes state error
-                       // (which is correct; MTOM writer just does not expect it).
-               }
-
-               public override void WriteStartDocument (bool standalone)
-               {
-                       CheckState ();
-                       // We don't call w.WriteStartDocument() because that causes state error
-                       // (which is correct; MTOM writer just does not expect it).
-               }
-
-               public override void WriteStartElement (string prefix, string localName, string namespaceURI)
-               {
-                       CheckState ();
-
-                       if (depth == 0)
-                               WriteStartOfMimeSection ();
-
-                       w.WriteStartElement (prefix, localName, namespaceURI);
-                       depth++;
-               }
-
-               public override WriteState WriteState {
-                       get { return w.WriteState; }
-               }
-
-               static readonly char [] eol_chars = "\r\n".ToCharArray ();
-
-               public override void WriteString (string text)
-               {
-                       CheckState ();
-
-                       int i1, i2 = 0;
-                       do {
-                               i1 = text.IndexOfAny (eol_chars, i2);
-                               if (i1 >= 0) {
-                                       w.WriteString (text.Substring (i2, i1 - i2));
-                                       if (text [i1] == '\r')
-                                               w.WriteCharEntity ('\r');
-                                       else
-                                               w.WriteRaw ("\r\n");
-                                       i2 = i1 + 1;
-                               } else {
-                                       w.WriteString (text.Substring (i2));
-                                       break;
-                               }
-                       } while (true);
-               }
-
-               public override void WriteSurrogateCharEntity (char low, char high)
-               {
-                       CheckState ();
-                       w.WriteSurrogateCharEntity (low, high);
-               }
-
-               public override void WriteWhitespace (string text)
-               {
-                       CheckState ();
-                       w.WriteWhitespace (text);
-               }
-
-               public override string XmlLang {
-                       get { return w.XmlLang; }
-               }
-
-               public override XmlSpace XmlSpace {
-                       get { return w.XmlSpace; }
-               }
-
-               void CheckState ()
-               {
-                       if (w == null && write_headers)
-                               WriteMimeHeaders ();
-                       
-                       if (w == null || w.WriteState == WriteState.Closed || w.WriteState == WriteState.Error)
-                               w = CreateWriter ();
-               }
-
-               void WriteMimeHeaders ()
-               {
-                       w.Flush ();
-                       writer.Write ("MIME-Version: 1.0\r\n");
-                       writer.Write ("Content-Type: ");
-                       writer.Write (content_type.ToString ());
-                       writer.Write ("\r\n\r\n\r\n");
-               }
-
-               void WriteStartOfMimeSection ()
-               {
-                       section_count++;
-
-                       // I'm not sure what's the expected behavior of this
-                       // strange XmlWriter, but so far - it outputs only one
-                       // section.
-                       if (section_count > 1)
-                               return;
-
-                       writer.Write ("\r\n");
-                       writer.Write ("--");
-                       writer.Write (content_type.Boundary);
-                       writer.Write ("\r\n");
-                       writer.Write ("Content-ID: ");
-                       writer.Write (content_type.Parameters ["start"]);
-                       writer.Write ("\r\n");
-                       writer.Write ("Content-Transfer-Encoding: 8bit\r\n");
-                       writer.Write ("Content-Type: application/xop+xml;charset=");
-                       writer.Write (xml_writer_settings.Encoding.HeaderName);
-                       writer.Write (";type=\"");
-                       writer.Write (content_type.Parameters ["start-info"].Replace ("\"", "\\\""));
-                       writer.Write ("\"\r\n\r\n");
-               }
-
-               void WriteEndOfMimeSection ()
-               {
-                       // I'm not sure what's the expected behavior of this
-                       // strange XmlWriter, but so far - it outputs only one
-                       // section.
-                       if (section_count > 1)
-                               return;
-
-                       w.Flush ();
-                       writer.Write ("\r\n");
-                       writer.Write ("--");
-                       writer.Write (content_type.Boundary);
-                       writer.Write ("--\r\n");
-               }
-       }
-}
-
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryReader.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryReader.cs
deleted file mode 100644 (file)
index 77682e4..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-namespace System.Xml
-{
-       internal class XmlSimpleDictionaryReader :
-               XmlDictionaryReader, IXmlLineInfo, IXmlNamespaceResolver
-       {
-               XmlDictionary dict;
-               XmlReader reader;
-               XmlDictionaryReader as_dict_reader;
-               IXmlLineInfo as_line_info;
-               OnXmlDictionaryReaderClose onClose;
-
-               public XmlSimpleDictionaryReader (XmlReader reader)
-                       : this (reader, null)
-               {
-               }
-
-               public XmlSimpleDictionaryReader (XmlReader reader,
-                       XmlDictionary dictionary)
-                       : this (reader, dictionary, null)
-               {
-               }
-
-               public XmlSimpleDictionaryReader (XmlReader reader,
-                       XmlDictionary dictionary, OnXmlDictionaryReaderClose onClose)
-               {
-                       this.reader = reader;
-                       this.onClose = onClose;
-                       as_line_info = reader as IXmlLineInfo;
-                       as_dict_reader = reader as XmlDictionaryReader;
-
-                       if (dictionary == null)
-                               dictionary = new XmlDictionary ();
-                       dict = dictionary;
-               }
-
-               #region IXmlLineInfo
-               public int LineNumber {
-                       get { return as_line_info != null ? as_line_info.LineNumber : 0; }
-               }
-
-               public int LinePosition {
-                       get { return as_line_info != null ? as_line_info.LinePosition : 0; }
-               }
-
-               public bool HasLineInfo ()
-               {
-                       return as_line_info != null ? as_line_info.HasLineInfo () : false;
-               }
-               #endregion
-
-               #region XmlDictionaryReader
-
-               public override bool CanCanonicalize {
-                       get { return as_dict_reader != null ? as_dict_reader.CanCanonicalize : false; }
-               }
-
-               public override void EndCanonicalization ()
-               {
-                       if (as_dict_reader != null)
-                               as_dict_reader.EndCanonicalization ();
-                       else
-                               throw new NotSupportedException ();
-               }
-
-               // no need to override for GetAttribute(), IndexOfLocalName(),
-               // IsLocalName(), IsNamespaceUri(), IsStartElement()
-
-               public override bool TryGetLocalNameAsDictionaryString (
-                       out XmlDictionaryString localName)
-               {
-                       // FIXME: find out when it returns true.
-                       localName = null;
-                       return false;
-//                     if (!dict.TryLookup (LocalName, out localName))
-//                             return false;
-//                     return true;
-               }
-
-               public override bool TryGetNamespaceUriAsDictionaryString (
-                       out XmlDictionaryString namespaceUri)
-               {
-                       // FIXME: find out when it returns true.
-                       namespaceUri = null;
-                       return false;
-//                     if (!dict.TryLookup (NamespaceURI, out namespaceUri))
-//                             return false;
-//                     return true;
-               }
-               #endregion
-
-               #region IXmlNamespaceResolver
-
-               public IDictionary<string,string> GetNamespacesInScope (
-                       XmlNamespaceScope scope)
-               {
-                       IXmlNamespaceResolver nsr = reader as IXmlNamespaceResolver;
-                       return nsr.GetNamespacesInScope (scope);
-               }
-
-               public string LookupPrefix (string ns)
-               {
-                       IXmlNamespaceResolver nsr = reader as IXmlNamespaceResolver;
-                       return nsr.LookupPrefix (NameTable.Get (ns));
-               }
-
-               #endregion
-
-               #region XmlReader
-
-               public override int AttributeCount {
-                       get { return reader.AttributeCount; }
-               }
-
-               public override string BaseURI {
-                       get { return reader.BaseURI; }
-               }
-
-               public override int Depth {
-                       get { return reader.Depth; }
-               }
-
-               public override XmlNodeType NodeType 
-               {
-                       get { return reader.NodeType; }
-               }
-
-               public override string Name {
-                       get { return reader.Name; }
-               }
-
-               public override string LocalName {
-                       get { return reader.LocalName; }
-               }
-
-               public override string NamespaceURI {
-                       get { return reader.NamespaceURI; }
-               }
-
-               public override string Prefix {
-                       get { return reader.Prefix; }
-               }
-
-               public override bool HasValue {
-                       get { return reader.HasValue; }
-               }
-
-               public override string Value {
-                       get { return reader.Value; }
-               }
-
-               public override bool IsEmptyElement {
-                       get { return reader.IsEmptyElement; }
-               }
-
-               public override bool IsDefault {
-                       get { return reader.IsDefault; }
-               }
-
-               public override char QuoteChar {
-                       get { return reader.QuoteChar; }
-               }
-
-               public override string XmlLang {
-                       get { return reader.XmlLang; }
-               }
-
-               public override XmlSpace XmlSpace {
-                       get { return reader.XmlSpace; }
-               }
-
-               public override string this [int i] {
-                       get { return reader [i]; }
-               }
-
-               public override string this [string name] {
-                       get { return reader [name]; }
-               }
-
-               public override string this [string localName, string namespaceURI] {
-                       get { return reader [localName, namespaceURI]; }
-               }
-
-               public override bool EOF {
-                       get { return reader.EOF; }
-               }
-
-               public override ReadState ReadState {
-                       get { return reader.ReadState; }
-               }
-
-               public override XmlNameTable NameTable {
-                       get { return reader.NameTable; }
-               }
-
-               public override string GetAttribute (string name)
-               {
-                       return reader.GetAttribute (name);
-               }
-
-               public override string GetAttribute (string localName, string namespaceURI)
-               {
-                       return reader.GetAttribute (localName, namespaceURI);
-               }
-
-               public override string GetAttribute (int i)
-               {
-                       return reader.GetAttribute (i);
-               }
-
-               public override bool MoveToAttribute (string name)
-               {
-                       return reader.MoveToAttribute (name);
-               }
-
-               public override bool MoveToAttribute (string localName, string namespaceURI)
-               {
-                       return reader.MoveToAttribute (localName, namespaceURI);
-               }
-
-               public override void MoveToAttribute (int i)
-               {
-                       reader.MoveToAttribute (i);
-               }
-
-               public override bool MoveToFirstAttribute ()
-               {
-                       return reader.MoveToFirstAttribute ();
-               }
-
-               public override bool MoveToNextAttribute ()
-               {
-                       return reader.MoveToNextAttribute ();
-               }
-
-               public override bool MoveToElement ()
-               {
-                       return reader.MoveToElement ();
-               }
-
-               public override void Close ()
-               {
-                       reader.Close ();
-                       if (onClose != null)
-                               onClose (this);
-               }
-
-               public override bool Read ()
-               {
-                       if (!reader.Read ())
-                               return false;
-                       dict.Add (reader.Prefix);
-                       dict.Add (reader.LocalName);
-                       dict.Add (reader.NamespaceURI);
-                       if (reader.MoveToFirstAttribute ()) {
-                               do {
-                                       dict.Add (reader.Prefix);
-                                       dict.Add (reader.LocalName);
-                                       dict.Add (reader.NamespaceURI);
-                                       dict.Add (reader.Value);
-                               } while (reader.MoveToNextAttribute ());
-                               reader.MoveToElement ();
-                       }
-                       return true;
-               }
-
-               public override string ReadString ()
-               {
-                       return reader.ReadString ();
-               }
-
-               public override string ReadInnerXml ()
-               {
-                       return reader.ReadInnerXml ();
-               }
-
-               public override string ReadOuterXml ()
-               {
-                       return reader.ReadOuterXml ();
-               }
-
-               public override string LookupNamespace (string prefix)
-               {
-                       return reader.LookupNamespace (prefix);
-               }
-
-               public override void ResolveEntity ()
-               {
-                       reader.ResolveEntity ();
-               }
-               public override bool ReadAttributeValue ()
-               {
-                       return reader.ReadAttributeValue ();
-               }
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryWriter.cs
deleted file mode 100644 (file)
index 8f2116f..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// XmlDictionaryWriter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
-       internal class XmlSimpleDictionaryWriter : XmlDictionaryWriter
-       {
-               XmlWriter writer;
-
-               // FIXME: find out how soapCompliant argument is used.
-               public XmlSimpleDictionaryWriter (XmlWriter writer)
-               {
-                       this.writer = writer;
-               }
-
-               public override void Close ()
-               {
-                       writer.Close ();
-               }
-
-               public override void Flush ()
-               {
-                       writer.Flush ();
-               }
-
-               public override string LookupPrefix (string ns)
-               {
-                       return writer.LookupPrefix (ns);
-               }
-
-               public override void WriteBase64 (byte [] buffer, int index, int count)
-               {
-                       writer.WriteBase64 (buffer, index, count);
-               }
-
-               public override void WriteBinHex (byte [] buffer, int index, int count)
-               {
-                       writer.WriteBinHex (buffer, index, count);
-               }
-
-               public override void WriteCData (string text)
-               {
-                       writer.WriteCData (text);
-               }
-
-               public override void WriteCharEntity (char ch)
-               {
-                       writer.WriteCharEntity (ch);
-               }
-
-               public override void WriteChars (char [] buffer, int index, int count)
-               {
-                       writer.WriteChars (buffer, index, count);
-               }
-
-               public override void WriteComment (string text)
-               {
-                       writer.WriteComment (text);
-               }
-
-               public override void WriteDocType (string name, string pubid, string sysid, string subset)
-               {
-                       writer.WriteDocType (name, pubid, sysid, subset);
-               }
-
-               public override void WriteEndAttribute ()
-               {
-                       writer.WriteEndAttribute ();
-               }
-
-               public override void WriteEndDocument ()
-               {
-                       writer.WriteEndDocument ();
-               }
-
-               public override void WriteEndElement ()
-               {
-                       Depth--;
-                       NSIndex = 0;
-                       writer.WriteEndElement ();
-               }
-
-               public override void WriteEntityRef (string name)
-               {
-                       writer.WriteEntityRef (name);
-               }
-
-               public override void WriteFullEndElement ()
-               {
-                       writer.WriteFullEndElement ();
-               }
-
-               public override void WriteName (string name)
-               {
-                       writer.WriteName (name);
-               }
-
-               public override void WriteNmToken (string name)
-               {
-                       writer.WriteNmToken (name);
-               }
-
-               public override void WriteNode (XmlReader reader, bool defattr)
-               {
-                       writer.WriteNode (reader, defattr);
-               }
-
-               public override void WriteProcessingInstruction (string name, string text)
-               {
-                       writer.WriteProcessingInstruction (name, text);
-               }
-
-               public override void WriteQualifiedName (string localName, string ns)
-               {
-                       writer.WriteQualifiedName (localName, ns);
-               }
-
-               public override void WriteRaw (string data)
-               {
-                       writer.WriteRaw (data);
-               }
-
-               public override void WriteRaw (char [] buffer, int index, int count)
-               {
-                       writer.WriteRaw (buffer, index, count);
-               }
-
-               public override void WriteStartAttribute (string prefix, string localName, string ns)
-               {
-                       writer.WriteStartAttribute (prefix, localName, ns);
-               }
-
-               public override void WriteStartDocument (bool standalone)
-               {
-                       writer.WriteStartDocument (standalone);
-               }
-
-               public override void WriteStartDocument ()
-               {
-                       writer.WriteStartDocument ();
-               }
-
-               public override void WriteStartElement (string prefix, string localName, string ns)
-               {
-                       Depth++;
-                       NSIndex = 0;
-                       writer.WriteStartElement (prefix, localName, ns);
-               }
-
-               public override void WriteString (string text)
-               {
-                       writer.WriteString (text);
-               }
-
-               public override void WriteSurrogateCharEntity (char lowChar, char highChar)
-               {
-                       writer.WriteSurrogateCharEntity (lowChar, highChar);
-               }
-
-               public override void WriteWhitespace (string ws)
-               {
-                       writer.WriteWhitespace (ws);
-               }
-
-               public override WriteState WriteState {
-                       get {
-                               return writer.WriteState;
-                       }
-               }
-
-               public override string XmlLang {
-                       get {
-                               return writer.XmlLang;
-                       }
-               }
-
-               public override XmlSpace XmlSpace {
-                       get {
-                               return writer.XmlSpace;
-                       }
-               }
-
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/binary-writer-method-gen.cs b/mcs/class/System.Runtime.Serialization/binary-writer-method-gen.cs
deleted file mode 100644 (file)
index df3e5d9..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-// mono binary-writer-method-gen.exe > System.Xml/XmlBinaryDictionaryWriterAutoGen.cs
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using Microsoft.CSharp;
-
-public class Generator
-{
-       public static void Main ()
-       {
-               Console.Out.NewLine = "\n";
-               Type [] types = new Type [] {
-                       typeof (bool), typeof (DateTime), typeof (decimal), typeof (double),
-                       typeof (Guid), typeof (short), typeof (int), typeof (long), typeof (float), typeof (TimeSpan) };
-
-               Dictionary<Type,byte> table = new Dictionary<Type,byte> ();
-               // LAMESPEC: [MC-NBFX] section 2.3.3 dedscribes wrong RecordTypes.
-               table.Add (typeof (bool), 0xB5);
-               table.Add (typeof (short), 0x8B);
-               table.Add (typeof (int), 0x8D);
-               table.Add (typeof (long), 0x8F);
-               table.Add (typeof (float), 0x91);
-               table.Add (typeof (double), 0x93);
-               table.Add (typeof (decimal), 0x95);
-               table.Add (typeof (DateTime), 0x97);
-               table.Add (typeof (TimeSpan), 0xAF);
-               table.Add (typeof (Guid), 0xB1);
-
-               Console.WriteLine (@"
-using System;
-using BF = System.Xml.XmlBinaryFormat;
-
-namespace System.Xml
-{
-       internal partial class XmlBinaryDictionaryWriter : XmlDictionaryWriter
-       {
-               void CheckWriteArrayArguments (Array array, int offset, int length)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException (""array"");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException (""offset is negative"");
-                       if (offset > array.Length)
-                               throw new ArgumentOutOfRangeException (""offset exceeds the length of the destination array"");
-                       if (length < 0)
-                               throw new ArgumentOutOfRangeException (""length is negative"");
-                       if (length > array.Length - offset)
-                               throw new ArgumentOutOfRangeException (""length + offset exceeds the length of the destination array"");
-               }
-
-               void CheckDictionaryStringArgs (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException (""localName"");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException (""namespaceUri"");
-               }
-");
-
-               foreach (Type type in types) {
-                       Console.WriteLine (@"
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, {0} [] array, int offset, int length)
-               {{
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }}
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, {0} [] array, int offset, int length)
-               {{
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }}
-
-               void WriteArrayRemaining ({0} [] array, int offset, int length)
-               {{
-                       writer.Write ((byte) 0x{2:X02}); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }}", ToCSharp (type), type.Name, table [type]);
-
-               // <note>
-               // WriteArrayRemaining() is generated, but are modified and moved into 
-               // XmlBinaryDictionaryWriter. (I keep it open here so that we
-               // make sure to remove this before compiling. Remove this to get
-               // it working fine).
-               // </note>
-
-
-               }
-               Console.WriteLine (@"
-       }
-}");
-       }
-
-       static CodeDomProvider cs = new CSharpCodeProvider ();
-
-       static string ToCSharp (Type type)
-       {
-               string r = cs.GetTypeOutput (new CodeTypeReference (type));
-               return r != type.FullName ? r : type.Name;
-       }
-}
-
diff --git a/mcs/class/System.Runtime.Serialization/net_4_0_System.Runtime.Serialization.dll.sources b/mcs/class/System.Runtime.Serialization/net_4_0_System.Runtime.Serialization.dll.sources
deleted file mode 100644 (file)
index 1a04edc..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include System.Runtime.Serialization.dll.sources
-
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializer.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonReaderInitializer.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonWriterInitializer.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReader.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReaderWriterFactory.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationReader.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationWriter.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonWriter.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/TypeMap.cs
diff --git a/mcs/class/System.Runtime.Serialization/reader-method-gen.cs b/mcs/class/System.Runtime.Serialization/reader-method-gen.cs
deleted file mode 100644 (file)
index e360b21..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-// mono reader-method-gen.exe > System.Xml/XmlDictionaryReaderAutoGen.cs
-using System;
-using System.Globalization;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.Reflection;
-using System.Xml;
-using Microsoft.CSharp;
-
-public class Generator
-{
-       public static void Main ()
-       {
-               Console.Out.NewLine = "\n";
-               Type [] types = new Type [] {
-                       typeof (bool), typeof (DateTime), typeof (decimal), typeof (double),
-                       typeof (Guid), typeof (short), typeof (int), typeof (long), typeof (float), typeof (TimeSpan) };
-
-               Console.WriteLine (@"
-#pragma warning disable 612
-using System;
-using System.Collections.Generic;
-
-namespace System.Xml
-{
-       public abstract partial class XmlDictionaryReader : XmlReader
-       {
-               static readonly char [] wsChars = new char [] {' ', '\t', '\n', '\r'};
-
-               void CheckReadArrayArguments (Array array, int offset, int length)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException (""array"");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException (""offset is negative"");
-                       if (offset > array.Length)
-                               throw new ArgumentOutOfRangeException (""offset exceeds the length of the destination array"");
-                       if (length < 0)
-                               throw new ArgumentOutOfRangeException (""length is negative"");
-                       if (length > array.Length - offset)
-                               throw new ArgumentOutOfRangeException (""length + offset exceeds the length of the destination array"");
-               }
-
-               void CheckDictionaryStringArgs (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException (""localName"");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException (""namespaceUri"");
-               }
-");
-
-               foreach (Type type in types) {
-                       Console.WriteLine (@"
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, {0} [] array, int offset, int length)
-               {{
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }}
-
-               public virtual int ReadArray (string localName, string namespaceUri, {0} [] array, int offset, int length)
-               {{
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {{
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.To{1} (ReadContentAsString ());
-                               ReadEndElement ();
-                       }}
-                       return length;
-               }}
-
-               public virtual {0} [] Read{1}Array (string localName, string namespaceUri)
-               {{
-                       List<{0}> list = new List<{0}> ();
-                       while (true) {{
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.To{1} (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }}
-                       return list.ToArray ();
-               }}
-
-               public virtual {0} [] Read{1}Array (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {{
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return Read{1}Array (localName.Value, namespaceUri.Value);
-               }}", ToCSharp (type), type.Name);
-
-               }
-
-               Type xr = typeof (XmlReader);
-               string name = "ReadElementContentAs";
-               foreach (MethodInfo mi in xr.GetMethods ()) {
-                       if (!mi.Name.StartsWith (name))
-                               continue;
-                       ParameterInfo [] pl = mi.GetParameters ();
-                       if (pl.Length != 2 || pl [0].ParameterType != typeof (string))
-                               continue;
-                       if (mi.Name.EndsWith ("AsObject"))
-                               continue; // special case to filter out.
-                       if (mi.Name.EndsWith ("AsString"))
-                               continue; // special case to filter out.
-
-                       bool isOverride = xr.GetMethod (mi.Name, Type.EmptyTypes) != null;
-                       Console.WriteLine (@"
-               public {3}{0} {1} ()
-               {{
-                       ReadStartElement (LocalName, NamespaceURI);
-                       {0} ret = {2} ();
-                       ReadEndElement ();
-                       return ret;
-               }}",
-                               ToCSharp (mi.ReturnType),
-                               mi.Name,
-                               mi.Name.Replace ("Element", String.Empty),
-                               isOverride ? "override " : null);
-               }
-
-               Console.WriteLine (@"
-       }
-}");
-       }
-
-       static CodeDomProvider cs = new CSharpCodeProvider ();
-
-       static string ToCSharp (Type type)
-       {
-               string r = cs.GetTypeOutput (new CodeTypeReference (type));
-               return r != type.FullName ? r : type.Name;
-       }
-
-       static string ToOldName (Type type)
-       {
-               switch (type.Name) {
-               case "Single":
-                       return "Float";
-               case "Int32":
-                       return "Int";
-               case "Int64":
-                       return "Long";
-               case "Int16":
-                       return "Short";
-               default:
-                       return type.Name;
-               }
-       }
-}
-
diff --git a/mcs/class/System.Runtime.Serialization/resources/mstypes.schema b/mcs/class/System.Runtime.Serialization/resources/mstypes.schema
deleted file mode 100644 (file)
index d5677f6..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-       <xs:element name="anyType" nillable="true" type="xs:anyType" />
-       <xs:element name="anyURI" nillable="true" type="xs:anyURI" />
-       <xs:element name="base64Binary" nillable="true" type="xs:base64Binary" />
-       <xs:element name="boolean" nillable="true" type="xs:boolean" />
-       <xs:element name="byte" nillable="true" type="xs:byte" />
-       <xs:element name="dateTime" nillable="true" type="xs:dateTime" />
-       <xs:element name="decimal" nillable="true" type="xs:decimal" />
-       <xs:element name="double" nillable="true" type="xs:double" />
-       <xs:element name="float" nillable="true" type="xs:float" />
-       <xs:element name="int" nillable="true" type="xs:int" />
-       <xs:element name="long" nillable="true" type="xs:long" />
-       <xs:element name="QName" nillable="true" type="xs:QName" />
-       <xs:element name="short" nillable="true" type="xs:short" />
-       <xs:element name="string" nillable="true" type="xs:string" />
-       <xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte" />
-       <xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt" />
-       <xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong" />
-       <xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort" />
-       <xs:element name="char" nillable="true" type="tns:char" />
-       <xs:simpleType name="char">
-               <xs:restriction base="xs:int" />
-       </xs:simpleType>
-       <xs:element name="duration" nillable="true" type="tns:duration" />
-       <xs:simpleType name="duration">
-               <xs:restriction base="xs:duration">
-                       <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?" />
-                       <xs:minInclusive value="-P10675199DT2H48M5.4775808S" />
-                       <xs:maxInclusive value="P10675199DT2H48M5.4775807S" />
-               </xs:restriction>
-       </xs:simpleType>
-       <xs:element name="guid" nillable="true" type="tns:guid" />
-       <xs:simpleType name="guid">
-               <xs:restriction base="xs:string">
-                       <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}" />
-               </xs:restriction>
-       </xs:simpleType>
-       <xs:attribute name="FactoryType" type="xs:QName" />
-       <xs:attribute name="Id" type="xs:ID" />
-       <xs:attribute name="Ref" type="xs:IDREF" />
-</xs:schema>
diff --git a/mcs/class/System.Runtime.Serialization/writer-method-gen.cs b/mcs/class/System.Runtime.Serialization/writer-method-gen.cs
deleted file mode 100644 (file)
index ed7518f..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-// mono writer-method-gen.exe > System.Xml/XmlDictionaryWriterAutoGen.cs
-using System;
-using System.Globalization;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using Microsoft.CSharp;
-
-public class Generator
-{
-       public static void Main ()
-       {
-               Console.Out.NewLine = "\n";
-               Type [] types = new Type [] {
-                       typeof (bool), typeof (DateTime), typeof (decimal), typeof (double),
-                       typeof (Guid), typeof (short), typeof (int), typeof (long), typeof (float), typeof (TimeSpan) };
-
-               Console.WriteLine (@"
-using System;
-
-namespace System.Xml
-{
-       public abstract partial class XmlDictionaryWriter : XmlWriter
-       {
-               void CheckWriteArrayArguments (Array array, int offset, int length)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException (""array"");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException (""offset is negative"");
-                       if (offset > array.Length)
-                               throw new ArgumentOutOfRangeException (""offset exceeds the length of the destination array"");
-                       if (length < 0)
-                               throw new ArgumentOutOfRangeException (""length is negative"");
-                       if (length > array.Length - offset)
-                               throw new ArgumentOutOfRangeException (""length + offset exceeds the length of the destination array"");
-               }
-
-               void CheckDictionaryStringArgs (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException (""localName"");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException (""namespaceUri"");
-               }
-");
-
-               foreach (Type type in types) {
-                       Console.WriteLine (@"
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, {0} [] array, int offset, int length)
-               {{
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }}
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, {0} [] array, int offset, int length)
-               {{
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {{
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }}
-
-               }}", ToCSharp (type), type.Name);
-
-               }
-               Console.WriteLine (@"
-       }
-}");
-       }
-
-       static CodeDomProvider cs = new CSharpCodeProvider ();
-
-       static string ToCSharp (Type type)
-       {
-               string r = cs.GetTypeOutput (new CodeTypeReference (type));
-               return r != type.FullName ? r : type.Name;
-       }
-}
-