From e66d448104cf2c11d5fcfdaf47b12382cbc9c249 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Fri, 8 May 2015 13:52:28 +0200 Subject: [PATCH] [system.xml] System.Xml.Serialization.Advanced from reference sources --- .../ChangeLog | 4 - .../SchemaImporterExtension.cs | 96 ------------ .../SchemaImporterExtensionCollection.cs | 139 ----------------- .../CodeGenerationOptions.cs | 53 ------- .../CodeIdentifier.cs | 77 ---------- .../CodeIdentifiers.cs | 143 ------------------ mcs/class/System.XML/System.Xml.dll.sources | 8 +- .../System.XML/mobile_System.Xml.dll.sources | 10 +- 8 files changed, 11 insertions(+), 519 deletions(-) delete mode 100644 mcs/class/System.XML/System.Xml.Serialization.Advanced/ChangeLog delete mode 100644 mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtension.cs delete mode 100644 mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollection.cs delete mode 100644 mcs/class/System.XML/System.Xml.Serialization/CodeGenerationOptions.cs delete mode 100644 mcs/class/System.XML/System.Xml.Serialization/CodeIdentifier.cs delete mode 100644 mcs/class/System.XML/System.Xml.Serialization/CodeIdentifiers.cs diff --git a/mcs/class/System.XML/System.Xml.Serialization.Advanced/ChangeLog b/mcs/class/System.XML/System.Xml.Serialization.Advanced/ChangeLog deleted file mode 100644 index b1caaeabc61..00000000000 --- a/mcs/class/System.XML/System.Xml.Serialization.Advanced/ChangeLog +++ /dev/null @@ -1,4 +0,0 @@ -2006-11-01 Atsushi Enomoto - - * SchemaImporterExtensionCollection.cs, - SchemaImporterExtension.cs : moved from S.X.Serialization. diff --git a/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtension.cs b/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtension.cs deleted file mode 100644 index c8047130167..00000000000 --- a/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtension.cs +++ /dev/null @@ -1,96 +0,0 @@ -// -// System.Xml.Serialization.SchemaImporterExtension.cs -// -// Author: -// Lluis Sanchez Gual (lluis@novell.com) -// -// Copyright (C) Novell, Inc., 2004 -// - -// -// 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.Specialized; -using System.Xml.Schema; - -namespace System.Xml.Serialization.Advanced -{ - public abstract class SchemaImporterExtension - { - protected SchemaImporterExtension () - { - } - - public virtual string ImportAnyElement ( - XmlSchemaAny any, - bool mixed, - XmlSchemas schemas, - XmlSchemaImporter importer, - CodeCompileUnit compileUnit, - CodeNamespace mainNamespace, - CodeGenerationOptions options, - CodeDomProvider codeProvider - ) - { - return null; - } - - public virtual CodeExpression ImportDefaultValue (string value, string type) - { - return null; - } - - public virtual string ImportSchemaType ( - XmlSchemaType type, - XmlSchemaObject context, - XmlSchemas schemas, - XmlSchemaImporter importer, - CodeCompileUnit compileUnit, - CodeNamespace mainNamespace, - CodeGenerationOptions options, - CodeDomProvider codeProvider - ) - { - return null; - } - - public virtual string ImportSchemaType ( - string name, - string ns, - XmlSchemaObject context, - XmlSchemas schemas, - XmlSchemaImporter importer, - CodeCompileUnit compileUnit, - CodeNamespace mainNamespace, - CodeGenerationOptions options, - CodeDomProvider codeProvider - ) - { - return null; - } - } -} - diff --git a/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollection.cs b/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollection.cs deleted file mode 100644 index 23e78070136..00000000000 --- a/mcs/class/System.XML/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollection.cs +++ /dev/null @@ -1,139 +0,0 @@ -// -// System.Xml.Serialization.SchemaImporterExtensionCollection.cs -// -// Author: -// Lluis Sanchez Gual (lluis@novell.com) -// Atsushi Enomoto (atsushi@ximian.com) -// -// Copyright (C) Novell, Inc., 2004, 2006 -// - -// -// 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.Serialization.Advanced -{ - public class SchemaImporterExtensionCollection : CollectionBase - { - Dictionary named_items = - new Dictionary (); - - public SchemaImporterExtensionCollection () - { - } - - public int Add (SchemaImporterExtension extension) - { - if (extension == null) - throw new ArgumentNullException ("extension"); - return List.Add (extension); - } - - public int Add (string name, Type type) - { - if (name == null) - throw new ArgumentNullException ("name"); - if (type == null) - throw new ArgumentNullException ("type"); - if (!type.IsSubclassOf (typeof (SchemaImporterExtension))) - throw new ArgumentException ("The type argument must be subclass of SchemaImporterExtension."); - - SchemaImporterExtension e = (SchemaImporterExtension) Activator.CreateInstance (type); - if (named_items.ContainsKey (name)) - throw new InvalidOperationException (String.Format ("A SchemaImporterExtension keyed by '{0}' already exists.", name)); - int ret = Add (e); - named_items.Add (name, e); - return ret; - } - - public new void Clear () - { - named_items.Clear (); - List.Clear (); - } - - public bool Contains (SchemaImporterExtension extension) - { - if (extension == null) - throw new ArgumentNullException ("extension"); - foreach (SchemaImporterExtension e in List) - if (extension.Equals (e)) - return true; - return false; - } - - public void CopyTo (SchemaImporterExtension [] array, int index) - { - List.CopyTo (array, index); - } - - public int IndexOf (SchemaImporterExtension extension) - { - if (extension == null) - throw new ArgumentNullException ("extension"); - int i = 0; - foreach (SchemaImporterExtension e in List) { - if (extension.Equals (e)) { - return i; - } - i++; - } - return -1; - } - - public void Insert (int index, SchemaImporterExtension extension) - { - if (extension == null) - throw new ArgumentNullException ("extension"); - List.Insert (index, extension); - } - - public void Remove (SchemaImporterExtension extension) - { - int idx = IndexOf (extension); - if (idx >= 0) - List.RemoveAt (idx); - } - - public void Remove (string name) - { - if (name == null) - throw new ArgumentNullException ("name"); - if (!named_items.ContainsKey (name)) - return; - SchemaImporterExtension e = named_items [name]; - Remove (e); - named_items.Remove (name); - } - - public SchemaImporterExtension this [int index] - { - get { return (SchemaImporterExtension) List [index]; } - set { List [index] = value; } - } - } -} - diff --git a/mcs/class/System.XML/System.Xml.Serialization/CodeGenerationOptions.cs b/mcs/class/System.XML/System.Xml.Serialization/CodeGenerationOptions.cs deleted file mode 100644 index d06f3e408d6..00000000000 --- a/mcs/class/System.XML/System.Xml.Serialization/CodeGenerationOptions.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// System.Xml.Serialization.CodeGenerationOptions -// -// Author: -// Lluis Sanchez Gual (lluis@ximian.com) -// -// Copyright (C) Novell, Inc., 2004 -// - -// -// 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.Serialization -{ - [Flags] - public - enum CodeGenerationOptions - { - [XmlIgnore] - None = 0, - [XmlEnum ("properties")] - GenerateProperties = 1, - [XmlEnum ("newAsync")] - GenerateNewAsync = 2, - [XmlEnum ("oldAsync")] - GenerateOldAsync = 4, - [XmlEnum ("order")] - GenerateOrder = 8, - [XmlEnum ("enableDataBinding")] - EnableDataBinding = 16, - - } -} diff --git a/mcs/class/System.XML/System.Xml.Serialization/CodeIdentifier.cs b/mcs/class/System.XML/System.Xml.Serialization/CodeIdentifier.cs deleted file mode 100644 index 7d96ca5ee47..00000000000 --- a/mcs/class/System.XML/System.Xml.Serialization/CodeIdentifier.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -// System.Xml.Serialization.CodeIdentifier.cs -// -// Author: -// Tim Coleman (tim@timcoleman.com) -// -// Copyright (C) Tim Coleman, 2002 -// - -// -// 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.Xml.Serialization { - public class CodeIdentifier { - - [Obsolete ("Design mistake. It only contains static methods.")] - public - CodeIdentifier () - { - } - - public static string MakeCamel (string identifier) - { - string validIdentifier = MakeValid (identifier); - return (Char.ToLower (validIdentifier[0], CultureInfo.InvariantCulture) + validIdentifier.Substring (1)); - } - - public static string MakePascal (string identifier) - { - string validIdentifier = MakeValid (identifier); - return (Char.ToUpper (validIdentifier[0], CultureInfo.InvariantCulture) + validIdentifier.Substring (1)); - } - - public static string MakeValid (string identifier) - { - if (identifier == null) - throw new NullReferenceException (); - if (identifier.Length == 0) - return "Item"; - - string output = ""; - - if (!Char.IsLetter (identifier[0]) && (identifier[0]!='_') ) - output = "Item"; - - foreach (char c in identifier) - if (Char.IsLetterOrDigit (c) || c == '_') - output += c; - - if (output.Length > 400) - output = output.Substring (0,400); - - return output; - } - } -} diff --git a/mcs/class/System.XML/System.Xml.Serialization/CodeIdentifiers.cs b/mcs/class/System.XML/System.Xml.Serialization/CodeIdentifiers.cs deleted file mode 100644 index cca5605f421..00000000000 --- a/mcs/class/System.XML/System.Xml.Serialization/CodeIdentifiers.cs +++ /dev/null @@ -1,143 +0,0 @@ -// -// System.Xml.Serialization.CodeIdentifiers -// -// Author: -// Tim Coleman (tim@timcoleman.com) -// -// Copyright (C) Tim Coleman, 2002 -// - -// -// 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.Globalization; - -namespace System.Xml.Serialization { - public class CodeIdentifiers { - - #region Fields - - bool useCamelCasing; - Hashtable table; - Hashtable reserved; - - #endregion - - #region Constructors - - public CodeIdentifiers () - : this (true) - { - } - - public - CodeIdentifiers (bool caseSensitive) - { - StringComparer c = caseSensitive ? - StringComparer.Ordinal : - StringComparer.OrdinalIgnoreCase; - table = new Hashtable (c); - reserved = new Hashtable (c); - } - - #endregion // Constructors - - #region Properties - - public bool UseCamelCasing { - get { return useCamelCasing; } - set { useCamelCasing = value; } - } - - #endregion // Properties - - #region Methods - - public void Add (string identifier, object value) - { - table.Add (identifier, value); - } - - public void AddReserved (string identifier) - { - reserved.Add (identifier, identifier); - } - - public string AddUnique (string identifier, object value) - { - string unique = MakeUnique (identifier); - Add (unique, value); - return unique; - } - - public void Clear () - { - table.Clear (); - } - - public bool IsInUse (string identifier) - { - return (table.ContainsKey (identifier) || reserved.ContainsKey (identifier)); - } - - public string MakeRightCase (string identifier) - { - if (UseCamelCasing) - return CodeIdentifier.MakeCamel (identifier); - else - return CodeIdentifier.MakePascal (identifier); - } - - public string MakeUnique (string identifier) - { - string uniqueIdentifier = identifier; - int i = 1; - - while (IsInUse (uniqueIdentifier)) { - uniqueIdentifier = String.Format (CultureInfo.InvariantCulture, "{0}{1}", identifier, i); - i += 1; - } - - return uniqueIdentifier; - } - - public void Remove (string identifier) - { - table.Remove (identifier); - } - - public void RemoveReserved (string identifier) - { - reserved.Remove (identifier); - } - - public object ToArray (Type type) - { - Array list = Array.CreateInstance (type, table.Count); - table.CopyTo (list, 0); - return list; - } - - #endregion // Methods - } -} diff --git a/mcs/class/System.XML/System.Xml.dll.sources b/mcs/class/System.XML/System.Xml.dll.sources index 5c5cb9a7a82..758481422cd 100644 --- a/mcs/class/System.XML/System.Xml.dll.sources +++ b/mcs/class/System.XML/System.Xml.dll.sources @@ -480,12 +480,16 @@ ReferenceSources/Wsdl.cs ../../../external/referencesource/System.Xml/System/Xml/Schema/XsdValidator.cs ../../../external/referencesource/System.Xml/System/Xml/Serialization/_Events.cs +../../../external/referencesource/System.Xml/System/Xml/Serialization/CodeGenerationoptions.cs ../../../external/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifier.cs +../../../external/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifiers.cs ../../../external/referencesource/System.Xml/System/Xml/Serialization/ImportContext.cs ../../../external/referencesource/System.Xml/System/Xml/Serialization/SchemaObjectWriter.cs ../../../external/referencesource/System.Xml/System/Xml/Serialization/XmlSchemas.cs ../../../external/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerNamespaces.cs +../../../external/referencesource/System.Xml/System/Xml/Serialization/Advanced/SchemaImporterExtension.cs + ../../../external/referencesource/System.Xml/System/Xml/Serialization/Configuration/ConfigurationStrings.cs ../../../external/referencesource/System.Xml/System/Xml/Serialization/Configuration/DateTimeSerializationSection.cs ../../../external/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionElement.cs @@ -601,11 +605,7 @@ ReferenceSources/Wsdl.cs ../../../external/referencesource/System.Xml/System/Xml/Xslt/XsltException.cs ../../../external/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs ../../../external/referencesource/System.Xml/System/Xml/Xslt/XsltSettings.cs -System.Xml.Serialization.Advanced/SchemaImporterExtensionCollection.cs -System.Xml.Serialization.Advanced/SchemaImporterExtension.cs System.Xml.Serialization/CodeExporter.cs -System.Xml.Serialization/CodeGenerationOptions.cs -System.Xml.Serialization/CodeIdentifiers.cs System.Xml.Serialization/ImportContext.cs System.Xml.Serialization/IXmlSerializable.cs System.Xml.Serialization/IXmlTextParser.cs diff --git a/mcs/class/System.XML/mobile_System.Xml.dll.sources b/mcs/class/System.XML/mobile_System.Xml.dll.sources index 2c35fe3203d..d39f386c705 100644 --- a/mcs/class/System.XML/mobile_System.Xml.dll.sources +++ b/mcs/class/System.XML/mobile_System.Xml.dll.sources @@ -375,11 +375,18 @@ ReferenceSources/Wsdl.cs ../../../external/referencesource/System.Xml/System/Xml/Schema/XsdDateTime.cs ../../../external/referencesource/System.Xml/System/Xml/Schema/XsdDuration.cs ../../../external/referencesource/System.Xml/System/Xml/Schema/XsdValidator.cs + ../../../external/referencesource/System.Xml/System/Xml/Serialization/_Events.cs +../../../external/referencesource/System.Xml/System/Xml/Serialization/CodeGenerationoptions.cs +../../../external/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifier.cs +../../../external/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifiers.cs ../../../external/referencesource/System.Xml/System/Xml/Serialization/ImportContext.cs ../../../external/referencesource/System.Xml/System/Xml/Serialization/SchemaObjectWriter.cs ../../../external/referencesource/System.Xml/System/Xml/Serialization/XmlSchemas.cs ../../../external/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerNamespaces.cs + +../../../external/referencesource/System.Xml/System/Xml/Serialization/Advanced/SchemaImporterExtension.cs + ../../../external/referencesource/System.Xml/System/Xml/ValidateNames.cs ../../../external/referencesource/System.Xml/System/Xml/XmlCharType.cs ../../../external/referencesource/System.Xml/System/Xml/XmlComplianceUtil.cs @@ -486,9 +493,6 @@ ReferenceSources/Wsdl.cs ../../../external/referencesource/System.Xml/System/Xml/Xslt/XsltException.cs ../../../external/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs ../../../external/referencesource/System.Xml/System/Xml/Xslt/XsltSettings.cs -System.Xml.Serialization/CodeGenerationOptions.cs -System.Xml.Serialization/CodeIdentifier.cs -System.Xml.Serialization/CodeIdentifiers.cs System.Xml.Serialization/ImportContext.cs System.Xml.Serialization/IXmlSerializable.cs System.Xml.Serialization/IXmlTextParser.cs -- 2.25.1