X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.XML%2FSystem.Xml.Serialization%2FXmlSchemaImporter.cs;fp=mcs%2Fclass%2FSystem.XML%2FSystem.Xml.Serialization%2FXmlSchemaImporter.cs;h=6ebbd05e450f4c0056b6daf1a41539f945c910ab;hb=987f8c63e214937c50dcb308149f7558a2cbba41;hp=c78dafd59c6f4d3ad3562f6594cd0b59788857f9;hpb=8924b4087c3ec29676e768783abdde935aa7413d;p=mono.git diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs index c78dafd59c6..6ebbd05e450 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs @@ -35,6 +35,10 @@ using System.CodeDom.Compiler; #endif using System.Xml.Schema; using System.Collections; +#if NET_2_0 && CONFIGURATION_DEP +using System.Configuration; +using System.Xml.Serialization.Configuration; +#endif namespace System.Xml.Serialization { @@ -84,6 +88,8 @@ namespace System.Xml.Serialization { this.schemas = schemas; typeIdentifiers = new CodeIdentifiers (); + + InitializeExtensions (); } public XmlSchemaImporter (XmlSchemas schemas, CodeIdentifiers typeIdentifiers) @@ -105,6 +111,8 @@ namespace System.Xml.Serialization } else typeIdentifiers = new CodeIdentifiers (); + + InitializeExtensions (); } #endif @@ -118,6 +126,8 @@ namespace System.Xml.Serialization } else typeIdentifiers = new CodeIdentifiers (); + + InitializeExtensions (); } @@ -126,6 +136,8 @@ namespace System.Xml.Serialization this.typeIdentifiers = typeIdentifiers; this.schemas = schemas; this.options = options; + + InitializeExtensions (); } void InitSharedData (ImportContext context) @@ -148,6 +160,19 @@ namespace System.Xml.Serialization #region Methods + void InitializeExtensions () + { +#if NET_2_0 && CONFIGURATION_DEP + SerializationSectionGroup root = ConfigurationManager.GetSection ("system.xml.serialization") as SerializationSectionGroup; + if (root == null) + return; + + foreach (SchemaImporterExtensionElement element in + root.SchemaImporterExtensions.SchemaImporterExtensions) + Extensions.Add (element.Name, element.Type); +#endif + } + public XmlMembersMapping ImportAnyType (XmlQualifiedName typeName, string elementName) { if (typeName == XmlQualifiedName.Empty)