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

◆ CheckValue()

void System.Xml.Schema.FacetsChecker.FacetsCompiler.CheckValue ( object value,
XmlSchemaFacet facet )
inlineprivate

Definition at line 319 of file FacetsChecker.cs.

320 {
321 RestrictionFacets restriction = _datatype.Restriction;
322 switch (facet.FacetType)
323 {
324 case FacetType.MaxInclusive:
325 if ((_baseFlags & RestrictionFlags.MaxInclusive) != 0 && _datatype.Compare(value, restriction.MaxInclusive) > 0)
326 {
327 throw new XmlSchemaException(System.SR.Sch_MaxInclusiveMismatch, string.Empty);
328 }
329 if ((_baseFlags & RestrictionFlags.MaxExclusive) != 0 && _datatype.Compare(value, restriction.MaxExclusive) >= 0)
330 {
331 throw new XmlSchemaException(System.SR.Sch_MaxIncExlMismatch, string.Empty);
332 }
333 break;
334 case FacetType.MaxExclusive:
335 if ((_baseFlags & RestrictionFlags.MaxExclusive) != 0 && _datatype.Compare(value, restriction.MaxExclusive) > 0)
336 {
337 throw new XmlSchemaException(System.SR.Sch_MaxExclusiveMismatch, string.Empty);
338 }
339 if ((_baseFlags & RestrictionFlags.MaxInclusive) != 0 && _datatype.Compare(value, restriction.MaxInclusive) > 0)
340 {
341 throw new XmlSchemaException(System.SR.Sch_MaxExlIncMismatch, string.Empty);
342 }
343 break;
344 case FacetType.MinInclusive:
345 if ((_baseFlags & RestrictionFlags.MinInclusive) != 0 && _datatype.Compare(value, restriction.MinInclusive) < 0)
346 {
347 throw new XmlSchemaException(System.SR.Sch_MinInclusiveMismatch, string.Empty);
348 }
349 if ((_baseFlags & RestrictionFlags.MinExclusive) != 0 && _datatype.Compare(value, restriction.MinExclusive) < 0)
350 {
351 throw new XmlSchemaException(System.SR.Sch_MinIncExlMismatch, string.Empty);
352 }
353 if ((_baseFlags & RestrictionFlags.MaxExclusive) != 0 && _datatype.Compare(value, restriction.MaxExclusive) >= 0)
354 {
355 throw new XmlSchemaException(System.SR.Sch_MinIncMaxExlMismatch, string.Empty);
356 }
357 break;
358 case FacetType.MinExclusive:
359 if ((_baseFlags & RestrictionFlags.MinExclusive) != 0 && _datatype.Compare(value, restriction.MinExclusive) < 0)
360 {
361 throw new XmlSchemaException(System.SR.Sch_MinExclusiveMismatch, string.Empty);
362 }
363 if ((_baseFlags & RestrictionFlags.MinInclusive) != 0 && _datatype.Compare(value, restriction.MinInclusive) < 0)
364 {
365 throw new XmlSchemaException(System.SR.Sch_MinExlIncMismatch, string.Empty);
366 }
367 if ((_baseFlags & RestrictionFlags.MaxExclusive) != 0 && _datatype.Compare(value, restriction.MaxExclusive) >= 0)
368 {
369 throw new XmlSchemaException(System.SR.Sch_MinExlMaxExlMismatch, string.Empty);
370 }
371 break;
372 }
373 }
static string Sch_MinExlMaxExlMismatch
Definition SR.cs:1100
static string Sch_MinExclusiveMismatch
Definition SR.cs:1096
static string Sch_MaxIncExlMismatch
Definition SR.cs:1106
static string Sch_MaxExlIncMismatch
Definition SR.cs:1108
static string Sch_MinInclusiveMismatch
Definition SR.cs:1094
static string Sch_MaxExclusiveMismatch
Definition SR.cs:1092
static string Sch_MinIncExlMismatch
Definition SR.cs:1104
static string Sch_MaxInclusiveMismatch
Definition SR.cs:1090
static string Sch_MinIncMaxExlMismatch
Definition SR.cs:1102
static string Sch_MinExlIncMismatch
Definition SR.cs:1098
Definition SR.cs:7
int Compare(byte[] value1, byte[] value2)
readonly DatatypeImplementation _datatype

References System.Xml.Schema.FacetsChecker.FacetsCompiler._baseFlags, System.Xml.Schema.FacetsChecker.FacetsCompiler._datatype, System.Xml.Schema.DatatypeImplementation.Compare(), System.Xml.Dictionary, System.Xml.Schema.RestrictionFacets.MaxInclusive, System.Xml.Schema.DatatypeImplementation.Restriction, System.SR.Sch_MaxExclusiveMismatch, System.SR.Sch_MaxExlIncMismatch, System.SR.Sch_MaxIncExlMismatch, System.SR.Sch_MaxInclusiveMismatch, System.SR.Sch_MinExclusiveMismatch, System.SR.Sch_MinExlIncMismatch, System.SR.Sch_MinExlMaxExlMismatch, System.SR.Sch_MinIncExlMismatch, System.SR.Sch_MinInclusiveMismatch, System.SR.Sch_MinIncMaxExlMismatch, and System.value.

Referenced by System.Xml.Schema.FacetsChecker.FacetsCompiler.CompileMaxExclusiveFacet(), System.Xml.Schema.FacetsChecker.FacetsCompiler.CompileMaxInclusiveFacet(), System.Xml.Schema.FacetsChecker.FacetsCompiler.CompileMinExclusiveFacet(), and System.Xml.Schema.FacetsChecker.FacetsCompiler.CompileMinInclusiveFacet().