X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.XML%2FSystem.Xml.Serialization%2FXmlSerializer.cs;h=35d149a4ebefdd20b7f784e97c7a1e9254aad009;hb=d6bd25591bf2c50bee29f0c66579d2d81795bf33;hp=474e8178375a80385951e8255954865a9c1b5454;hpb=f0d2ee46f839cc3cebcdaa674b3a31d9a3e22863;p=mono.git diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs index 474e8178375..35d149a4ebe 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs @@ -151,14 +151,21 @@ namespace System.Xml.Serialization #endif deleteTempFiles = (db == null || db == "no"); #if !NET_2_1 - IDictionary table = (IDictionary) ConfigurationSettings.GetConfig("system.diagnostics"); + // DiagnosticsSection + ConfigurationSection table = (ConfigurationSection) ConfigurationSettings.GetConfig("system.diagnostics"); + var bf = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; if (table != null) { - table = (IDictionary) table["switches"]; - if (table != null) - { - string val = (string) table ["XmlSerialization.Compilation"]; - if (val == "1") deleteTempFiles = false; + // SwitchElementsCollection + var pi = table.GetType ().GetProperty ("Switches", bf); + var switchesElement = (ConfigurationElementCollection) pi.GetValue (table, null); + foreach (ConfigurationElement e in switchesElement) { + // SwitchElement + if (e.GetType ().GetProperty ("Name", bf).GetValue (e, null) as string == "XmlSerialization.Compilation") { + if (e.GetType ().GetProperty ("Value", bf).GetValue (e, null) as string == "1") + deleteTempFiles = false; + break; + } } } #endif @@ -232,7 +239,6 @@ namespace System.Xml.Serialization get { return typeMapping; } } -#if NET_2_0 [MonoTODO] public XmlSerializer (Type type, @@ -244,7 +250,6 @@ namespace System.Xml.Serialization Evidence evidence) { } -#endif #endregion // Constructors @@ -467,13 +472,8 @@ namespace System.Xml.Serialization if (namespaces == null || namespaces.Count == 0) { namespaces = new XmlSerializerNamespaces (); -#if NET_2_0 namespaces.Add ("xsi", XmlSchema.InstanceNamespace); namespaces.Add ("xsd", XmlSchema.Namespace); -#else - namespaces.Add ("xsd", XmlSchema.Namespace); - namespaces.Add ("xsi", XmlSchema.InstanceNamespace); -#endif } xsWriter.Initialize (xmlWriter, namespaces); @@ -769,6 +769,8 @@ namespace System.Xml.Serialization cp.ReferencedAssemblies.Add ("System.Xml"); if (!cp.ReferencedAssemblies.Contains ("System.Data")) cp.ReferencedAssemblies.Add ("System.Data"); + if (!cp.ReferencedAssemblies.Contains ("System.Web.Services")) + cp.ReferencedAssemblies.Add ("System.Web.Services"); CompilerResults res = comp.CompileAssemblyFromFile (cp, file); if (res.Errors.HasErrors || res.CompiledAssembly == null) { @@ -804,17 +806,10 @@ namespace System.Xml.Serialization } #endif -#if NET_2_0 GenerationBatch LoadFromSatelliteAssembly (GenerationBatch batch) { return batch; } -#else - GenerationBatch LoadFromSatelliteAssembly (GenerationBatch batch) - { - return batch; - } -#endif #endregion // Methods }