Code:
/ DotNET / DotNET / 8.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
- RoleManagerModule.cs
- MergeFailedEvent.cs
- SettingsAttributes.cs
- SafeNativeMemoryHandle.cs
- BitmapMetadata.cs
- AnnotationDocumentPaginator.cs
- ExpressionHelper.cs
- SafeMILHandleMemoryPressure.cs
- keycontainerpermission.cs
- NamedElement.cs
- XamlStream.cs
- GridErrorDlg.cs
- ToolStripSeparator.cs
- GroupBox.cs
- ExpandableObjectConverter.cs
- DbCommandDefinition.cs
- ViewManagerAttribute.cs
- SerialPinChanges.cs
- SplitterCancelEvent.cs
- PathParser.cs
- EntityDataSourceEntityTypeFilterItem.cs
- GenericWebPart.cs
- CanonicalXml.cs
- DefaultAssemblyResolver.cs
- LongMinMaxAggregationOperator.cs
- DocumentViewerHelper.cs
- FixedBufferAttribute.cs
- LostFocusEventManager.cs
- BaseTemplateCodeDomTreeGenerator.cs
- HMACRIPEMD160.cs
- WebPartDescriptionCollection.cs
- TabItem.cs
- RSAOAEPKeyExchangeDeformatter.cs
- TabItemWrapperAutomationPeer.cs
- ToolStripMenuItem.cs
- OleDbRowUpdatedEvent.cs
- PackageProperties.cs
- ConfigXmlText.cs
- OleDbParameter.cs
- CachedTypeface.cs
- SHA384.cs
- ButtonFieldBase.cs
- InvalidEnumArgumentException.cs
- ControlBuilderAttribute.cs
- WSSecureConversationFeb2005.cs
- MatrixAnimationUsingPath.cs
- PenThreadPool.cs
- DataSourceXmlSerializer.cs
- ClientSponsor.cs
- TdsParserStateObject.cs
- DataGridTablesFactory.cs
- BinaryEditor.cs
- ActivityMarkupSerializer.cs
- ServiceDocument.cs
- TrackingLocationCollection.cs
- ClickablePoint.cs
- ResourceDescriptionAttribute.cs
- RowVisual.cs
- MetabaseServerConfig.cs
- smtppermission.cs
- OlePropertyStructs.cs
- WebPartEditorApplyVerb.cs
- ComplexLine.cs
- SemanticValue.cs
- SignatureDescription.cs
- PerfCounterSection.cs
- HttpHandlersInstallComponent.cs
- EditorPartChrome.cs
- XsltLibrary.cs
- ElementHostPropertyMap.cs
- Baml2006Reader.cs
- ManagedFilter.cs
- AuthorizationSection.cs
- InstanceCreationEditor.cs
- LeafCellTreeNode.cs
- ToolStripLabel.cs
- BookmarkList.cs
- ListViewDesigner.cs
- PublisherIdentityPermission.cs
- Validator.cs
- SQLRoleProvider.cs
- PropertyManager.cs
- WinFormsSpinner.cs
- SineEase.cs
- ResourceDisplayNameAttribute.cs
- ObjectDataSourceSelectingEventArgs.cs
- precedingquery.cs
- BinaryObjectInfo.cs
- CodeTypeReference.cs
- ListViewDeletedEventArgs.cs
- IndentTextWriter.cs
- SchemaElementDecl.cs
- Form.cs
- TextBoxRenderer.cs
- DependencyPropertyConverter.cs
- XmlSerializableServices.cs
- PointCollection.cs
- ProfileService.cs
- ConditionalAttribute.cs
- HeaderElement.cs