The Labs \ Source Viewer \ SSCLI \ System.Xml.Schema \ XmlSchemaAttributeGroup

  1. //------------------------------------------------------------------------------
  2. // <copyright file="XmlSchemaAttributeGroup.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. // <owner current="true" primary="true">priyal</owner>
  15. //------------------------------------------------------------------------------
  16. namespace System.Xml.Schema
  17. {
  18.    
  19.     using System.Collections;
  20.     using System.Xml.Serialization;
  21.    
  22.     /// <include file='doc\XmlSchemaAttributeGroup.uex' path='docs/doc[@for="XmlSchemaAttributeGroup"]/*' />
  23.     /// <devdoc>
  24.     /// <para>[To be supplied.]</para>
  25.     /// </devdoc>
  26.     public class XmlSchemaAttributeGroup : XmlSchemaAnnotated
  27.     {
  28.         string name;
  29.         XmlSchemaObjectCollection attributes = new XmlSchemaObjectCollection();
  30.         XmlSchemaAnyAttribute anyAttribute;
  31.         XmlQualifiedName qname = XmlQualifiedName.Empty;
  32.         XmlSchemaAttributeGroup redefined;
  33.         XmlSchemaObjectTable attributeUses;
  34.         XmlSchemaAnyAttribute attributeWildcard;
  35.         int selfReferenceCount;
  36.        
  37.         /// <include file='doc\XmlSchemaAttributeGroup.uex' path='docs/doc[@for="XmlSchemaAttributeGroup.Name"]/*' />
  38.         /// <devdoc>
  39.         /// <para>[To be supplied.]</para>
  40.         /// </devdoc>
  41.         [XmlAttribute("name")]
  42.         public string Name {
  43.             get { return name; }
  44.             set { name = value; }
  45.         }
  46.        
  47.         /// <include file='doc\XmlSchemaAttributeGroup.uex' path='docs/doc[@for="XmlSchemaAttributeGroup.Attributes"]/*' />
  48.         /// <devdoc>
  49.         /// <para>[To be supplied.]</para>
  50.         /// </devdoc>
  51.         [XmlElement("attribute", typeof(XmlSchemaAttribute)), XmlElement("attributeGroup", typeof(XmlSchemaAttributeGroupRef))]
  52.         public XmlSchemaObjectCollection Attributes {
  53.             get { return attributes; }
  54.         }
  55.        
  56.         /// <include file='doc\XmlSchemaAttributeGroup.uex' path='docs/doc[@for="XmlSchemaAttributeGroup.AnyAttribute"]/*' />
  57.         /// <devdoc>
  58.         /// <para>[To be supplied.]</para>
  59.         /// </devdoc>
  60.         [XmlElement("anyAttribute")]
  61.         public XmlSchemaAnyAttribute AnyAttribute {
  62.             get { return anyAttribute; }
  63.             set { anyAttribute = value; }
  64.         }
  65.        
  66.         [XmlIgnore()]
  67.         public XmlQualifiedName QualifiedName {
  68.             get { return qname; }
  69.         }
  70.        
  71.         [XmlIgnore()]
  72.         internal XmlSchemaObjectTable AttributeUses {
  73.             get {
  74.                 if (attributeUses == null) {
  75.                     attributeUses = new XmlSchemaObjectTable();
  76.                 }
  77.                 return attributeUses;
  78.             }
  79.         }
  80.        
  81.         [XmlIgnore()]
  82.         internal XmlSchemaAnyAttribute AttributeWildcard {
  83.             get { return attributeWildcard; }
  84.             set { attributeWildcard = value; }
  85.         }
  86.        
  87.         /// <include file='doc\XmlSchemaAttributeGroup.uex' path='docs/doc[@for="XmlSchemaAttributeGroup.RedefinedAttributeGroup"]/*' />
  88.         [XmlIgnore()]
  89.         public XmlSchemaAttributeGroup RedefinedAttributeGroup {
  90.             get { return redefined; }
  91.         }
  92.        
  93.         [XmlIgnore()]
  94.         internal XmlSchemaAttributeGroup Redefined {
  95.             get { return redefined; }
  96.             set { redefined = value; }
  97.         }
  98.        
  99.         [XmlIgnore()]
  100.         internal int SelfReferenceCount {
  101.             get { return selfReferenceCount; }
  102.             set { selfReferenceCount = value; }
  103.         }
  104.        
  105.         [XmlIgnore()]
  106.         internal override string NameAttribute {
  107.             get { return Name; }
  108.             set { Name = value; }
  109.         }
  110.        
  111.         internal void SetQualifiedName(XmlQualifiedName value)
  112.         {
  113.             qname = value;
  114.         }
  115.        
  116.         internal override XmlSchemaObject Clone()
  117.         {
  118.             XmlSchemaAttributeGroup newGroup = (XmlSchemaAttributeGroup)MemberwiseClone();
  119.             if (XmlSchemaComplexType.HasAttributeQNameRef(this.attributes)) {
  120.                 //If a ref/type name is present
  121.                 newGroup.attributes = XmlSchemaComplexType.CloneAttributes(this.attributes);
  122.                
  123.                 //Clear compiled tables
  124.                 newGroup.attributeUses = null;
  125.             }
  126.             return newGroup;
  127.         }
  128.     }
  129.    
  130. }

Developer Fusion