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
- WebSysDescriptionAttribute.cs
- XmlCustomFormatter.cs
- SessionSwitchEventArgs.cs
- CapacityStreamGeometryContext.cs
- Inflater.cs
- ConfigurationLocationCollection.cs
- AsnEncodedData.cs
- WorkerRequest.cs
- BitmapMetadataBlob.cs
- LightweightCodeGenerator.cs
- SimpleType.cs
- Typography.cs
- ComPlusAuthorization.cs
- GenerateTemporaryTargetAssembly.cs
- IDictionary.cs
- DataServiceProcessingPipeline.cs
- Transactions.cs
- WizardDesigner.cs
- DeviceFilterEditorDialog.cs
- WindowsAuthenticationModule.cs
- SqlComparer.cs
- querybuilder.cs
- CatalogPart.cs
- ExtensionSimplifierMarkupObject.cs
- ModelVisual3D.cs
- ParameterCollection.cs
- NetSectionGroup.cs
- NetCodeGroup.cs
- SqlCacheDependencyDatabase.cs
- Pkcs7Recipient.cs
- DataGridViewCellValidatingEventArgs.cs
- CheckBoxField.cs
- EventProviderBase.cs
- TypedRowHandler.cs
- KnownAssemblyEntry.cs
- EqualityComparer.cs
- TextContainerHelper.cs
- safelink.cs
- ProxyWebPartManager.cs
- SessionEndedEventArgs.cs
- TCPClient.cs
- ServiceReference.cs
- EmptyEnumerator.cs
- ListItemCollection.cs
- TextParagraphCache.cs
- EntityContainerEntitySet.cs
- AssemblyBuilderData.cs
- SqlDataSourceEnumerator.cs
- PasswordBox.cs
- ComponentCommands.cs
- CodeSpit.cs
- Matrix3DValueSerializer.cs
- UdpChannelFactory.cs
- XmlQualifiedName.cs
- StyleSheetComponentEditor.cs
- UseManagedPresentationBindingElement.cs
- Soap.cs
- VSWCFServiceContractGenerator.cs
- LinkLabelLinkClickedEvent.cs
- FormatPage.cs
- SqlDataSourceCache.cs
- MouseDevice.cs
- NameTable.cs
- MenuItemStyle.cs
- Point4DConverter.cs
- SelectorItemAutomationPeer.cs
- SchemaCreator.cs
- AppDomainUnloadedException.cs
- TextureBrush.cs
- JsonEncodingStreamWrapper.cs
- SupportsEventValidationAttribute.cs
- InvokeCompletedEventArgs.cs
- ZipIORawDataFileBlock.cs
- MultiAsyncResult.cs
- Size3DConverter.cs
- StrokeCollection.cs
- SqlDependencyUtils.cs
- SplitContainerDesigner.cs
- StreamSecurityUpgradeProvider.cs
- COM2Properties.cs
- HtmlElementCollection.cs
- DispatcherTimer.cs
- DynamicMethod.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- DelegateHelpers.cs
- CriticalExceptions.cs
- ControlEvent.cs
- Shape.cs
- ScrollChangedEventArgs.cs
- EventLevel.cs
- BitmapEncoder.cs
- FileSystemEventArgs.cs
- StreamGeometry.cs
- EditorZone.cs
- OutputCacheProfileCollection.cs
- SHA256CryptoServiceProvider.cs
- UndoEngine.cs
- DurableErrorHandler.cs
- ServiceOperation.cs
- LiteralControl.cs