protected virtual void Visit(XmlSchemaNumericFacet facet) { XmlSchemaFractionDigitsFacet digitsFacet; XmlSchemaLengthFacet lengthFacet; XmlSchemaMaxLengthFacet maxLengthFacet; XmlSchemaMinLengthFacet minLengthFacet; XmlSchemaTotalDigitsFacet totalDigitsFacet; if (Casting.TryCast(facet, out digitsFacet)) { Visit(digitsFacet); } else if (Casting.TryCast(facet, out lengthFacet)) { Visit(lengthFacet); } else if (Casting.TryCast(facet, out maxLengthFacet)) { Visit(maxLengthFacet); } else if (Casting.TryCast(facet, out minLengthFacet)) { Visit(minLengthFacet); } else if (Casting.TryCast(facet, out totalDigitsFacet)) { Visit(totalDigitsFacet); } else { throw ExceptionBuilder.UnexpectedSchemaObjectType(facet); } }
private static IXSFacet CreateIXSNumericFacet(XmlSchemaNumericFacet numericFacet) { if (numericFacet is XmlSchemaFractionDigitsFacet fractionDigitsFacet) { return(new XSFractionDigitsFacet(fractionDigitsFacet)); } else if (numericFacet is XmlSchemaLengthFacet lengthFacet) { return(new XSLengthFacet(lengthFacet)); } else if (numericFacet is XmlSchemaMaxLengthFacet maxLengthFacet) { return(new XSMaxLengthFacet(maxLengthFacet)); } else if (numericFacet is XmlSchemaMinLengthFacet minLengthFacet) { return(new XSMinLengthFacet(minLengthFacet)); } else if (numericFacet is XmlSchemaTotalDigitsFacet totalDigitsFacet) { return(new XSTotalDigitsFacet(totalDigitsFacet)); } else { throw RuntimeException.InvalidArgumentType(); } }