Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / schema / XmlSchemaInfo.cs / 1 / XmlSchemaInfo.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
using System.Xml;
using System.Collections;
namespace System.Xml.Schema {
///
public class XmlSchemaInfo : IXmlSchemaInfo {
bool isDefault;
bool isNil;
XmlSchemaElement schemaElement;
XmlSchemaAttribute schemaAttribute;
XmlSchemaType schemaType;
XmlSchemaSimpleType memberType;
XmlSchemaValidity validity;
XmlSchemaContentType contentType;
public XmlSchemaInfo() {
Clear();
}
internal XmlSchemaInfo(XmlSchemaValidity validity) : this() {
this.validity = validity;
}
public XmlSchemaValidity Validity {
get {
return validity;
}
set {
validity = value;
}
}
public bool IsDefault {
get {
return isDefault;
}
set {
isDefault = value;
}
}
public bool IsNil {
get {
return isNil;
}
set {
isNil = value;
}
}
public XmlSchemaSimpleType MemberType {
get {
return memberType;
}
set {
memberType = value;
}
}
public XmlSchemaType SchemaType {
get {
return schemaType;
}
set {
schemaType = value;
if (schemaType != null) { //Member type will not change its content type
contentType = schemaType.SchemaContentType;
}
else {
contentType = XmlSchemaContentType.Empty;
}
}
}
public XmlSchemaElement SchemaElement {
get {
return schemaElement;
}
set {
schemaElement = value;
if (value != null) { //Setting non-null SchemaElement means SchemaAttribute should be null
schemaAttribute = null;
}
}
}
public XmlSchemaAttribute SchemaAttribute {
get {
return schemaAttribute;
}
set {
schemaAttribute = value;
if (value != null) { //Setting non-null SchemaAttribute means SchemaElement should be null
schemaElement = null;
}
}
}
public XmlSchemaContentType ContentType {
get {
return contentType;
}
set {
contentType = value;
}
}
internal XmlSchemaType XmlType {
get {
if (memberType != null) {
return memberType;
}
return schemaType;
}
}
internal bool HasDefaultValue {
get {
return schemaElement != null && schemaElement.ElementDecl.DefaultValueTyped != null;
}
}
internal bool IsUnionType {
get {
if (schemaType == null || schemaType.Datatype == null) {
return false;
}
return schemaType.Datatype.Variety == XmlSchemaDatatypeVariety.Union;
}
}
internal void Clear() {
isNil = false;
isDefault = false;
schemaType = null;
schemaElement = null;
schemaAttribute = null;
memberType = null;
validity = XmlSchemaValidity.NotKnown;
contentType = XmlSchemaContentType.Empty;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GiveFeedbackEvent.cs
- TextServicesContext.cs
- HostingPreferredMapPath.cs
- SettingsProperty.cs
- HwndTarget.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- SimpleMailWebEventProvider.cs
- SocketElement.cs
- XPathSingletonIterator.cs
- SessionIDManager.cs
- ImageBrush.cs
- DataGridLengthConverter.cs
- MachineSettingsSection.cs
- CoreSwitches.cs
- DataBoundControl.cs
- UInt32Converter.cs
- DataKeyCollection.cs
- SQLInt32Storage.cs
- mongolianshape.cs
- MetabaseReader.cs
- SmtpLoginAuthenticationModule.cs
- FontStyle.cs
- VirtualPathUtility.cs
- SafeNativeMemoryHandle.cs
- VersionedStream.cs
- BlurBitmapEffect.cs
- ProcessManager.cs
- BaseCollection.cs
- ObjectSpanRewriter.cs
- VisualCollection.cs
- DateTimePicker.cs
- XmlSchemaInferenceException.cs
- MouseGestureConverter.cs
- StylusPointPropertyId.cs
- DSACryptoServiceProvider.cs
- TextElementEnumerator.cs
- ServicePointManagerElement.cs
- EnumerableRowCollectionExtensions.cs
- OdbcEnvironmentHandle.cs
- ParseNumbers.cs
- RectangleGeometry.cs
- DbgUtil.cs
- SqlDataSourceParameterParser.cs
- ExceptQueryOperator.cs
- XmlReflectionMember.cs
- WebPartUserCapability.cs
- HttpWebResponse.cs
- WorkflowRuntime.cs
- MultipartContentParser.cs
- WebConfigurationManager.cs
- VerticalAlignConverter.cs
- RepeatBehavior.cs
- Rijndael.cs
- OrderedDictionary.cs
- PropertyPathWorker.cs
- OneOfConst.cs
- EdmError.cs
- PolyQuadraticBezierSegment.cs
- NameValueFileSectionHandler.cs
- TreeView.cs
- SpeechUI.cs
- EventBuilder.cs
- PermissionAttributes.cs
- Label.cs
- PropertyChangeTracker.cs
- NGCSerializationManager.cs
- ImageSource.cs
- VirtualPath.cs
- ToggleProviderWrapper.cs
- TransformCollection.cs
- NotificationContext.cs
- DynamicValueConverter.cs
- XmlCountingReader.cs
- MenuItemStyle.cs
- AccessKeyManager.cs
- VectorValueSerializer.cs
- WebPartEditorOkVerb.cs
- DynamicValueConverter.cs
- SymbolTable.cs
- MachineSettingsSection.cs
- TextAdaptor.cs
- GenericPrincipal.cs
- MasterPageBuildProvider.cs
- RowCache.cs
- PriorityQueue.cs
- ColumnReorderedEventArgs.cs
- QilUnary.cs
- MgmtConfigurationRecord.cs
- DelimitedListTraceListener.cs
- MenuStrip.cs
- SystemIPInterfaceStatistics.cs
- Bits.cs
- GroupBoxAutomationPeer.cs
- DataSetMappper.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- HttpServerProtocol.cs
- Operators.cs
- Triplet.cs
- SessionIDManager.cs
- LockCookie.cs