Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- BinarySerializer.cs
- XmlSchemaExporter.cs
- Keywords.cs
- PerformanceCounterPermissionEntryCollection.cs
- DataSourceSelectArguments.cs
- RelativeSource.cs
- InputLanguageSource.cs
- ToolStripPanelRow.cs
- TextClipboardData.cs
- ObservableCollection.cs
- ControlParameter.cs
- StreamedWorkflowDefinitionContext.cs
- XslAstAnalyzer.cs
- _OSSOCK.cs
- ProcessingInstructionAction.cs
- DataSourceSelectArguments.cs
- DataObjectMethodAttribute.cs
- WindowsToolbar.cs
- DrawingContextWalker.cs
- SqlCommandBuilder.cs
- ManifestBasedResourceGroveler.cs
- OleDbConnectionFactory.cs
- TextElement.cs
- TypeReference.cs
- KeyTimeConverter.cs
- InvokeWebServiceDesigner.cs
- EdmSchemaAttribute.cs
- ImageButton.cs
- ServerProtocol.cs
- HttpStreamMessageEncoderFactory.cs
- ObjectManager.cs
- GiveFeedbackEventArgs.cs
- MessageSmuggler.cs
- NullableConverter.cs
- SqlDataRecord.cs
- DataGridItemCollection.cs
- SqlGenerator.cs
- DataBoundControlAdapter.cs
- Polygon.cs
- CompModSwitches.cs
- ObjectAnimationUsingKeyFrames.cs
- TreeNodeStyleCollection.cs
- CodeAttributeArgumentCollection.cs
- QilBinary.cs
- Int16AnimationUsingKeyFrames.cs
- Section.cs
- ResolveCriteriaApril2005.cs
- ByteKeyFrameCollection.cs
- DateTimeSerializationSection.cs
- XmlKeywords.cs
- SQLDouble.cs
- JavaScriptString.cs
- SmiMetaData.cs
- UrlPropertyAttribute.cs
- HitTestResult.cs
- TimeSpan.cs
- XmlSerializerFactory.cs
- arc.cs
- CompositeScriptReferenceEventArgs.cs
- SqlSupersetValidator.cs
- util.cs
- SQLRoleProvider.cs
- Stylesheet.cs
- QilDataSource.cs
- BamlLocalizationDictionary.cs
- ProcessRequestArgs.cs
- RequestDescription.cs
- ReadOnlyPermissionSet.cs
- MappingMetadataHelper.cs
- MembershipValidatePasswordEventArgs.cs
- FormatException.cs
- HttpDictionary.cs
- _IPv4Address.cs
- QilFactory.cs
- PeerObject.cs
- ObjectDataSourceWizardForm.cs
- rsa.cs
- ArgumentNullException.cs
- FontDriver.cs
- SqlConnectionHelper.cs
- StateRuntime.cs
- EmptyStringExpandableObjectConverter.cs
- WinFormsComponentEditor.cs
- SlipBehavior.cs
- FixedHyperLink.cs
- ContractNamespaceAttribute.cs
- ApplicationDirectoryMembershipCondition.cs
- PaperSource.cs
- NameHandler.cs
- EditCommandColumn.cs
- HatchBrush.cs
- WindowsListBox.cs
- DataServiceExpressionVisitor.cs
- While.cs
- FixedFlowMap.cs
- InvokeMethod.cs
- HelloMessageApril2005.cs
- AsnEncodedData.cs
- CachedRequestParams.cs
- PrintPreviewGraphics.cs