Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Xml / System / Xml / Schema / XmlSchemaGroup.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="XmlSchemaGroup.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">Microsoft</owner>                                                                 
6 //------------------------------------------------------------------------------
7
8 namespace System.Xml.Schema {
9
10     using System.Xml.Serialization;
11
12     /// <include file='doc\XmlSchemaGroup.uex' path='docs/doc[@for="XmlSchemaGroup"]/*' />
13     /// <devdoc>
14     ///    <para>[To be supplied.]</para>
15     /// </devdoc>
16     public class XmlSchemaGroup : XmlSchemaAnnotated {
17         string name;        
18         XmlSchemaGroupBase particle;
19         XmlSchemaParticle canonicalParticle;
20         XmlQualifiedName qname = XmlQualifiedName.Empty; 
21         XmlSchemaGroup redefined;
22         int selfReferenceCount;
23
24         /// <include file='doc\XmlSchemaGroup.uex' path='docs/doc[@for="XmlSchemaGroup.Name"]/*' />
25         /// <devdoc>
26         ///    <para>[To be supplied.]</para>
27         /// </devdoc>
28         [XmlAttribute("name")]
29         public string Name { 
30             get { return name; }
31             set { name = value; }
32         }
33
34         /// <include file='doc\XmlSchemaGroup.uex' path='docs/doc[@for="XmlSchemaGroup.Particle"]/*' />
35         /// <devdoc>
36         ///    <para>[To be supplied.]</para>
37         /// </devdoc>
38         [XmlElement("choice", typeof(XmlSchemaChoice)),
39          XmlElement("all", typeof(XmlSchemaAll)),
40          XmlElement("sequence", typeof(XmlSchemaSequence))]
41         public XmlSchemaGroupBase Particle {
42             get { return particle; }
43             set { particle = value; }
44         }
45
46         [XmlIgnore]
47         public XmlQualifiedName QualifiedName {
48             get { return qname; }
49         }
50
51         [XmlIgnore]
52         internal XmlSchemaParticle CanonicalParticle {
53             get { return canonicalParticle; }
54             set { canonicalParticle = value; }
55         }
56
57         [XmlIgnore]
58         internal XmlSchemaGroup Redefined {
59             get { return redefined; }
60             set { redefined = value; }
61         }
62
63         [XmlIgnore]
64         internal int SelfReferenceCount {
65             get { return selfReferenceCount; }
66             set { selfReferenceCount = value; }
67         }
68
69         [XmlIgnore]
70         internal override string NameAttribute {
71             get { return Name; }
72             set { Name = value; }
73         }
74
75         internal void SetQualifiedName(XmlQualifiedName value) { 
76             qname = value;
77         }
78
79         internal override XmlSchemaObject Clone() {
80             System.Diagnostics.Debug.Assert(false, "Should never call Clone() on XmlSchemaGroup. Call Clone(XmlSchema) instead.");
81             return Clone(null);
82         }
83
84         internal XmlSchemaObject Clone(XmlSchema parentSchema) {
85             XmlSchemaGroup newGroup = (XmlSchemaGroup)MemberwiseClone();
86             if (XmlSchemaComplexType.HasParticleRef(this.particle, parentSchema)) {
87                 newGroup.particle = XmlSchemaComplexType.CloneParticle(this.particle, parentSchema) as XmlSchemaGroupBase;
88             }
89             newGroup.canonicalParticle = XmlSchemaParticle.Empty;
90             return newGroup;
91         }
92     }
93 }