mscorlib(4.0.0.0) API with additions
XmlSchemaInfo.cs
1 namespace System.Xml.Schema
2 {
5  {
6  private bool isDefault;
7 
8  private bool isNil;
9 
10  private XmlSchemaElement schemaElement;
11 
12  private XmlSchemaAttribute schemaAttribute;
13 
14  private XmlSchemaType schemaType;
15 
16  private XmlSchemaSimpleType memberType;
17 
18  private XmlSchemaValidity validity;
19 
20  private XmlSchemaContentType contentType;
21 
25  {
26  get
27  {
28  return validity;
29  }
30  set
31  {
32  validity = value;
33  }
34  }
35 
38  public bool IsDefault
39  {
40  get
41  {
42  return isDefault;
43  }
44  set
45  {
46  isDefault = value;
47  }
48  }
49 
52  public bool IsNil
53  {
54  get
55  {
56  return isNil;
57  }
58  set
59  {
60  isNil = value;
61  }
62  }
63 
67  {
68  get
69  {
70  return memberType;
71  }
72  set
73  {
74  memberType = value;
75  }
76  }
77 
80  public XmlSchemaType SchemaType
81  {
82  get
83  {
84  return schemaType;
85  }
86  set
87  {
88  schemaType = value;
89  if (schemaType != null)
90  {
91  contentType = schemaType.SchemaContentType;
92  }
93  else
94  {
95  contentType = XmlSchemaContentType.Empty;
96  }
97  }
98  }
99 
103  {
104  get
105  {
106  return schemaElement;
107  }
108  set
109  {
110  schemaElement = value;
111  if (value != null)
112  {
113  schemaAttribute = null;
114  }
115  }
116  }
117 
121  {
122  get
123  {
124  return schemaAttribute;
125  }
126  set
127  {
128  schemaAttribute = value;
129  if (value != null)
130  {
131  schemaElement = null;
132  }
133  }
134  }
135 
139  {
140  get
141  {
142  return contentType;
143  }
144  set
145  {
146  contentType = value;
147  }
148  }
149 
150  internal XmlSchemaType XmlType
151  {
152  get
153  {
154  if (memberType != null)
155  {
156  return memberType;
157  }
158  return schemaType;
159  }
160  }
161 
162  internal bool HasDefaultValue
163  {
164  get
165  {
166  if (schemaElement != null)
167  {
168  return schemaElement.ElementDecl.DefaultValueTyped != null;
169  }
170  return false;
171  }
172  }
173 
174  internal bool IsUnionType
175  {
176  get
177  {
178  if (schemaType == null || schemaType.Datatype == null)
179  {
180  return false;
181  }
182  return schemaType.Datatype.Variety == XmlSchemaDatatypeVariety.Union;
183  }
184  }
185 
187  public XmlSchemaInfo()
188  {
189  Clear();
190  }
191 
192  internal XmlSchemaInfo(XmlSchemaValidity validity)
193  : this()
194  {
195  this.validity = validity;
196  }
197 
198  internal void Clear()
199  {
200  isNil = false;
201  isDefault = false;
202  schemaType = null;
203  schemaElement = null;
204  schemaAttribute = null;
205  memberType = null;
206  validity = XmlSchemaValidity.NotKnown;
207  contentType = XmlSchemaContentType.Empty;
208  }
209  }
210 }
The base class for all simple types and complex types.
Definition: XmlSchemaType.cs:7
Defines the post-schema-validation infoset of a validated XML node.
bool IsNil
Gets or sets a value indicating if the value for this validated XML node is nil.
XmlSchemaDatatype Datatype
Gets the post-compilation value for the data type of the complex type.
XmlSchemaDatatypeVariety
Specifies the W3C XML schema data type variety of the type.
XmlSchemaInfo()
Initializes a new instance of the T:System.Xml.Schema.XmlSchemaInfo class.
Represents the post-schema-validation infoset of a validated XML node.
Definition: XmlSchemaInfo.cs:4
XmlSchemaValidity
Represents the validity of an XML item validated by the T:System.Xml.Schema.XmlSchemaValidator class.
XmlSchemaValidity Validity
Gets or sets the T:System.Xml.Schema.XmlSchemaValidity value of this validated XML node.
XmlSchemaElement SchemaElement
Gets or sets the compiled T:System.Xml.Schema.XmlSchemaElement object that corresponds to this valida...
XmlSchemaContentType
Enumerations for the content model of the complex type. This represents the content in the post-schem...
XmlSchemaSimpleType MemberType
Gets or sets the dynamic schema type for this validated XML node.
XmlSchemaAttribute SchemaAttribute
Gets or sets the compiled T:System.Xml.Schema.XmlSchemaAttribute object that corresponds to this vali...
Represents the element element from XML Schema as specified by the World Wide Web Consortium (W3C)....
bool IsDefault
Gets or sets a value indicating if this validated XML node was set as the result of a default being a...
virtual XmlSchemaDatatypeVariety Variety
Gets the T:System.Xml.Schema.XmlSchemaDatatypeVariety value for the simple type.
XmlSchemaContentType ContentType
Gets or sets the T:System.Xml.Schema.XmlSchemaContentType object that corresponds to the content type...
Represents the simpleType element for simple content from XML Schema as specified by the World Wide W...
Represents the attribute element from the XML Schema as specified by the World Wide Web Consortium (W...