Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //[....] //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DesignerAdapterUtil.cs
- GreenMethods.cs
- XmlBoundElement.cs
- NetworkInformationPermission.cs
- OutOfMemoryException.cs
- ParseHttpDate.cs
- TokenBasedSet.cs
- Metadata.cs
- SingleResultAttribute.cs
- RotationValidation.cs
- DbgUtil.cs
- NetworkAddressChange.cs
- SafeFindHandle.cs
- BackoffTimeoutHelper.cs
- AttributeCollection.cs
- TdsParserSessionPool.cs
- AnnotationAuthorChangedEventArgs.cs
- GeneralTransform3D.cs
- PipelineModuleStepContainer.cs
- RegistrySecurity.cs
- SpeakProgressEventArgs.cs
- DateTimeOffsetConverter.cs
- Figure.cs
- FtpCachePolicyElement.cs
- DataBinder.cs
- LabelAutomationPeer.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- WebDescriptionAttribute.cs
- EventMap.cs
- DecoderReplacementFallback.cs
- LayoutInformation.cs
- CodeConditionStatement.cs
- PeerCollaborationPermission.cs
- HwndMouseInputProvider.cs
- DataTableExtensions.cs
- RangeEnumerable.cs
- xmlsaver.cs
- Util.cs
- ReadOnlyPropertyMetadata.cs
- SqlNotificationEventArgs.cs
- DockingAttribute.cs
- DropDownButton.cs
- BuildResultCache.cs
- Hashtable.cs
- SyntaxCheck.cs
- Misc.cs
- CharacterMetrics.cs
- TextBoxRenderer.cs
- Guid.cs
- PerCallInstanceContextProvider.cs
- HierarchicalDataSourceControl.cs
- CryptoApi.cs
- AudienceUriMode.cs
- TypeDependencyAttribute.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- CategoryEditor.cs
- DbDataAdapter.cs
- XmlFormatExtensionPointAttribute.cs
- UniqueEventHelper.cs
- AlphabetConverter.cs
- InstanceDescriptor.cs
- ImageFormat.cs
- ConfigUtil.cs
- QueryPageSettingsEventArgs.cs
- NetTcpSection.cs
- PersonalizationStateQuery.cs
- SequenceFullException.cs
- StaticFileHandler.cs
- LineUtil.cs
- ObfuscateAssemblyAttribute.cs
- Graph.cs
- TextTreeExtractElementUndoUnit.cs
- SerializationFieldInfo.cs
- TextBounds.cs
- WebAdminConfigurationHelper.cs
- TemplateLookupAction.cs
- HttpResponseInternalWrapper.cs
- ResourceReferenceExpressionConverter.cs
- SafeFindHandle.cs
- CanonicalXml.cs
- FileDetails.cs
- RoleGroupCollection.cs
- QilSortKey.cs
- AudioSignalProblemOccurredEventArgs.cs
- HandlerBase.cs
- KeyedHashAlgorithm.cs
- RTLAwareMessageBox.cs
- PointConverter.cs
- translator.cs
- PointHitTestResult.cs
- DataTemplateKey.cs
- StylusCaptureWithinProperty.cs
- InternalReceiveMessage.cs
- ReadWriteSpinLock.cs
- WindowsTooltip.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- JavaScriptSerializer.cs
- TextLineBreak.cs
- BinHexEncoding.cs
- SBCSCodePageEncoding.cs