Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / schema / XmlSchemaInfo.cs / 1305376 / 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
- ReadOnlyCollectionBase.cs
- HttpListenerResponse.cs
- NamespaceInfo.cs
- AspProxy.cs
- MD5.cs
- MailHeaderInfo.cs
- DbCommandDefinition.cs
- OleAutBinder.cs
- Emitter.cs
- ResourceContainer.cs
- DefaultBinder.cs
- ImageMetadata.cs
- InternalControlCollection.cs
- DbConnectionHelper.cs
- categoryentry.cs
- SecuritySessionFilter.cs
- LateBoundBitmapDecoder.cs
- CodeAttributeArgumentCollection.cs
- DelegateTypeInfo.cs
- DecoderBestFitFallback.cs
- XamlSerializerUtil.cs
- NameTable.cs
- TerminateSequence.cs
- ScaleTransform.cs
- XmlRootAttribute.cs
- TableLayout.cs
- MarshalByValueComponent.cs
- sapiproxy.cs
- SQLConvert.cs
- UserPersonalizationStateInfo.cs
- oledbmetadatacollectionnames.cs
- ConnectionPointCookie.cs
- PathStreamGeometryContext.cs
- TextElementCollectionHelper.cs
- MissingMemberException.cs
- UInt16Storage.cs
- SqlTriggerAttribute.cs
- FixedSOMTableCell.cs
- SqlMultiplexer.cs
- SmtpFailedRecipientsException.cs
- BitmapVisualManager.cs
- SplitContainer.cs
- ProcessThread.cs
- ISAPIRuntime.cs
- StorageModelBuildProvider.cs
- SoapIncludeAttribute.cs
- SecurityContextSecurityTokenResolver.cs
- TextTreeText.cs
- WebPartCancelEventArgs.cs
- Preprocessor.cs
- SiteMembershipCondition.cs
- StopStoryboard.cs
- Panel.cs
- ModelVisual3D.cs
- HwndHost.cs
- HttpCacheParams.cs
- ForeignKeyConstraint.cs
- RoleManagerModule.cs
- CqlWriter.cs
- MailSettingsSection.cs
- SynchronousReceiveElement.cs
- ToolZone.cs
- XNodeSchemaApplier.cs
- Ray3DHitTestResult.cs
- Int32Converter.cs
- Polygon.cs
- MimeXmlImporter.cs
- baseshape.cs
- GiveFeedbackEventArgs.cs
- MultilineStringConverter.cs
- MethodBody.cs
- FilePrompt.cs
- DisplayMemberTemplateSelector.cs
- PropertyEmitterBase.cs
- WrappedIUnknown.cs
- JsonQNameDataContract.cs
- ResourceCategoryAttribute.cs
- CodeGeneratorOptions.cs
- PeerCustomResolverSettings.cs
- TableStyle.cs
- AppSettingsReader.cs
- Splitter.cs
- ToolStripMenuItem.cs
- MachineSettingsSection.cs
- ValidationRuleCollection.cs
- WizardPanelChangingEventArgs.cs
- DelegatingTypeDescriptionProvider.cs
- SqlServices.cs
- UniformGrid.cs
- AppSettingsExpressionBuilder.cs
- FixedDSBuilder.cs
- HttpPostServerProtocol.cs
- Stack.cs
- OrderedDictionary.cs
- ISO2022Encoding.cs
- QilChoice.cs
- AsymmetricSecurityProtocol.cs
- XmlSerializationGeneratedCode.cs
- DebugView.cs
- XmlSchemaValidator.cs