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

◆ VerifyNativeDigits()

static void System.Globalization.NumberFormatInfo.VerifyNativeDigits ( string[] nativeDig,
string propertyName )
inlinestaticprivate

Definition at line 574 of file NumberFormatInfo.cs.

575 {
576 if (nativeDig == null)
577 {
578 throw new ArgumentNullException(propertyName, SR.ArgumentNull_Array);
579 }
580 if (nativeDig.Length != 10)
581 {
582 throw new ArgumentException(SR.Argument_InvalidNativeDigitCount, propertyName);
583 }
584 for (int i = 0; i < nativeDig.Length; i++)
585 {
586 if (nativeDig[i] == null)
587 {
588 throw new ArgumentNullException(propertyName, SR.ArgumentNull_ArrayValue);
589 }
590 if (nativeDig[i].Length != 1)
591 {
592 if (nativeDig[i].Length != 2)
593 {
594 throw new ArgumentException(SR.Argument_InvalidNativeDigitValue, propertyName);
595 }
596 if (!char.IsSurrogatePair(nativeDig[i][0], nativeDig[i][1]))
597 {
598 throw new ArgumentException(SR.Argument_InvalidNativeDigitValue, propertyName);
599 }
600 }
601 if (CharUnicodeInfo.GetDecimalDigitValue(nativeDig[i], 0) != i && CharUnicodeInfo.GetUnicodeCategory(nativeDig[i], 0) != UnicodeCategory.PrivateUse)
602 {
603 throw new ArgumentException(SR.Argument_InvalidNativeDigitValue, propertyName);
604 }
605 }
606 }

References System.SR.Argument_InvalidNativeDigitCount, System.SR.Argument_InvalidNativeDigitValue, System.SR.ArgumentNull_Array, System.SR.ArgumentNull_ArrayValue, System.Globalization.CharUnicodeInfo.GetDecimalDigitValue(), and System.Globalization.CharUnicodeInfo.GetUnicodeCategory().