• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Schema.XmlSchemaFacet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Xml.Schema.XmlSchemaFacet的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaFacet类的具体用法?C# XmlSchemaFacet怎么用?C# XmlSchemaFacet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XmlSchemaFacet类属于System.Xml.Schema命名空间,在下文中一共展示了XmlSchemaFacet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CompileLengthFacet

 internal void CompileLengthFacet(XmlSchemaFacet facet) {
     CheckProhibitedFlag(facet, RestrictionFlags.Length, Res.Sch_LengthFacetProhibited);
     CheckDupFlag(facet, RestrictionFlags.Length, Res.Sch_DupLengthFacet);
     derivedRestriction.Length = XmlBaseConverter.DecimalToInt32((decimal)ParseFacetValue(nonNegativeInt, facet, Res.Sch_LengthFacetInvalid, null, null));
     
     if ((baseFixedFlags & RestrictionFlags.Length) != 0) {
         if (!datatype.IsEqual(datatype.Restriction.Length, derivedRestriction.Length)) {
             throw new XmlSchemaException(Res.Sch_FacetBaseFixed, facet);
         }
     }
     if ((baseFlags & RestrictionFlags.Length) != 0) {
         if (datatype.Restriction.Length < derivedRestriction.Length) {
             throw new XmlSchemaException(Res.Sch_LengthGtBaseLength, facet);
         }
     }
     // If the base has the MinLength facet, check that our derived length is not violating it
     if ((baseFlags & RestrictionFlags.MinLength) != 0) {
         if (datatype.Restriction.MinLength > derivedRestriction.Length) {
             throw new XmlSchemaException(Res.Sch_MaxMinLengthBaseLength, facet);
         }
     }
     // If the base has the MaxLength facet, check that our derived length is not violating it
     if ((baseFlags & RestrictionFlags.MaxLength) != 0) {
         if (datatype.Restriction.MaxLength < derivedRestriction.Length) {
             throw new XmlSchemaException(Res.Sch_MaxMinLengthBaseLength, facet);
         }
     }
     SetFlag(facet, RestrictionFlags.Length);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:29,代码来源:FacetChecker.cs


示例2: Write_XmlSchemaFacet

 private void Write_XmlSchemaFacet(string name, XmlSchemaFacet o)
 {
     if (o != null)
     {
         this.WriteStartElement(name);
         this.WriteAttribute("id", "", o.Id);
         this.WriteAttribute("value", "", o.Value);
         if (o.IsFixed)
         {
             this.WriteAttribute("fixed", "", XmlConvert.ToString(o.IsFixed));
         }
         this.WriteAttributes(o.UnhandledAttributes, o);
         this.Write5_XmlSchemaAnnotation(o.Annotation);
         this.WriteEndElement();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:SchemaObjectWriter.cs


示例3: OnLoadFacet

        /// <summary>
        /// Loads a facet for this property.
        /// </summary>
        /// <param name="facet">The facet to load for this property.</param>
        protected override void OnLoadFacet(XmlSchemaFacet facet)
        {
            base.OnLoadFacet(facet);

            var maxLengthFacet = facet as XmlSchemaMaxLengthFacet;

            if (maxLengthFacet != null)
            {
                int.TryParse(maxLengthFacet.Value, out _iMaxLength);
            }
            else
            {
                var lengthFacet = facet as XmlSchemaLengthFacet;

                if (lengthFacet != null)
                {
                    int.TryParse(lengthFacet.Value, out _iMaxLength);
                }
            }
        }
开发者ID:RyanFarley,项目名称:SDataCSharpClientLib,代码行数:24,代码来源:SMEArrayProperty.cs


示例4: AddNonXsdPrimitive

 private static void AddNonXsdPrimitive(Type type, string dataTypeName, string ns, string formatterName, XmlQualifiedName baseTypeName, XmlSchemaFacet[] facets, TypeFlags flags)
 {
     XmlSchemaSimpleType dataType = new XmlSchemaSimpleType {
         Name = dataTypeName
     };
     XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction {
         BaseTypeName = baseTypeName
     };
     foreach (XmlSchemaFacet facet in facets)
     {
         restriction.Facets.Add(facet);
     }
     dataType.Content = restriction;
     TypeDesc desc = new TypeDesc(type, false, dataType, formatterName, flags);
     if (primitiveTypes[type] == null)
     {
         primitiveTypes.Add(type, desc);
     }
     primitiveDataTypes.Add(dataType, desc);
     primitiveNames.Add(dataTypeName, ns, desc);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:21,代码来源:TypeScope.cs


示例5: CheckDupFlag

 private void CheckDupFlag(XmlSchemaFacet facet, RestrictionFlags flag, string errorCode) {
     if ((derivedRestriction.Flags & flag) != 0) {
         throw new XmlSchemaException(errorCode, facet);
     }
 }
开发者ID:uQr,项目名称:referencesource,代码行数:5,代码来源:FacetChecker.cs


示例6: CheckValue

        private void CheckValue(object value, XmlSchemaFacet facet) {
            RestrictionFacets restriction = datatype.Restriction;
            switch (facet.FacetType) {
                case FacetType.MaxInclusive:
                    if ((baseFlags & RestrictionFlags.MaxInclusive) != 0) { //Base facet has maxInclusive
                        if (datatype.Compare(value, restriction.MaxInclusive) > 0) {
                            throw new XmlSchemaException(Res.Sch_MaxInclusiveMismatch, string.Empty);
                        }
                    }
                    if ((baseFlags & RestrictionFlags.MaxExclusive) != 0) { //Base facet has maxExclusive
                        if (datatype.Compare(value, restriction.MaxExclusive) >= 0) {
                            throw new XmlSchemaException(Res.Sch_MaxIncExlMismatch, string.Empty);
                        }
                    }
                break;

                case FacetType.MaxExclusive:
                    if ((baseFlags & RestrictionFlags.MaxExclusive) != 0) { //Base facet has maxExclusive
                        if (datatype.Compare(value, restriction.MaxExclusive) > 0) {
                            throw new XmlSchemaException(Res.Sch_MaxExclusiveMismatch, string.Empty);
                        }
                    }
                    if ((baseFlags & RestrictionFlags.MaxInclusive) != 0) { //Base facet has maxInclusive
                        if (datatype.Compare(value, restriction.MaxInclusive) > 0) {
                            throw new XmlSchemaException(Res.Sch_MaxExlIncMismatch, string.Empty);
                        }
                    }
                break;

                case FacetType.MinInclusive:
                    if ((baseFlags & RestrictionFlags.MinInclusive) != 0) { //Base facet has minInclusive
                        if (datatype.Compare(value, restriction.MinInclusive) < 0) {
                            throw new XmlSchemaException(Res.Sch_MinInclusiveMismatch, string.Empty);
                        }
                    }
                    if ((baseFlags & RestrictionFlags.MinExclusive) != 0) { //Base facet has minExclusive
                        if (datatype.Compare(value, restriction.MinExclusive) < 0) {
                            throw new XmlSchemaException(Res.Sch_MinIncExlMismatch, string.Empty);
                        }
                    }
                    if ((baseFlags & RestrictionFlags.MaxExclusive) != 0) { //Base facet has maxExclusive
                        if (datatype.Compare(value, restriction.MaxExclusive) >= 0) {
                            throw new XmlSchemaException(Res.Sch_MinIncMaxExlMismatch, string.Empty);
                        }
                    }
                break;

                case FacetType.MinExclusive:
                    if ((baseFlags & RestrictionFlags.MinExclusive) != 0) { //Base facet has minExclusive
                        if (datatype.Compare(value, restriction.MinExclusive) < 0) {
                            throw new XmlSchemaException(Res.Sch_MinExclusiveMismatch, string.Empty);
                        }
                    }
                    if ((baseFlags & RestrictionFlags.MinInclusive) != 0) { //Base facet has minInclusive
                        if (datatype.Compare(value, restriction.MinInclusive) < 0) {
                            throw new XmlSchemaException(Res.Sch_MinExlIncMismatch, string.Empty);
                        }
                    }
                    if ((baseFlags & RestrictionFlags.MaxExclusive) != 0) { //Base facet has maxExclusive
                        if (datatype.Compare(value, restriction.MaxExclusive) >= 0) {
                            throw new XmlSchemaException(Res.Sch_MinExlMaxExlMismatch, string.Empty);
                        }
                    }
                break;

                default:
                    Debug.Assert(false);
                break;
            }
        }
开发者ID:uQr,项目名称:referencesource,代码行数:70,代码来源:FacetChecker.cs


示例7: CompileTotalDigitsFacet

 internal void CompileTotalDigitsFacet(XmlSchemaFacet facet) {
     CheckProhibitedFlag(facet, RestrictionFlags.TotalDigits, Res.Sch_TotalDigitsFacetProhibited);
     CheckDupFlag(facet, RestrictionFlags.TotalDigits, Res.Sch_DupTotalDigitsFacet);
     XmlSchemaDatatype positiveInt = DatatypeImplementation.GetSimpleTypeFromTypeCode(XmlTypeCode.PositiveInteger).Datatype;                        
     derivedRestriction.TotalDigits = XmlBaseConverter.DecimalToInt32((decimal)ParseFacetValue(positiveInt, facet, Res.Sch_TotalDigitsFacetInvalid, null, null));
     
     if ((baseFixedFlags & RestrictionFlags.TotalDigits) != 0) {
         if (!datatype.IsEqual(datatype.Restriction.TotalDigits, derivedRestriction.TotalDigits)) {
             throw new XmlSchemaException(Res.Sch_FacetBaseFixed, facet);
         }
     }
     if ((baseFlags & RestrictionFlags.TotalDigits) != 0) {
         if(derivedRestriction.TotalDigits > datatype.Restriction.TotalDigits) {
             throw new XmlSchemaException(Res.Sch_TotalDigitsMismatch, string.Empty);
         }
     }
     SetFlag(facet, RestrictionFlags.TotalDigits);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:18,代码来源:FacetChecker.cs


示例8: CompileWhitespaceFacet

 internal void CompileWhitespaceFacet(XmlSchemaFacet facet) {
     CheckProhibitedFlag(facet, RestrictionFlags.WhiteSpace, Res.Sch_WhiteSpaceFacetProhibited);
     CheckDupFlag(facet, RestrictionFlags.WhiteSpace, Res.Sch_DupWhiteSpaceFacet);
     if (facet.Value == "preserve") {
         derivedRestriction.WhiteSpace = XmlSchemaWhiteSpace.Preserve;
     }
     else if (facet.Value == "replace") {
         derivedRestriction.WhiteSpace = XmlSchemaWhiteSpace.Replace;
     }
     else if (facet.Value == "collapse") {
         derivedRestriction.WhiteSpace = XmlSchemaWhiteSpace.Collapse;
     }
     else {
         throw new XmlSchemaException(Res.Sch_InvalidWhiteSpace, facet.Value, facet);
     }
     if ((baseFixedFlags & RestrictionFlags.WhiteSpace) != 0) {
         if (!datatype.IsEqual(datatype.Restriction.WhiteSpace, derivedRestriction.WhiteSpace)) {
             throw new XmlSchemaException(Res.Sch_FacetBaseFixed, facet);
         }
     }
     //Check base and derived whitespace facets
     XmlSchemaWhiteSpace baseWhitespace;
     if ((baseFlags & RestrictionFlags.WhiteSpace) != 0) {
         baseWhitespace = datatype.Restriction.WhiteSpace;
     }
     else {
         baseWhitespace = datatype.BuiltInWhitespaceFacet;
     }
     if ( baseWhitespace == XmlSchemaWhiteSpace.Collapse &&
         (derivedRestriction.WhiteSpace == XmlSchemaWhiteSpace.Replace || derivedRestriction.WhiteSpace == XmlSchemaWhiteSpace.Preserve)
     ) {
         throw new XmlSchemaException(Res.Sch_WhiteSpaceRestriction1, facet);
     }
     if (baseWhitespace == XmlSchemaWhiteSpace.Replace &&
         derivedRestriction.WhiteSpace == XmlSchemaWhiteSpace.Preserve
     ) {
         throw new XmlSchemaException(Res.Sch_WhiteSpaceRestriction2, facet);
     }
     SetFlag(facet, RestrictionFlags.WhiteSpace);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:40,代码来源:FacetChecker.cs


示例9: Write_XmlSchemaFacet

 void Write_XmlSchemaFacet(string name, XmlSchemaFacet o) {
     if ((object)o == null) return;
     WriteStartElement(name);
     
     WriteAttribute("id", "", o.Id);
     WriteAttribute("value", "", o.Value);
     if (o.IsFixed) {
         WriteAttribute(@"fixed", @"", XmlConvert.ToString(o.IsFixed));
     }
     WriteAttributes((XmlAttribute[])[email protected], o);
     Write5_XmlSchemaAnnotation((XmlSchemaAnnotation)[email protected]);
     WriteEndElement();
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:13,代码来源:SchemaObjectWriter.cs


示例10: OnLoadFacet

        /// <summary>
        /// Loads a facet for this property.
        /// </summary>
        /// <param name="facet">The facet to load for this property.</param>
        protected override void OnLoadFacet(XmlSchemaFacet facet)
        {
            base.OnLoadFacet(facet);

            var minFacet = facet as XmlSchemaMinInclusiveFacet;

            if (minFacet != null)
            {
                decimal.TryParse(minFacet.Value, out _dMin);
            }
            else
            {
                var maxFacet = facet as XmlSchemaMaxInclusiveFacet;

                if (maxFacet != null)
                {
                    decimal.TryParse(maxFacet.Value, out _dMax);
                }
                else
                {
                    var totalDigitsFacet = facet as XmlSchemaTotalDigitsFacet;

                    if (totalDigitsFacet != null)
                    {
                        int.TryParse(totalDigitsFacet.Value, out _iLength);
                    }
                    else
                    {
                        var factionFacet = facet as XmlSchemaFractionDigitsFacet;

                        if (factionFacet != null)
                        {
                            int.TryParse(factionFacet.Value, out _iDecimalPlaces);
                        }
                    }
                }
            }
        }
开发者ID:RyanFarley,项目名称:SDataCSharpClientLib,代码行数:42,代码来源:SMEDecimalProperty.cs


示例11: CompileMinLengthFacet

            internal void CompileMinLengthFacet(XmlSchemaFacet facet)
            {
                CheckProhibitedFlag(facet, RestrictionFlags.MinLength, SR.Sch_MinLengthFacetProhibited);
                CheckDupFlag(facet, RestrictionFlags.MinLength, SR.Sch_DupMinLengthFacet);
                _derivedRestriction.MinLength = XmlBaseConverter.DecimalToInt32((decimal)ParseFacetValue(_nonNegativeInt, facet, SR.Sch_MinLengthFacetInvalid, null, null));

                if ((_baseFixedFlags & RestrictionFlags.MinLength) != 0)
                {
                    if (!_datatype.IsEqual(_datatype.Restriction.MinLength, _derivedRestriction.MinLength))
                    {
                        throw new XmlSchemaException(SR.Sch_FacetBaseFixed, facet);
                    }
                }
                if ((_baseFlags & RestrictionFlags.MinLength) != 0)
                {
                    if (_datatype.Restriction.MinLength > _derivedRestriction.MinLength)
                    {
                        throw new XmlSchemaException(SR.Sch_MinLengthGtBaseMinLength, facet);
                    }
                }
                if ((_baseFlags & RestrictionFlags.Length) != 0)
                {
                    if (_datatype.Restriction.Length < _derivedRestriction.MinLength)
                    {
                        throw new XmlSchemaException(SR.Sch_MaxMinLengthBaseLength, facet);
                    }
                }
                SetFlag(facet, RestrictionFlags.MinLength);
            }
开发者ID:geoffkizer,项目名称:corefx,代码行数:29,代码来源:FacetChecker.cs


示例12: CompileMaxInclusiveFacet

            internal void CompileMaxInclusiveFacet(XmlSchemaFacet facet)
            {
                CheckProhibitedFlag(facet, RestrictionFlags.MaxInclusive, SR.Sch_MaxInclusiveFacetProhibited);
                CheckDupFlag(facet, RestrictionFlags.MaxInclusive, SR.Sch_DupMaxInclusiveFacet);
                _derivedRestriction.MaxInclusive = ParseFacetValue(_builtInType, facet, SR.Sch_MaxInclusiveFacetInvalid, null, null);

                if ((_baseFixedFlags & RestrictionFlags.MaxInclusive) != 0)
                {
                    if (!_datatype.IsEqual(_datatype.Restriction.MaxInclusive, _derivedRestriction.MaxInclusive))
                    {
                        throw new XmlSchemaException(SR.Sch_FacetBaseFixed, facet);
                    }
                }
                CheckValue(_derivedRestriction.MaxInclusive, facet);
                SetFlag(facet, RestrictionFlags.MaxInclusive);
            }
开发者ID:geoffkizer,项目名称:corefx,代码行数:16,代码来源:FacetChecker.cs


示例13: checkMinLengthFacet

		private void checkMinLengthFacet(XmlSchemaMinLengthFacet minlf, 
																		 XmlSchemaFacet.Facet facetsDefined,
																		 ValidationEventHandler h) {
				if (minlf != null) {
					try {
						if (lengthFacet >=0) 
							minlf.error(h, "It is an error for both length and minLength or maxLength to be present.");
						else {
						decimal newMinLengthFacet = decimal.Parse (minlf.Value.Trim (), lengthStyle, CultureInfo.InvariantCulture);
						
						if (((fixedFacets & XmlSchemaFacet.Facet.minLength)!=0) && (newMinLengthFacet != minLengthFacet)) 
							minlf.error(h, String.Format(CultureInfo.InvariantCulture, "The value '{0}' is not the same as the fixed value '{1}' on the base type", minlf.Value.Trim (), minLengthFacet));
						if (newMinLengthFacet < minLengthFacet) 
							minlf.error(h, String.Format(CultureInfo.InvariantCulture, "The value '{0}' is not a valid restriction of the value '{1}' on the base minLength facet", minlf.Value.Trim (), minLengthFacet));
						else
							minLengthFacet = newMinLengthFacet;
							if (minLengthFacet < 0) 
								minlf.error(h, "The value '" + minLengthFacet + "' is an invalid minLength");
							if (maxLengthFacet >=0 && minLengthFacet > maxLengthFacet)
								minlf.error(h, "minLength is greater than maxLength.");
						}
				} catch (FormatException) {
						minlf.error (h, "The value '" + minlf.Value + "' is an invalid minLength facet specification");
					}
				}
			}
开发者ID:nobled,项目名称:mono,代码行数:26,代码来源:XmlSchemaSimpleTypeRestriction.cs


示例14: checkLengthFacet

		private void checkLengthFacet(XmlSchemaLengthFacet lf,	
																	XmlSchemaFacet.Facet facetsDefined, 
																	ValidationEventHandler h) {
				if (lf != null) {
					try {
					if ((facetsDefined & (XmlSchemaFacet.Facet.minLength | XmlSchemaFacet.Facet.maxLength)) != 0)  
							lf.error(h, "It is an error for both length and minLength or maxLength to be present.");
						else {
							lengthFacet = decimal.Parse (lf.Value.Trim (), lengthStyle, CultureInfo.InvariantCulture);
						/* TODO: Check that it is between inherited max/min lengths */
							if (lengthFacet < 0) 
								lf.error(h, "The value '" + lengthFacet + "' is an invalid length");
						}
				} catch (FormatException) { // FIXME: better catch ;-(
						lf.error (h, "The value '" + lf.Value + "' is an invalid length facet specification");
					}
				}
		}
开发者ID:nobled,项目名称:mono,代码行数:18,代码来源:XmlSchemaSimpleTypeRestriction.cs


示例15: checkMinMaxFacet

		private void checkMinMaxFacet(XmlSchemaFacet facet, 
																		ref object baseFacet,
																		ValidationEventHandler h) { 
// Is it a valid instance of the base type.
		 object newValue = ValidateValueWithDatatype(facet.Value);
		 if (newValue != null) {
// Is the base fixed - if so is it the same
			 if (((fixedFacets & facet.ThisFacet) != 0)  && (baseFacet != null)){
				 XsdAnySimpleType dt = getDatatype();
				 if (dt.Compare (newValue, baseFacet) != XsdOrdering.Equal) {
					 facet.error (h, 
							 String.Format(CultureInfo.InvariantCulture, "{0} is not the same as fixed parent {1} facet.", 
										 facet.Value, facet.ThisFacet));
				 }
			 }
			 baseFacet = newValue;
		 }
		 else {
			 facet.error(h, 
					 String.Format("The value '{0}' is not valid against the base type.", facet.Value));
		 }
		}
开发者ID:nobled,项目名称:mono,代码行数:22,代码来源:XmlSchemaSimpleTypeRestriction.cs


示例16: OnLoadFacet

        /// <summary>
        /// Loads a facet for this property.
        /// </summary>
        /// <param name="facet">The facet to load for this property.</param>
        protected override void OnLoadFacet(XmlSchemaFacet facet)
        {
            base.OnLoadFacet(facet);

            var minFacet = facet as XmlSchemaMinInclusiveFacet;

            if (minFacet != null)
            {
                ushort.TryParse(minFacet.Value, out _usMin);
            }
            else
            {
                var maxFacet = facet as XmlSchemaMaxInclusiveFacet;

                if (maxFacet != null)
                {
                    ushort.TryParse(maxFacet.Value, out _usMax);
                }
                else
                {
                    var totalDigitsFacet = facet as XmlSchemaTotalDigitsFacet;

                    if (totalDigitsFacet != null)
                        int.TryParse(totalDigitsFacet.Value, out _iLength);
                }
            }
        }
开发者ID:RyanFarley,项目名称:SDataCSharpClientLib,代码行数:31,代码来源:SMEUnsignedShortProperty.cs


示例17: SetContainer


//.........这里部分代码省略.........
         case State.AttributeGroup:
             this.attributeGroup = (XmlSchemaAttributeGroup)container;
             break;
         case State.AttributeGroupRef:
             this.attributeGroupRef = (XmlSchemaAttributeGroupRef)container;
             break;
         case State.AnyAttribute:
             this.anyAttribute = (XmlSchemaAnyAttribute)container;
             break;
         case State.Group:
             this.group = (XmlSchemaGroup)container;
             break;
         case State.GroupRef:
             this.groupRef = (XmlSchemaGroupRef)container;
             break;
         case State.All:
             this.all = (XmlSchemaAll)container;
             break;
         case State.Choice:
             this.choice = (XmlSchemaChoice)container;
             break;
         case State.Sequence:
             this.sequence = (XmlSchemaSequence)container;
             break;
         case State.Any:
             this.anyElement = (XmlSchemaAny)container;
             break;
         case State.Notation:
             this.notation = (XmlSchemaNotation)container;
             break;
         case State.SimpleType:
             this.simpleType = (XmlSchemaSimpleType)container;
             break;
         case State.ComplexType:
             this.complexType = (XmlSchemaComplexType)container;
             break;
         case State.ComplexContent:
             this.complexContent = (XmlSchemaComplexContent)container;
             break;
         case State.ComplexContentExtension:
             this.complexContentExtension = (XmlSchemaComplexContentExtension)container;
             break;
         case State.ComplexContentRestriction:
             this.complexContentRestriction = (XmlSchemaComplexContentRestriction)container;
             break;
         case State.SimpleContent:
             this.simpleContent = (XmlSchemaSimpleContent)container;
             break;
         case State.SimpleContentExtension:
             this.simpleContentExtension = (XmlSchemaSimpleContentExtension)container;
             break;
         case State.SimpleContentRestriction:
             this.simpleContentRestriction = (XmlSchemaSimpleContentRestriction)container;
             break;
         case State.SimpleTypeUnion:
             this.simpleTypeUnion = (XmlSchemaSimpleTypeUnion)container;
             break;
         case State.SimpleTypeList:
             this.simpleTypeList = (XmlSchemaSimpleTypeList)container;
             break;
         case State.SimpleTypeRestriction:
             this.simpleTypeRestriction = (XmlSchemaSimpleTypeRestriction)container;
             break;
         case State.Unique:
         case State.Key:
         case State.KeyRef:
             this.identityConstraint = (XmlSchemaIdentityConstraint)container;
             break;
         case State.Selector:
         case State.Field:
             this.xpath = (XmlSchemaXPath)container;
             break;
         case State.MinExclusive:
         case State.MinInclusive:
         case State.MaxExclusive:
         case State.MaxInclusive:
         case State.TotalDigits:
         case State.FractionDigits:
         case State.Length:
         case State.MinLength:
         case State.MaxLength:
         case State.Enumeration:
         case State.Pattern:
         case State.WhiteSpace:
             this.facet = (XmlSchemaFacet)container;
             break;
         case State.AppInfo:
             this.appInfo = (XmlSchemaAppInfo)container;
             break;
         case State.Documentation:
             this.documentation = (XmlSchemaDocumentation)container;
             break;
         case State.Redefine:
             this.redefine = (XmlSchemaRedefine)container;
             break;
         default:
             Debug.Assert(false, "State is " + state);
             break;
     }
 }
开发者ID:uQr,项目名称:referencesource,代码行数:101,代码来源:XsdBuilder.cs


示例18: CheckFixedFlag

 private void CheckFixedFlag(XmlSchemaFacet facet, RestrictionFlags fixedFlags, RestrictionFlags flag) {
     if ((fixedFlags & flag) != 0) {
         throw new XmlSchemaException(Res.Sch_FacetBaseFixed, facet);
     }
 }
开发者ID:ArildF,项目名称:masters,代码行数:5,代码来源:datatypeimplementation.cs


示例19: CompileEnumerationFacet

 internal void CompileEnumerationFacet(XmlSchemaFacet facet, IXmlNamespaceResolver nsmgr, XmlNameTable nameTable) {
     CheckProhibitedFlag(facet, RestrictionFlags.Enumeration, Res.Sch_EnumerationFacetProhibited);
     if (derivedRestriction.Enumeration == null) {
         derivedRestriction.Enumeration = new ArrayList();
     }
     derivedRestriction.Enumeration.Add(ParseFacetValue(datatype, facet, Res.Sch_EnumerationFacetInvalid, nsmgr, nameTable));
     SetFlag(facet, RestrictionFlags.Enumeration);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:8,代码来源:FacetChecker.cs


示例20: CheckProhibitedFlag

 private void CheckProhibitedFlag(XmlSchemaFacet facet, RestrictionFlags validRestrictionFlags, RestrictionFlags flag, string errorCode) {
     if ((validRestrictionFlags & flag) == 0) {
         if(!valueType.Name.Equals("String[]"))
             throw new XmlSchemaException(errorCode, valueType.Name, facet);
         else
             throw new XmlSchemaException(errorCode, "IDREFS, NMTOKENS, ENTITIES", facet);
     }
 }
开发者ID:ArildF,项目名称:masters,代码行数:8,代码来源:datatypeimplementation.cs



注:本文中的System.Xml.Schema.XmlSchemaFacet类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Schema.XmlSchemaGroupBase类代码示例发布时间:2022-05-26
下一篇:
C# Schema.XmlSchemaException类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap