Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / schema / XmlSchemaParticle.cs / 1 / XmlSchemaParticle.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Schema { using System.Xml.Serialization; ////// /// public abstract class XmlSchemaParticle : XmlSchemaAnnotated { [Flags] enum Occurs { None, Min, Max }; decimal minOccurs = decimal.One; decimal maxOccurs = decimal.One; Occurs flags = Occurs.None; ///[To be supplied.] ////// /// [XmlAttribute("minOccurs")] public string MinOccursString { get { return (flags & Occurs.Min) == 0 ? null : XmlConvert.ToString(minOccurs); } set { if (value == null) { minOccurs = decimal.One; flags &= ~Occurs.Min; } else { minOccurs = XmlConvert.ToInteger(value); if (minOccurs < decimal.Zero) { throw new XmlSchemaException(Res.Sch_MinOccursInvalidXsd, string.Empty); } flags |= Occurs.Min; } } } ///[To be supplied.] ////// /// [XmlAttribute("maxOccurs")] public string MaxOccursString { get { return (flags & Occurs.Max) == 0 ? null : (maxOccurs == decimal.MaxValue) ? "unbounded" : XmlConvert.ToString(maxOccurs); } set { if (value == null) { maxOccurs = decimal.One; flags &= ~Occurs.Max; } else { if (value == "unbounded") { maxOccurs = decimal.MaxValue; } else { maxOccurs = XmlConvert.ToInteger(value); if (maxOccurs < decimal.Zero) { throw new XmlSchemaException(Res.Sch_MaxOccursInvalidXsd, string.Empty); } else if (maxOccurs == decimal.Zero && (flags & Occurs.Min) == 0) { minOccurs = decimal.Zero; } } flags |= Occurs.Max; } } } ///[To be supplied.] ////// /// [XmlIgnore] public decimal MinOccurs { get { return minOccurs; } set { if (value < decimal.Zero || value != decimal.Truncate(value)) { throw new XmlSchemaException(Res.Sch_MinOccursInvalidXsd, string.Empty); } minOccurs = value; flags |= Occurs.Min; } } ///[To be supplied.] ////// /// [XmlIgnore] public decimal MaxOccurs { get { return maxOccurs; } set { if (value < decimal.Zero || value != decimal.Truncate(value)) { throw new XmlSchemaException(Res.Sch_MaxOccursInvalidXsd, string.Empty); } maxOccurs = value; if (maxOccurs == decimal.Zero && (flags & Occurs.Min) == 0) { minOccurs = decimal.Zero; } flags |= Occurs.Max; } } internal virtual bool IsEmpty { get { return maxOccurs == decimal.Zero; } } internal bool IsMultipleOccurrence { get { return maxOccurs > decimal.One; } } internal virtual string NameString { get { return string.Empty; } } internal XmlQualifiedName GetQualifiedName() { XmlSchemaElement elem = this as XmlSchemaElement; if (elem != null) { return elem.QualifiedName; } else { XmlSchemaAny any = this as XmlSchemaAny; if (any != null) { string ns = any.Namespace; if (ns != null) { ns = ns.Trim(); } else { ns = string.Empty; } return new XmlQualifiedName("*", ns.Length == 0 ? "##any" : ns); } } return XmlQualifiedName.Empty; //If ever called on other particles } class EmptyParticle : XmlSchemaParticle { internal override bool IsEmpty { get { return true; } } } internal static readonly XmlSchemaParticle Empty = new EmptyParticle(); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.[To be supplied.] ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MemoryMappedView.cs
- ZeroOpNode.cs
- ThicknessConverter.cs
- DataGrid.cs
- PointAnimationBase.cs
- BamlRecordReader.cs
- ObjectPersistData.cs
- UnauthorizedWebPart.cs
- ChangeToolStripParentVerb.cs
- ListViewDeleteEventArgs.cs
- PersonalizationDictionary.cs
- SchemaElementDecl.cs
- GridEntry.cs
- ColumnResult.cs
- X509ChainElement.cs
- Recipient.cs
- bindurihelper.cs
- DataBindingHandlerAttribute.cs
- PriorityItem.cs
- XPathBinder.cs
- DataConnectionHelper.cs
- Encoder.cs
- FontFamily.cs
- OpenFileDialog.cs
- StylusCollection.cs
- WebServiceFaultDesigner.cs
- TextRangeAdaptor.cs
- SmiContext.cs
- Predicate.cs
- AppearanceEditorPart.cs
- SafeNativeMethods.cs
- SelectionProviderWrapper.cs
- ThreadInterruptedException.cs
- TypePresenter.xaml.cs
- ByteAnimationUsingKeyFrames.cs
- SqlStream.cs
- WebConfigurationHostFileChange.cs
- future.cs
- ProtectedConfiguration.cs
- ControlValuePropertyAttribute.cs
- MailAddressCollection.cs
- MemberDescriptor.cs
- WebConfigurationHostFileChange.cs
- ClientOptions.cs
- CompareValidator.cs
- DocumentOrderComparer.cs
- PropertyValueUIItem.cs
- DesignUtil.cs
- CallSiteHelpers.cs
- Itemizer.cs
- EmptyEnumerator.cs
- QilXmlReader.cs
- MatrixAnimationUsingKeyFrames.cs
- DefaultParameterValueAttribute.cs
- Page.cs
- SkinBuilder.cs
- HttpProcessUtility.cs
- AppDomainCompilerProxy.cs
- Descriptor.cs
- ColorDialog.cs
- ServiceBusyException.cs
- StylusOverProperty.cs
- PublishLicense.cs
- ServicePointManager.cs
- SchemaNames.cs
- AdPostCacheSubstitution.cs
- TraceUtility.cs
- OleDbRowUpdatedEvent.cs
- GeneratedContractType.cs
- TransactionScope.cs
- RemotingException.cs
- DropDownButton.cs
- TaiwanLunisolarCalendar.cs
- ClockGroup.cs
- ImportedNamespaceContextItem.cs
- TypographyProperties.cs
- WindowsTitleBar.cs
- ContextMenuService.cs
- DocumentOrderComparer.cs
- TextElementEnumerator.cs
- RuleSettingsCollection.cs
- EventLogException.cs
- SecurityManager.cs
- ApplicationBuildProvider.cs
- WsdlServiceChannelBuilder.cs
- XsdDuration.cs
- MergeExecutor.cs
- SystemUdpStatistics.cs
- DataServiceRequestOfT.cs
- ReaderWriterLock.cs
- AttributeCollection.cs
- HealthMonitoringSectionHelper.cs
- UrlPath.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- HandlerBase.cs
- ReadOnlyActivityGlyph.cs
- OperandQuery.cs
- Script.cs
- InputMethod.cs
- CompilationLock.cs