Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / Xml / System / Xml / schema / XmlSchemaParticle.cs / 2 / 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
- CompositeTypefaceMetrics.cs
- WaitingCursor.cs
- DesignerProperties.cs
- SynchronizationFilter.cs
- Transform3DGroup.cs
- CssStyleCollection.cs
- Parallel.cs
- LazyTextWriterCreator.cs
- SQLSingleStorage.cs
- WindowsScrollBar.cs
- ContextMenuStripGroup.cs
- LinqDataSourceSelectEventArgs.cs
- WebEventTraceProvider.cs
- StructuredProperty.cs
- WebPartHeaderCloseVerb.cs
- DataKey.cs
- SecurityToken.cs
- SqlXmlStorage.cs
- ClientFactory.cs
- BlurBitmapEffect.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- bidPrivateBase.cs
- CheckBoxList.cs
- StyleConverter.cs
- KeyInterop.cs
- WriteLine.cs
- LogWriteRestartAreaAsyncResult.cs
- WindowsGraphics.cs
- DefaultTextStore.cs
- ItemPager.cs
- GetPageCompletedEventArgs.cs
- ConfigurationStrings.cs
- Baml6ConstructorInfo.cs
- SoapClientProtocol.cs
- QuadraticBezierSegment.cs
- StrongNameUtility.cs
- Property.cs
- ProfileSettingsCollection.cs
- InputManager.cs
- ArgumentReference.cs
- LogicalTreeHelper.cs
- ScriptResourceMapping.cs
- ScalarRestriction.cs
- ObjectMemberMapping.cs
- Trigger.cs
- KeyEventArgs.cs
- TypeLibConverter.cs
- validationstate.cs
- MultiByteCodec.cs
- EntitySetDataBindingList.cs
- odbcmetadatafactory.cs
- MruCache.cs
- Odbc32.cs
- BrowserCapabilitiesCompiler.cs
- ResourceContainer.cs
- SqlException.cs
- DefaultPropertyAttribute.cs
- BinHexDecoder.cs
- UnaryNode.cs
- SemanticResolver.cs
- WebColorConverter.cs
- WebPartDisplayModeCancelEventArgs.cs
- RawStylusActions.cs
- FtpWebResponse.cs
- Base64WriteStateInfo.cs
- ByteRangeDownloader.cs
- CodeParameterDeclarationExpression.cs
- CipherData.cs
- DataFormats.cs
- RtfNavigator.cs
- WebEventCodes.cs
- UpdatePanelTriggerCollection.cs
- GZipUtils.cs
- xmlNames.cs
- MiniParameterInfo.cs
- LowerCaseStringConverter.cs
- ListBox.cs
- ClientSponsor.cs
- BinHexDecoder.cs
- DataBoundControlHelper.cs
- ColumnReorderedEventArgs.cs
- CharacterHit.cs
- DefaultValueAttribute.cs
- ComponentCommands.cs
- XmlUtil.cs
- ToolStripRenderEventArgs.cs
- ProtocolsInstallComponent.cs
- SymLanguageType.cs
- LocalBuilder.cs
- OrderByExpression.cs
- ReadWriteObjectLock.cs
- TextSegment.cs
- PageParserFilter.cs
- WindowsScrollBar.cs
- WindowsStatic.cs
- DataServiceQueryOfT.cs
- Decorator.cs
- ListItemConverter.cs
- MatrixConverter.cs
- QfeChecker.cs