Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2006-11-02 04:50:30 +0300
committerAtsushi Eno <atsushieno@gmail.com>2006-11-02 04:50:30 +0300
commitc6b89558b457efe29ea0f5cd60123e8c3e3e80cb (patch)
tree395b814bff5f099afbe20dc6f9149f6ecc5432d6 /mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
parent658311053b31bc054945664c6b8d6734c1c0c4a1 (diff)
2006-11-02 Atsushi Enomoto <atsushi@ximian.com>
* XmlSchemaImporter.cs : initialize extensions from configuration. svn path=/branches/atsushi/mcs/; revision=67251
Diffstat (limited to 'mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs')
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
index 3767c2667c0..5c867c6a827 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)