ParseUInt32() static private method

static private ParseUInt32 ( String value, NumberStyles options, NumberFormatInfo numfmt ) : UInt32
value String
options NumberStyles
numfmt NumberFormatInfo
return UInt32
Ejemplo n.º 1
0
 public static uint Parse(string s)
 {
     if (s == null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
     }
     return(Number.ParseUInt32(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo));
 }
Ejemplo n.º 2
0
 public static uint Parse(string s, IFormatProvider?provider)
 {
     if (s == null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
     }
     return(Number.ParseUInt32(s, NumberStyles.Integer, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 3
0
 public static uint Parse(string s, NumberStyles style)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     if (s == null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
     }
     return(Number.ParseUInt32(s, style, NumberFormatInfo.CurrentInfo));
 }
Ejemplo n.º 4
0
 public static uint Parse(String s, NumberStyles style, IFormatProvider provider)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     if (s == null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
     }
     return(Number.ParseUInt32(s.AsReadOnlySpan(), style, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 5
0
        public static ushort Parse(String s, NumberStyles style)
        {
            NumberFormatInfo.ValidateParseStyle(style);
            uint i = Number.ParseUInt32(s, style);

            if (i > MaxValue)
            {
                throw new OverflowException("Overflow_UInt16");
            }
            return((ushort)i);
        }
Ejemplo n.º 6
0
 public unsafe static UIntPtr Parse(String s, NumberStyles style)
 {
     NumberFormatInfo.ValidateParseStyle(style);
     if (sizeof(UIntPtr) == 4)
     {
         return(Number.ParseUInt32(s, style));
     }
     else
     {
         return(Number.ParseUInt64(s, style));
     }
 }
Ejemplo n.º 7
0
        public static ushort Parse(String s, NumberStyles style, IFormatProvider provider)
        {
            NumberFormatInfo info = NumberFormatInfo.GetInstance(provider);

            NumberFormatInfo.ValidateParseStyle(style);
            uint i = Number.ParseUInt32(s, style, info);

            if (i > MaxValue)
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"));
            }
            return((ushort)i);
        }
Ejemplo n.º 8
0
        private static ushort Parse(String s, NumberStyles style, NumberFormatInfo info)
        {
            uint i = 0;

            try {
                i = Number.ParseUInt32(s, style, info);
            }
            catch (OverflowException e) {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"), e);
            }

            if (i > MaxValue)
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"));
            }
            return((ushort)i);
        }
Ejemplo n.º 9
0
        // Token: 0x060014EF RID: 5359 RVA: 0x0003DECC File Offset: 0x0003C0CC
        private static ushort Parse(string s, NumberStyles style, NumberFormatInfo info)
        {
            uint num = 0U;

            try
            {
                num = Number.ParseUInt32(s, style, info);
            }
            catch (OverflowException innerException)
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"), innerException);
            }
            if (num > 65535U)
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"));
            }
            return((ushort)num);
        }
Ejemplo n.º 10
0
        private static ushort Parse(string s, NumberStyles style, NumberFormatInfo info)
        {
            uint uint32;

            try
            {
                uint32 = Number.ParseUInt32(s, style, info);
            }
            catch (OverflowException ex)
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"), (Exception)ex);
            }
            if (uint32 > (uint)ushort.MaxValue)
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"));
            }
            return((ushort)uint32);
        }
Ejemplo n.º 11
0
        private static ushort Parse(ReadOnlySpan <char> s, NumberStyles style, NumberFormatInfo info)
        {
            uint i = 0;

            try
            {
                i = Number.ParseUInt32(s, style, info);
            }
            catch (OverflowException e)
            {
                throw new OverflowException(SR.Overflow_UInt16, e);
            }

            if (i > MaxValue)
            {
                throw new OverflowException(SR.Overflow_UInt16);
            }
            return((ushort)i);
        }
Ejemplo n.º 12
0
 public static uint Parse(String s, NumberStyles style)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.ParseUInt32(s, style, NumberFormatInfo.CurrentInfo));
 }
Ejemplo n.º 13
0
 public static uint Parse(String s)
 {
     return(Number.ParseUInt32(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo));
 }
Ejemplo n.º 14
0
 public static uint Parse(ReadOnlySpan <char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider?provider = null)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.ParseUInt32(s, style, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 15
0
 public static uint Parse(String s, IFormatProvider provider)
 {
     return(Number.ParseUInt32(s, NumberStyles.Integer, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 16
0
 public static uint Parse(String s, NumberStyles style, IFormatProvider provider)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.ParseUInt32(s, style, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 17
0
 public static UIntPtr Parse(String s, NumberStyles style)
 {
     NumberFormatInfo.ValidateParseStyle(style);
     return(Number.ParseUInt32(s, style));
 }