Merge pull request #495 from nicolas-raoul/fix-for-issue2907-with-no-formatting-changes
[mono.git] / mcs / class / System.XML / System.Xml.Serialization / XmlTypeMapping.cs
index c23c5dd16c8994e894fe9813e1ae606a18dbd634..2b0f8bd829d2768ed76993523618639fae3e1f0c 100644 (file)
@@ -107,10 +107,15 @@ namespace System.Xml.Serialization
 
                internal string XmlTypeNamespace
                {
-                       get { return xmlTypeNamespace; }
+                       get { return xmlTypeNamespace ?? string.Empty; }
                        set { xmlTypeNamespace = value; }
                }
 
+               internal bool HasXmlTypeNamespace
+               {
+                       get { return xmlTypeNamespace != null; }
+               }
+
                internal ArrayList DerivedTypes
                {
                        get { return _derivedTypes; }
@@ -170,9 +175,9 @@ namespace System.Xml.Serialization
 
                internal XmlTypeMapping GetRealElementMap (string name, string ens)
                {
-                       if (xmlType == name && xmlTypeNamespace == ens) return this;
+                       if (xmlType == name && XmlTypeNamespace == ens) return this;
                        foreach (XmlTypeMapping map in _derivedTypes)
-                               if (map.xmlType == name && map.xmlTypeNamespace == ens) return map;
+                               if (map.xmlType == name && map.XmlTypeNamespace == ens) return map;
                        
                        return null;
                }