XmlSchemaElement.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. constraints = new XmlSchemaObjectCollection();
  35. final = XmlSchemaDerivationMethod.None;
  36. finalResolved = XmlSchemaDerivationMethod.None;
  37. name = string.Empty;
  38. qName = XmlQualifiedName.Empty;
  39. substitutionGroup = XmlQualifiedName.Empty;
  40. }
  41. [DefaultValue(XmlSchemaDerivationMethod.None)]
  42. [XmlAttribute]
  43. public XmlSchemaDerivationMethod Block
  44. {
  45. get{ return block; }
  46. set{ block = value; }
  47. }
  48. [XmlIgnore]
  49. public XmlSchemaDerivationMethod BlockResolved
  50. {
  51. get{ return blockResolved; }
  52. }
  53. [XmlElement]
  54. public XmlSchemaObjectCollection Constraints
  55. {
  56. get{ return constraints; }
  57. }
  58. [DefaultValue("")]
  59. [XmlAttribute]
  60. public string DefaultValue
  61. {
  62. get{ return defaultValue; }
  63. set{ defaultValue = value; }
  64. }
  65. [XmlIgnore]
  66. public object ElementType
  67. {
  68. get{ return elementType; }
  69. }
  70. [DefaultValue(XmlSchemaDerivationMethod.None)]
  71. [XmlAttribute]
  72. public XmlSchemaDerivationMethod Final
  73. {
  74. get{ return final; }
  75. set{ final = value; }
  76. }
  77. [XmlIgnore]
  78. public XmlSchemaDerivationMethod FinalResolved
  79. {
  80. get{ return finalResolved; }
  81. }
  82. [DefaultValue("")]
  83. [XmlAttribute]
  84. public string FixedValue
  85. {
  86. get{ return fixedValue; }
  87. set{ fixedValue = value; }
  88. }
  89. [DefaultValue(XmlSchemaForm.None)]
  90. [XmlAttribute]
  91. public XmlSchemaForm Form
  92. {
  93. get{ return form; }
  94. set{ form = value; }
  95. }
  96. [DefaultValue(true)]
  97. [XmlAttribute]
  98. public bool IsAbstract
  99. {
  100. get{ return isAbstract; }
  101. set{ isAbstract = value; }
  102. }
  103. [DefaultValue(false)]
  104. [XmlAttribute]
  105. public bool IsNillable
  106. {
  107. get{ return isNillable; }
  108. set{ isNillable = value; }
  109. }
  110. [DefaultValue("")]
  111. [XmlAttribute]
  112. public string Name
  113. {
  114. get{ return name; }
  115. set{ name = value; }
  116. }
  117. [XmlIgnore]
  118. public XmlQualifiedName QualifiedName
  119. {
  120. get{ return qName; }
  121. }
  122. [XmlAttribute]
  123. public XmlQualifiedName RefName
  124. {
  125. get{ return refName; }
  126. set{ refName = value;}
  127. }
  128. [XmlElement]
  129. public XmlSchemaType SchemaType
  130. {
  131. get{ return schemaType; }
  132. set{ schemaType = value; }
  133. }
  134. [XmlAttribute]
  135. public XmlQualifiedName SchemaTypeName
  136. {
  137. get{ return schemaTypeName; }
  138. set{ schemaTypeName = value; }
  139. }
  140. [XmlAttribute]
  141. public XmlQualifiedName SubstitutionGroup
  142. {
  143. get{ return substitutionGroup; }
  144. set{ substitutionGroup = value; }
  145. }
  146. }
  147. }