2005-01-13 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.XML / System.Xml.Schema / XmlSchemaComplexContentExtension.cs
index 09abc9e842a54b305c16c2e138ed469d3419dc21..75b2a86e01776b46a498e07df84406fda11863f3 100755 (executable)
@@ -5,6 +5,27 @@
 //     Dwivedi, Ajay kumar  Adwiv@Yahoo.com\r
 //     Atsushi Enomoto  ginga@kit.hi-ho.ne.jp\r
 //\r
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 using System;\r
 using System.Xml;\r
 using System.Xml.Serialization;\r
@@ -20,7 +41,7 @@ namespace System.Xml.Schema
                private XmlSchemaObjectCollection attributes;\r
                private XmlQualifiedName baseTypeName;\r
                private XmlSchemaParticle particle;\r
-               private static string xmlname = "extension";\r
+               const string xmlname = "extension";\r
 \r
                public XmlSchemaComplexContentExtension()\r
                {\r
@@ -59,6 +80,11 @@ namespace System.Xml.Schema
                        set{ any = value;}\r
                }\r
 \r
+               // internal properties\r
+               internal override bool IsExtension {\r
+                       get { return true; }\r
+               }\r
+\r
                /// <remarks>\r
                /// </remarks>\r
                internal override int Compile(ValidationEventHandler h, XmlSchema schema)\r
@@ -67,6 +93,15 @@ namespace System.Xml.Schema
                        if (this.IsComplied (schema.CompilationId))\r
                                return 0;\r
 \r
+#if NET_2_0\r
+                       if (Particle != null)\r
+                               Particle.Parent = this;\r
+                       if (AnyAttribute != null)\r
+                               AnyAttribute.Parent = this;\r
+                       foreach (XmlSchemaObject obj in Attributes)\r
+                               obj.Parent = this;\r
+#endif\r
+\r
                        if (this.isRedefinedComponent) {\r
                                if (Annotation != null)\r
                                        Annotation.isRedefinedComponent = true;\r