Merge pull request #1275 from ranma42/fix-lib64
[mono.git] / mcs / class / System.XML / System.Xml.Serialization / XmlAttributes.cs
index 17d5233e098d903a83cdf9e4f890e68a3365872f..410d586bbb191f59855f5a729c2b5ecc4b28507f 100644 (file)
@@ -40,9 +40,7 @@ namespace System.Xml.Serialization
        /// </summary>
        public class XmlAttributes
        {
-#if !MOONLIGHT
                private XmlAnyAttributeAttribute xmlAnyAttribute;
-#endif
                private XmlAnyElementAttributes xmlAnyElements = new XmlAnyElementAttributes();
                private XmlArrayAttribute xmlArray;
                private XmlArrayItemAttributes xmlArrayItems = new XmlArrayItemAttributes();
@@ -66,11 +64,9 @@ namespace System.Xml.Serialization
                        object[] attributes = provider.GetCustomAttributes(false);
                        foreach(object obj in attributes)
                        {
-#if !MOONLIGHT
                                if(obj is XmlAnyAttributeAttribute)
                                        xmlAnyAttribute = (XmlAnyAttributeAttribute) obj;
                                else
-#endif
                                if(obj is XmlAnyElementAttribute)
                                        xmlAnyElements.Add((XmlAnyElementAttribute) obj);
                                else if(obj is XmlArrayAttribute)
@@ -98,10 +94,25 @@ namespace System.Xml.Serialization
                                else if(obj is XmlTypeAttribute)
                                        xmlType = (XmlTypeAttribute) obj;
                        }
+                       
+                       if (xmlIgnore) {
+                               xmlAnyAttribute = null;
+                               xmlAnyElements.Clear ();
+                               xmlArray = null;
+                               xmlArrayItems.Clear ();
+                               xmlAttribute = null;
+                               xmlChoiceIdentifier = null;
+                               xmlDefaultValue = null;
+                               xmlElements.Clear ();
+                               xmlEnum = null;
+                               xmlns = false;
+                               xmlRoot = null;
+                               xmlText = null;
+                               xmlType = null;
+                       }
                }
 
                #region public properties
-#if !MOONLIGHT
                public XmlAnyAttributeAttribute XmlAnyAttribute 
                {
                        get 
@@ -113,7 +124,7 @@ namespace System.Xml.Serialization
                                xmlAnyAttribute = value;
                        }
                }
-#endif
+
                public XmlAnyElementAttributes XmlAnyElements 
                {
                        get 
@@ -248,9 +259,7 @@ namespace System.Xml.Serialization
                        
                        KeyHelper.AddField (sb, 1, xmlIgnore);
                        KeyHelper.AddField (sb, 2, xmlns);
-#if !MOONLIGHT
                        KeyHelper.AddField (sb, 3, xmlAnyAttribute!=null);
-#endif
 
                        xmlAnyElements.AddKeyHash (sb);
                        xmlArrayItems.AddKeyHash (sb);