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
- AutoCompleteStringCollection.cs
- KeyProperty.cs
- DesignerDataStoredProcedure.cs
- SourceFilter.cs
- TimeManager.cs
- ValidatorUtils.cs
- RemoteWebConfigurationHostServer.cs
- SoapSchemaExporter.cs
- RoleManagerEventArgs.cs
- NegotiationTokenAuthenticator.cs
- CodeObjectCreateExpression.cs
- CompareValidator.cs
- StoreUtilities.cs
- BaseTemplateParser.cs
- TakeQueryOptionExpression.cs
- DataGridViewRowHeaderCell.cs
- BrowserCapabilitiesCodeGenerator.cs
- TrackingMemoryStreamFactory.cs
- WebPart.cs
- DragDeltaEventArgs.cs
- ThousandthOfEmRealDoubles.cs
- Int64AnimationUsingKeyFrames.cs
- PointAnimation.cs
- Enum.cs
- SQLBytesStorage.cs
- DataGridViewCell.cs
- LogWriteRestartAreaState.cs
- InputGestureCollection.cs
- GPPOINTF.cs
- PrintPreviewDialog.cs
- WebPartEditVerb.cs
- StrictAndMessageFilter.cs
- NameValueFileSectionHandler.cs
- CodeTypeMember.cs
- PopOutPanel.cs
- XsltArgumentList.cs
- EventDescriptor.cs
- QueryableFilterUserControl.cs
- BaseConfigurationRecord.cs
- ObjectCloneHelper.cs
- PerformanceCountersElement.cs
- XmlDesignerDataSourceView.cs
- InternalConfigRoot.cs
- MethodImplAttribute.cs
- Compilation.cs
- TypeUtils.cs
- ProcessModelInfo.cs
- ObjectMemberMapping.cs
- ContentType.cs
- METAHEADER.cs
- CachedFontFamily.cs
- ComplexPropertyEntry.cs
- ReaderWriterLock.cs
- EntityConnection.cs
- PerformanceCounters.cs
- InstanceDescriptor.cs
- GridItemPattern.cs
- EndpointAddressMessageFilter.cs
- RijndaelManagedTransform.cs
- KeyGestureConverter.cs
- Light.cs
- InternalSendMessage.cs
- TextChange.cs
- SerializationFieldInfo.cs
- SR.cs
- SystemKeyConverter.cs
- StylusPointPropertyInfo.cs
- FilterQuery.cs
- FontUnit.cs
- X509CertificateCollection.cs
- InternalDispatchObject.cs
- ThaiBuddhistCalendar.cs
- StrongNameMembershipCondition.cs
- NominalTypeEliminator.cs
- ReachDocumentPageSerializerAsync.cs
- TogglePatternIdentifiers.cs
- XamlValidatingReader.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- SqlClientMetaDataCollectionNames.cs
- MTConfigUtil.cs
- AssociationSet.cs
- sqlnorm.cs
- DataGridItemAutomationPeer.cs
- StringUtil.cs
- CollectionConverter.cs
- PartialCachingAttribute.cs
- FunctionOverloadResolver.cs
- GenerateTemporaryTargetAssembly.cs
- TaskbarItemInfo.cs
- IdentifierService.cs
- TextTreeRootNode.cs
- ServiceModelReg.cs
- FileReader.cs
- BoundsDrawingContextWalker.cs
- IisTraceListener.cs
- WorkflowFormatterBehavior.cs
- SafeRegistryKey.cs
- Accessors.cs
- AutomationElementIdentifiers.cs
- SystemNetworkInterface.cs