XmlSchemaElement.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. // Author: Dwivedi, Ajay kumar
  2. // [email protected]
  3. using System;
  4. using System.Xml;
  5. using System.Xml.Serialization;
  6. using System.ComponentModel;
  7. namespace System.Xml.Schema
  8. {
  9. /// <summary>
  10. /// Summary description for XmlSchemaElement.
  11. /// </summary>
  12. public class XmlSchemaElement : XmlSchemaParticle
  13. {
  14. private XmlSchemaDerivationMethod block;
  15. private XmlSchemaDerivationMethod blockResolved;
  16. private XmlSchemaObjectCollection constraints;
  17. private string defaultValue;
  18. private object elementType;
  19. private XmlSchemaDerivationMethod final;
  20. private XmlSchemaDerivationMethod finalResolved;
  21. private string fixedValue;
  22. private XmlSchemaForm form;
  23. private bool isAbstract;
  24. private bool isNillable;
  25. private string name;
  26. private XmlQualifiedName qName;
  27. private XmlQualifiedName refName;
  28. private XmlSchemaType schemaType;
  29. private XmlQualifiedName schemaTypeName;
  30. private XmlQualifiedName substitutionGroup;
  31. public XmlSchemaElement()
  32. {
  33. block = XmlSchemaDerivationMethod.None;
  34. final = XmlSchemaDerivationMethod.None;
  35. constraints = new XmlSchemaObjectCollection();
  36. qName = XmlQualifiedName.Empty;
  37. substitutionGroup = XmlQualifiedName.Empty;
  38. }
  39. #region Attributes
  40. [DefaultValue(false)]
  41. [System.Xml.Serialization.XmlAttribute("abstract")]
  42. public bool IsAbstract
  43. {
  44. get{ return isAbstract; }
  45. set{ isAbstract = value; }
  46. }
  47. [DefaultValue(XmlSchemaDerivationMethod.None)]
  48. [System.Xml.Serialization.XmlAttribute("block")]
  49. public XmlSchemaDerivationMethod Block
  50. {
  51. get{ return block; }
  52. set{ block = value; }
  53. }
  54. [DefaultValue(null)]
  55. [System.Xml.Serialization.XmlAttribute("default")]
  56. public string DefaultValue
  57. {
  58. get{ return defaultValue; }
  59. set{ defaultValue = value; }
  60. }
  61. [DefaultValue(XmlSchemaDerivationMethod.None)]
  62. [System.Xml.Serialization.XmlAttribute("final")]
  63. public XmlSchemaDerivationMethod Final
  64. {
  65. get{ return final; }
  66. set{ final = value; }
  67. }
  68. [DefaultValue(null)]
  69. [System.Xml.Serialization.XmlAttribute("fixed")]
  70. public string FixedValue
  71. {
  72. get{ return fixedValue; }
  73. set{ fixedValue = value; }
  74. }
  75. [DefaultValue(XmlSchemaForm.None)]
  76. [System.Xml.Serialization.XmlAttribute("form")]
  77. public XmlSchemaForm Form
  78. {
  79. get{ return form; }
  80. set{ form = value; }
  81. }
  82. [DefaultValue(false)]
  83. [System.Xml.Serialization.XmlAttribute("nillable")]
  84. public bool IsNillable
  85. {
  86. get{ return isNillable; }
  87. set{ isNillable = value; }
  88. }
  89. [DefaultValue(null)]
  90. [System.Xml.Serialization.XmlAttribute("name")]
  91. public string Name
  92. {
  93. get{ return name; }
  94. set{ name = value; }
  95. }
  96. [System.Xml.Serialization.XmlAttribute("ref")]
  97. public XmlQualifiedName RefName
  98. {
  99. get{ return refName; }
  100. set{ refName = value;}
  101. }
  102. [System.Xml.Serialization.XmlAttribute("type")]
  103. public XmlQualifiedName SchemaTypeName
  104. {
  105. get{ return schemaTypeName; }
  106. set{ schemaTypeName = value; }
  107. }
  108. [System.Xml.Serialization.XmlAttribute("substitutionGroup")]
  109. public XmlQualifiedName SubstitutionGroup
  110. {
  111. get{ return substitutionGroup; }
  112. set{ substitutionGroup = value; }
  113. }
  114. #endregion
  115. #region Elements
  116. [XmlElement("unique",typeof(XmlSchemaUnique),Namespace="http://www.w3.org/2001/XMLSchema")]
  117. [XmlElement("key",typeof(XmlSchemaKey),Namespace="http://www.w3.org/2001/XMLSchema")]
  118. [XmlElement("keyref",typeof(XmlSchemaKeyref),Namespace="http://www.w3.org/2001/XMLSchema")]
  119. public XmlSchemaObjectCollection Constraints
  120. {
  121. get{ return constraints; }
  122. }
  123. [XmlElement("simpleType",typeof(XmlSchemaSimpleType),Namespace="http://www.w3.org/2001/XMLSchema")]
  124. [XmlElement("complexType",typeof(XmlSchemaComplexType),Namespace="http://www.w3.org/2001/XMLSchema")]
  125. public XmlSchemaType SchemaType
  126. {
  127. get{ return schemaType; }
  128. set{ schemaType = value; }
  129. }
  130. #endregion
  131. #region XmlIgnore
  132. [XmlIgnore]
  133. public XmlSchemaDerivationMethod BlockResolved
  134. {
  135. get{ return blockResolved; }
  136. }
  137. [XmlIgnore]
  138. public object ElementType
  139. {
  140. get{ return elementType; }
  141. }
  142. [XmlIgnore]
  143. public XmlSchemaDerivationMethod FinalResolved
  144. {
  145. get{ return finalResolved; }
  146. }
  147. [XmlIgnore]
  148. public XmlQualifiedName QualifiedName
  149. {
  150. get{ return qName; }
  151. }
  152. #endregion
  153. }
  154. }