Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ConstructRestriction()

virtual RestrictionFacets System.Xml.Schema.FacetsChecker.ConstructRestriction ( DatatypeImplementation datatype,
XmlSchemaObjectCollection facets,
XmlNameTable nameTable )
inlinepackagevirtualinherited

Definition at line 698 of file FacetsChecker.cs.

699 {
700 RestrictionFacets restrictionFacets = new RestrictionFacets();
701 FacetsCompiler facetsCompiler = new FacetsCompiler(datatype, restrictionFacets);
702 for (int i = 0; i < facets.Count; i++)
703 {
704 XmlSchemaFacet xmlSchemaFacet = (XmlSchemaFacet)facets[i];
705 if (xmlSchemaFacet.Value == null)
706 {
707 throw new XmlSchemaException(System.SR.Sch_InvalidFacet, xmlSchemaFacet);
708 }
709 IXmlNamespaceResolver nsmgr = new SchemaNamespaceManager(xmlSchemaFacet);
710 switch (xmlSchemaFacet.FacetType)
711 {
712 case FacetType.Length:
713 facetsCompiler.CompileLengthFacet(xmlSchemaFacet);
714 break;
715 case FacetType.MinLength:
716 facetsCompiler.CompileMinLengthFacet(xmlSchemaFacet);
717 break;
718 case FacetType.MaxLength:
719 facetsCompiler.CompileMaxLengthFacet(xmlSchemaFacet);
720 break;
721 case FacetType.Pattern:
722 facetsCompiler.CompilePatternFacet(xmlSchemaFacet as XmlSchemaPatternFacet);
723 break;
724 case FacetType.Enumeration:
725 facetsCompiler.CompileEnumerationFacet(xmlSchemaFacet, nsmgr, nameTable);
726 break;
727 case FacetType.Whitespace:
728 facetsCompiler.CompileWhitespaceFacet(xmlSchemaFacet);
729 break;
730 case FacetType.MinInclusive:
731 facetsCompiler.CompileMinInclusiveFacet(xmlSchemaFacet);
732 break;
733 case FacetType.MinExclusive:
734 facetsCompiler.CompileMinExclusiveFacet(xmlSchemaFacet);
735 break;
736 case FacetType.MaxInclusive:
737 facetsCompiler.CompileMaxInclusiveFacet(xmlSchemaFacet);
738 break;
739 case FacetType.MaxExclusive:
740 facetsCompiler.CompileMaxExclusiveFacet(xmlSchemaFacet);
741 break;
742 case FacetType.TotalDigits:
743 facetsCompiler.CompileTotalDigitsFacet(xmlSchemaFacet);
744 break;
745 case FacetType.FractionDigits:
746 facetsCompiler.CompileFractionDigitsFacet(xmlSchemaFacet);
747 break;
748 default:
749 throw new XmlSchemaException(System.SR.Sch_UnknownFacet, xmlSchemaFacet);
750 }
751 }
752 facetsCompiler.FinishFacetCompile();
753 facetsCompiler.CompileFacetCombinations();
754 return restrictionFacets;
755 }
static string Sch_InvalidFacet
Definition SR.cs:868
static string Sch_UnknownFacet
Definition SR.cs:678
Definition SR.cs:7

References System.Xml.Dictionary, System.Text.RegularExpressions.i, System.SR.Sch_InvalidFacet, and System.SR.Sch_UnknownFacet.

Referenced by System.Xml.Schema.DatatypeImplementation.DeriveByRestriction().