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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GestureRecognitionResult.cs
- recordstate.cs
- InputLangChangeEvent.cs
- ListViewUpdatedEventArgs.cs
- GenericTypeParameterBuilder.cs
- ReadOnlyMetadataCollection.cs
- DbConnectionPoolGroupProviderInfo.cs
- HtmlWindow.cs
- MediaTimeline.cs
- ToolStripRenderEventArgs.cs
- RoleBoolean.cs
- BrowserDefinitionCollection.cs
- SelectionRange.cs
- DataGridState.cs
- cookiecollection.cs
- HtmlObjectListAdapter.cs
- SHA256Managed.cs
- TargetConverter.cs
- ConstraintConverter.cs
- TimeManager.cs
- activationcontext.cs
- XmlNotation.cs
- LOSFormatter.cs
- SplashScreen.cs
- EntityContainer.cs
- DockingAttribute.cs
- RuntimeIdentifierPropertyAttribute.cs
- updatecommandorderer.cs
- RegexInterpreter.cs
- RawStylusInputReport.cs
- ExpandableObjectConverter.cs
- BasicViewGenerator.cs
- WebPermission.cs
- InternalEnumValidatorAttribute.cs
- _OSSOCK.cs
- EntityClassGenerator.cs
- Calendar.cs
- PointAnimationClockResource.cs
- TextServicesPropertyRanges.cs
- EllipseGeometry.cs
- ConnectionPoint.cs
- WebPartConnectionsCancelVerb.cs
- ColorConverter.cs
- StartFileNameEditor.cs
- EpmCustomContentSerializer.cs
- XmlNodeList.cs
- ToolStripContentPanel.cs
- URLAttribute.cs
- RbTree.cs
- DesignerVerb.cs
- SchemaComplexType.cs
- StrongNamePublicKeyBlob.cs
- DateRangeEvent.cs
- OperationCanceledException.cs
- FormsAuthenticationTicket.cs
- Parser.cs
- DeclaredTypeValidatorAttribute.cs
- ComplexObject.cs
- BinaryMessageEncodingBindingElement.cs
- RbTree.cs
- ExpressionBuilder.cs
- VisualStyleTypesAndProperties.cs
- SpellerHighlightLayer.cs
- DependencyPropertyKey.cs
- Events.cs
- XmlObjectSerializerReadContextComplexJson.cs
- ResXDataNode.cs
- DocComment.cs
- ServiceBusyException.cs
- ImmComposition.cs
- TabControlEvent.cs
- DataViewManager.cs
- FlowPosition.cs
- FieldInfo.cs
- TransformCollection.cs
- RayMeshGeometry3DHitTestResult.cs
- MenuStrip.cs
- RectangleHotSpot.cs
- ErrorWrapper.cs
- LostFocusEventManager.cs
- ThousandthOfEmRealDoubles.cs
- OdbcConnectionStringbuilder.cs
- Assembly.cs
- ParallelTimeline.cs
- IndicCharClassifier.cs
- FileLevelControlBuilderAttribute.cs
- SelectionBorderGlyph.cs
- Transform.cs
- TimeSpanMinutesConverter.cs
- PermissionToken.cs
- compensatingcollection.cs
- TdsParserHelperClasses.cs
- AttachedPropertyMethodSelector.cs
- DesignerImageAdapter.cs
- RenamedEventArgs.cs
- DBNull.cs
- CachingHintValidation.cs
- SequentialActivityDesigner.cs
- ClientTarget.cs
- LazyTextWriterCreator.cs