Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DragCompletedEventArgs.cs
- FlowSwitchDesigner.xaml.cs
- WebBrowserEvent.cs
- ContentValidator.cs
- Comparer.cs
- SimpleTextLine.cs
- KeyMatchBuilder.cs
- PersonalizationStateQuery.cs
- DataServiceExpressionVisitor.cs
- InProcStateClientManager.cs
- DataGridDetailsPresenter.cs
- GuidConverter.cs
- DebugInfoGenerator.cs
- Cursors.cs
- DataServiceQueryOfT.cs
- UserControlFileEditor.cs
- wmiprovider.cs
- UpdateException.cs
- ConnectionManagementElement.cs
- XmlUrlResolver.cs
- PropertyEmitterBase.cs
- Operators.cs
- FlowNode.cs
- WebScriptMetadataMessage.cs
- AdjustableArrowCap.cs
- AnnotationComponentChooser.cs
- CodeGeneratorOptions.cs
- CursorConverter.cs
- ParameterCollection.cs
- XmlArrayAttribute.cs
- HttpRawResponse.cs
- MemberDescriptor.cs
- CornerRadiusConverter.cs
- ReadOnlyCollectionBase.cs
- CommonGetThemePartSize.cs
- X509Extension.cs
- SchemaElementLookUpTableEnumerator.cs
- SynchronizationHandlesCodeDomSerializer.cs
- ZipFileInfo.cs
- SQLBytesStorage.cs
- WinFormsComponentEditor.cs
- ProcessingInstructionAction.cs
- BufferedWebEventProvider.cs
- DayRenderEvent.cs
- HttpCacheParams.cs
- XsdSchemaFileEditor.cs
- EntityFrameworkVersions.cs
- HttpHandlerActionCollection.cs
- CacheDict.cs
- AttributeCollection.cs
- ProtocolsConfigurationHandler.cs
- SecurityResources.cs
- TextFragmentEngine.cs
- RegexCompilationInfo.cs
- System.Data.OracleClient_BID.cs
- DataSourceConverter.cs
- Visual3DCollection.cs
- ContentFilePart.cs
- TransactionManagerProxy.cs
- Subset.cs
- SendOperation.cs
- Int32CAMarshaler.cs
- coordinatorscratchpad.cs
- ToolboxItemFilterAttribute.cs
- PropertyCondition.cs
- DocumentPageHost.cs
- ThrowHelper.cs
- EntitySqlQueryCacheEntry.cs
- Size.cs
- EventBuilder.cs
- RegisteredDisposeScript.cs
- ObfuscationAttribute.cs
- OutputCacheSettings.cs
- OdbcConnectionStringbuilder.cs
- ConstructorExpr.cs
- SmtpNegotiateAuthenticationModule.cs
- RowVisual.cs
- SmuggledIUnknown.cs
- ListViewInsertEventArgs.cs
- ProviderConnectionPointCollection.cs
- SqlGenericUtil.cs
- SoapReflectionImporter.cs
- CqlParserHelpers.cs
- XmlSchemaCompilationSettings.cs
- XmlArrayItemAttributes.cs
- Stroke2.cs
- DPAPIProtectedConfigurationProvider.cs
- MemberRelationshipService.cs
- ConfigXmlSignificantWhitespace.cs
- CompositionCommandSet.cs
- TrackPointCollection.cs
- TextSpan.cs
- HttpTransportSecurityElement.cs
- _RequestCacheProtocol.cs
- ContentTextAutomationPeer.cs
- MenuItemCollection.cs
- SingleQueryOperator.cs
- HttpEncoderUtility.cs
- CodeIterationStatement.cs
- CodeCatchClauseCollection.cs