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
- HttpRequestMessageProperty.cs
- UseManagedPresentationBindingElement.cs
- Simplifier.cs
- TreeNode.cs
- JavascriptCallbackMessageInspector.cs
- OutputScopeManager.cs
- SHA512CryptoServiceProvider.cs
- ObjectConverter.cs
- UInt32.cs
- CheckableControlBaseAdapter.cs
- NavigationProperty.cs
- AutoGeneratedField.cs
- WsatAdminException.cs
- Propagator.JoinPropagator.cs
- NodeFunctions.cs
- ObjectSet.cs
- SecurityKeyType.cs
- StylusPointPropertyUnit.cs
- BitSet.cs
- HMACRIPEMD160.cs
- SqlDeflator.cs
- RenamedEventArgs.cs
- HierarchicalDataTemplate.cs
- brushes.cs
- NamespaceInfo.cs
- AuthorizationPolicyTypeElementCollection.cs
- QilStrConcat.cs
- TypeLibConverter.cs
- StateItem.cs
- SubstitutionList.cs
- ProxyWebPart.cs
- GlobalizationAssembly.cs
- DrawItemEvent.cs
- DefaultValueTypeConverter.cs
- hresults.cs
- Button.cs
- EntityProviderFactory.cs
- CallbackException.cs
- SiteMapNodeItemEventArgs.cs
- Object.cs
- X509CertificateRecipientServiceCredential.cs
- OdbcEnvironment.cs
- FixedPosition.cs
- GeneralTransform3D.cs
- HashSet.cs
- TypeDescriptionProvider.cs
- BamlStream.cs
- InkCollectionBehavior.cs
- Duration.cs
- SymbolTable.cs
- OpenTypeLayoutCache.cs
- RadioButtonBaseAdapter.cs
- ContextMenu.cs
- SqlClientFactory.cs
- AnnotationAuthorChangedEventArgs.cs
- _SslStream.cs
- EntityKeyElement.cs
- ObjectMemberMapping.cs
- Metadata.cs
- AnnotationDocumentPaginator.cs
- Content.cs
- MenuBindingsEditor.cs
- ColumnPropertiesGroup.cs
- UniqueConstraint.cs
- brushes.cs
- FormViewModeEventArgs.cs
- XmlSchemaComplexContent.cs
- CodeCatchClauseCollection.cs
- CompilerState.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- basenumberconverter.cs
- ProfessionalColorTable.cs
- DispatchChannelSink.cs
- AttributeCollection.cs
- DataGridItemEventArgs.cs
- SiteIdentityPermission.cs
- Bidi.cs
- EventSchemaTraceListener.cs
- StorageFunctionMapping.cs
- xsdvalidator.cs
- InplaceBitmapMetadataWriter.cs
- DataTable.cs
- CodeTypeParameter.cs
- TemplatedWizardStep.cs
- OdbcEnvironmentHandle.cs
- ColorAnimationBase.cs
- TcpConnectionPool.cs
- PerformanceCounterScope.cs
- IconHelper.cs
- MethodMessage.cs
- updateconfighost.cs
- ToolStripTextBox.cs
- SHA512Managed.cs
- TextStore.cs
- ToolboxItemSnapLineBehavior.cs
- ProfileSection.cs
- XmlBaseReader.cs
- EntityDesignerDataSourceView.cs
- FixedSOMElement.cs
- StringUtil.cs