Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. //------------------------------------------------------------------------------ //[To be supplied.] ///// 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.[To be supplied.] ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StringComparer.cs
- DataKeyCollection.cs
- Compiler.cs
- TargetInvocationException.cs
- LoginCancelEventArgs.cs
- CommunicationException.cs
- XsdValidatingReader.cs
- TextFormatterContext.cs
- PagePropertiesChangingEventArgs.cs
- QueryMatcher.cs
- ControlCollection.cs
- ParamArrayAttribute.cs
- BamlBinaryReader.cs
- RoleGroupCollection.cs
- ObjectQuery_EntitySqlExtensions.cs
- DataStreams.cs
- ToolStripContentPanelRenderEventArgs.cs
- TreeNodeStyle.cs
- DataServiceOperationContext.cs
- ILGenerator.cs
- WebException.cs
- ConfigurationSection.cs
- TriState.cs
- EmptyEnumerable.cs
- FontUnitConverter.cs
- ByteStreamMessageEncodingElement.cs
- NavigatingCancelEventArgs.cs
- SendParametersContent.cs
- CancelEventArgs.cs
- BaseServiceProvider.cs
- BitmapDownload.cs
- UIElement3DAutomationPeer.cs
- processwaithandle.cs
- SqlUserDefinedTypeAttribute.cs
- SerialReceived.cs
- TimelineCollection.cs
- Qualifier.cs
- GridViewDeletedEventArgs.cs
- ToolStripItemClickedEventArgs.cs
- AsyncPostBackErrorEventArgs.cs
- SimpleMailWebEventProvider.cs
- BitmapEffectInput.cs
- LiteralDesigner.cs
- SecureEnvironment.cs
- SQLMoney.cs
- ContainerParaClient.cs
- LockedHandleGlyph.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- FileChangeNotifier.cs
- _DisconnectOverlappedAsyncResult.cs
- ResourceBinder.cs
- DataGridLengthConverter.cs
- ManipulationDevice.cs
- RelatedView.cs
- DataGridBoundColumn.cs
- ColumnWidthChangingEvent.cs
- BasicBrowserDialog.designer.cs
- ContainerAction.cs
- SplineKeyFrames.cs
- IndependentAnimationStorage.cs
- ColumnMap.cs
- MediaElement.cs
- TableNameAttribute.cs
- PlainXmlDeserializer.cs
- ArrayWithOffset.cs
- TemporaryBitmapFile.cs
- BindingMAnagerBase.cs
- FastEncoderWindow.cs
- ConditionCollection.cs
- TextDecorationCollection.cs
- TrackingRecord.cs
- NameTable.cs
- StateRuntime.cs
- WebCategoryAttribute.cs
- NullPackagingPolicy.cs
- DefaultPrintController.cs
- WebPartTracker.cs
- CharacterMetrics.cs
- ZipQueryOperator.cs
- DataGridViewSelectedColumnCollection.cs
- _ScatterGatherBuffers.cs
- COAUTHIDENTITY.cs
- HybridDictionary.cs
- SizeIndependentAnimationStorage.cs
- EditBehavior.cs
- FileChangesMonitor.cs
- BitmapDecoder.cs
- HttpRequestWrapper.cs
- HttpWebRequest.cs
- CollectionViewSource.cs
- HtmlDocument.cs
- ConnectionStringsExpressionBuilder.cs
- TypeSystem.cs
- AnimationTimeline.cs
- SoapCodeExporter.cs
- ObjectDataSourceSelectingEventArgs.cs
- ArgumentFixer.cs
- infer.cs
- PrtTicket_Public_Simple.cs
- x509store.cs