Merge pull request #185 from QuickJack/master
[mono.git] / mcs / class / System.XML / System.Xml.Schema / XmlSchemaComplexContentExtension.cs
index b7d56ceb98fd702a872c4e3b7850199cc47703f2..f2e9bcd9ab69f4fb88d99669f49fa232d2a7df09 100644 (file)
@@ -85,6 +85,17 @@ namespace System.Xml.Schema
                        get { return true; }
                }
 
+               internal override void SetParent (XmlSchemaObject parent)
+               {
+                       base.SetParent (parent);
+                       if (Particle != null)
+                               Particle.SetParent (this);
+                       if (AnyAttribute != null)
+                               AnyAttribute.SetParent (this);
+                       foreach (XmlSchemaObject obj in Attributes)
+                               obj.SetParent (this);
+               }
+
                /// <remarks>
                /// </remarks>
                internal override int Compile(ValidationEventHandler h, XmlSchema schema)
@@ -93,15 +104,6 @@ namespace System.Xml.Schema
                        if (CompilationId == schema.CompilationId)
                                return 0;
 
-#if NET_2_0
-                       if (Particle != null)
-                               Particle.Parent = this;
-                       if (AnyAttribute != null)
-                               AnyAttribute.Parent = this;
-                       foreach (XmlSchemaObject obj in Attributes)
-                               obj.Parent = this;
-#endif
-
                        if (this.isRedefinedComponent) {
                                if (Annotation != null)
                                        Annotation.isRedefinedComponent = true;