using System; using System.Globalization; using System.Runtime.InteropServices; using System.Threading; namespace System { /// Represents a 64-bit unsigned integer. /// 1 // Token: 0x02000012 RID: 18 [CLSCompliant(false)] [ComVisible(true)] [Serializable] public struct UInt64 : IFormattable, IConvertible, IComparable, IComparable, IEquatable { /// For a description of this member, see . /// true if the value of the current instance is not zero; otherwise, false. /// This parameter is ignored. // Token: 0x060000D1 RID: 209 RVA: 0x00004A14 File Offset: 0x00002C14 bool IConvertible.ToBoolean(IFormatProvider provider) { return Convert.ToBoolean(this); } /// For a description of this member, see . /// The value of the current instance, converted to a . /// This parameter is ignored. // Token: 0x060000D2 RID: 210 RVA: 0x00004A20 File Offset: 0x00002C20 byte IConvertible.ToByte(IFormatProvider provider) { return Convert.ToByte(this); } /// For a description of this member, see . /// The value of the current instance, converted to a . /// This parameter is ignored. // Token: 0x060000D3 RID: 211 RVA: 0x00004A2C File Offset: 0x00002C2C char IConvertible.ToChar(IFormatProvider provider) { return Convert.ToChar(this); } /// This conversion is not supported. Attempting to use this method throws an . /// This conversion is not supported. No value is returned. /// This parameter is ignored. /// In all cases. // Token: 0x060000D4 RID: 212 RVA: 0x00004A38 File Offset: 0x00002C38 DateTime IConvertible.ToDateTime(IFormatProvider provider) { return Convert.ToDateTime(this); } /// For a description of this member, see . /// The value of the current instance, converted to a . /// This parameter is ignored. // Token: 0x060000D5 RID: 213 RVA: 0x00004A44 File Offset: 0x00002C44 decimal IConvertible.ToDecimal(IFormatProvider provider) { return Convert.ToDecimal(this); } /// For a description of this member, see . /// The value of the current instance, converted to a . /// This parameter is ignored. // Token: 0x060000D6 RID: 214 RVA: 0x00004A50 File Offset: 0x00002C50 double IConvertible.ToDouble(IFormatProvider provider) { return Convert.ToDouble(this); } /// For a description of this member, see . /// The value of the current instance, converted to an . /// This parameter is ignored. // Token: 0x060000D7 RID: 215 RVA: 0x00004A5C File Offset: 0x00002C5C short IConvertible.ToInt16(IFormatProvider provider) { return Convert.ToInt16(this); } /// For a description of this member, see . /// The value of the current instance, converted to an . /// This parameter is ignored. // Token: 0x060000D8 RID: 216 RVA: 0x00004A68 File Offset: 0x00002C68 int IConvertible.ToInt32(IFormatProvider provider) { return Convert.ToInt32(this); } /// For a description of this member, see . /// The value of the current instance, converted to an . /// This parameter is ignored. // Token: 0x060000D9 RID: 217 RVA: 0x00004A74 File Offset: 0x00002C74 long IConvertible.ToInt64(IFormatProvider provider) { return Convert.ToInt64(this); } /// For a description of this member, see . /// The value of the current instance, converted to an . /// This parameter is ignored. // Token: 0x060000DA RID: 218 RVA: 0x00004A80 File Offset: 0x00002C80 sbyte IConvertible.ToSByte(IFormatProvider provider) { return Convert.ToSByte(this); } /// For a description of this member, see . /// The value of the current instance, converted to a . /// This parameter is ignored. // Token: 0x060000DB RID: 219 RVA: 0x00004A8C File Offset: 0x00002C8C float IConvertible.ToSingle(IFormatProvider provider) { return Convert.ToSingle(this); } /// For a description of this member, see . /// The value of the current instance, converted to . /// The type to which to convert this value. /// An implementation that supplies information about the format of the returned value. // Token: 0x060000DC RID: 220 RVA: 0x00004A98 File Offset: 0x00002C98 object IConvertible.ToType(Type targetType, IFormatProvider provider) { if (targetType == null) { throw new ArgumentNullException("targetType"); } return Convert.ToType(this, targetType, provider, false); } /// For a description of this member, see . /// The value of the current instance, converted to a . /// This parameter is ignored. // Token: 0x060000DD RID: 221 RVA: 0x00004AC8 File Offset: 0x00002CC8 ushort IConvertible.ToUInt16(IFormatProvider provider) { return Convert.ToUInt16(this); } /// For a description of this member, see . /// The value of the current instance, converted to a . /// This parameter is ignored. // Token: 0x060000DE RID: 222 RVA: 0x00004AD4 File Offset: 0x00002CD4 uint IConvertible.ToUInt32(IFormatProvider provider) { return Convert.ToUInt32(this); } /// For a description of this member, see . /// The value of the current instance, unchanged. /// This parameter is ignored. // Token: 0x060000DF RID: 223 RVA: 0x00004AE0 File Offset: 0x00002CE0 ulong IConvertible.ToUInt64(IFormatProvider provider) { return this; } /// Compares this instance to a specified object and returns an indication of their relative values. /// A signed number indicating the relative values of this instance and .Return Value Description Less than zero This instance is less than . Zero This instance is equal to . Greater than zero This instance is greater than .-or- is null. /// An object to compare, or null. /// /// is not a . /// 2 // Token: 0x060000E0 RID: 224 RVA: 0x00004AE4 File Offset: 0x00002CE4 public int CompareTo(object value) { if (value == null) { return 1; } if (!(value is ulong)) { throw new ArgumentException(Locale.GetText("Value is not a System.UInt64.")); } ulong num = (ulong)value; if (this == num) { return 0; } return (this >= num) ? 1 : (-1); } /// Returns a value indicating whether this instance is equal to a specified object. /// true if is an instance of and equals the value of this instance; otherwise, false. /// An object to compare to this instance. /// 2 // Token: 0x060000E1 RID: 225 RVA: 0x00004B34 File Offset: 0x00002D34 public override bool Equals(object obj) { return obj is ulong && (ulong)obj == this; } /// Returns the hash code for this instance. /// A 32-bit signed integer hash code. /// 2 // Token: 0x060000E2 RID: 226 RVA: 0x00004B50 File Offset: 0x00002D50 public override int GetHashCode() { return (int)(this & (ulong)(-1)) ^ (int)(this >> 32); } /// Compares this instance to a specified 64-bit unsigned integer and returns an indication of their relative values. /// A signed number indicating the relative values of this instance and .Return Value Description Less than zero This instance is less than . Zero This instance is equal to . Greater than zero This instance is greater than . /// An unsigned integer to compare. /// 2 // Token: 0x060000E3 RID: 227 RVA: 0x00004B60 File Offset: 0x00002D60 public int CompareTo(ulong value) { if (this == value) { return 0; } if (this > value) { return 1; } return -1; } /// Returns a value indicating whether this instance is equal to a specified value. /// true if has the same value as this instance; otherwise, false. /// A value to compare to this instance. /// 2 // Token: 0x060000E4 RID: 228 RVA: 0x00004B78 File Offset: 0x00002D78 public bool Equals(ulong obj) { return obj == this; } /// Converts the string representation of a number to its 64-bit unsigned integer equivalent. /// A 64-bit unsigned integer equivalent to the number contained in . /// A string that represents the number to convert. /// The parameter is null. /// The parameter is not in the correct format. /// The parameter represents a number less than or greater than . /// 1 // Token: 0x060000E5 RID: 229 RVA: 0x00004B80 File Offset: 0x00002D80 [CLSCompliant(false)] public static ulong Parse(string s) { return ulong.Parse(s, NumberStyles.Integer, null); } /// Converts the string representation of a number in a specified culture-specific format to its 64-bit unsigned integer equivalent. /// A 64-bit unsigned integer equivalent to the number specified in . /// A string that represents the number to convert. /// An object that supplies culture-specific formatting information about . /// The parameter is null. /// The parameter is not in the correct style. /// The parameter represents a number less than or greater than . /// 1 // Token: 0x060000E6 RID: 230 RVA: 0x00004B8C File Offset: 0x00002D8C [CLSCompliant(false)] public static ulong Parse(string s, IFormatProvider provider) { return ulong.Parse(s, NumberStyles.Integer, provider); } /// Converts the string representation of a number in a specified style to its 64-bit unsigned integer equivalent. /// A 64-bit unsigned integer equivalent to the number specified in . /// A string that represents the number to convert. The string is interpreted by using the style specified by the parameter. /// A bitwise combination of the enumeration values that specifies the permitted format of . A typical value to specify is . /// The parameter is null. /// /// is not a value. -or- is not a combination of and values. /// The parameter is not in a format compliant with . /// The parameter represents a number less than or greater than . -or- includes non-zero, fractional digits. /// 1 // Token: 0x060000E7 RID: 231 RVA: 0x00004B98 File Offset: 0x00002D98 [CLSCompliant(false)] public static ulong Parse(string s, NumberStyles style) { return ulong.Parse(s, style, null); } // Token: 0x060000E8 RID: 232 RVA: 0x00004BA4 File Offset: 0x00002DA4 internal static bool Parse(string s, NumberStyles style, IFormatProvider provider, bool tryParse, out ulong result, out Exception exc) { result = 0UL; exc = null; if (s == null) { if (!tryParse) { exc = new ArgumentNullException("s"); } return false; } if (s.Length == 0) { if (!tryParse) { exc = int.GetFormatException(); } return false; } NumberFormatInfo numberFormatInfo = null; if (provider != null) { Type typeFromHandle = typeof(NumberFormatInfo); numberFormatInfo = (NumberFormatInfo)provider.GetFormat(typeFromHandle); } if (numberFormatInfo == null) { numberFormatInfo = Thread.CurrentThread.CurrentCulture.NumberFormat; } if (!int.CheckStyle(style, tryParse, ref exc)) { return false; } bool flag = (style & NumberStyles.AllowCurrencySymbol) != NumberStyles.None; bool flag2 = (style & NumberStyles.AllowHexSpecifier) != NumberStyles.None; bool flag3 = (style & NumberStyles.AllowThousands) != NumberStyles.None; bool flag4 = (style & NumberStyles.AllowDecimalPoint) != NumberStyles.None; bool flag5 = (style & NumberStyles.AllowParentheses) != NumberStyles.None; bool flag6 = (style & NumberStyles.AllowTrailingSign) != NumberStyles.None; bool flag7 = (style & NumberStyles.AllowLeadingSign) != NumberStyles.None; bool flag8 = (style & NumberStyles.AllowTrailingWhite) != NumberStyles.None; bool flag9 = (style & NumberStyles.AllowLeadingWhite) != NumberStyles.None; int num = 0; if (flag9 && !int.JumpOverWhite(ref num, s, true, tryParse, ref exc)) { return false; } bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; if (flag5 && s[num] == '(') { flag10 = true; flag12 = true; flag11 = true; num++; if (flag9 && !int.JumpOverWhite(ref num, s, true, tryParse, ref exc)) { return false; } if (s.Substring(num, numberFormatInfo.NegativeSign.Length) == numberFormatInfo.NegativeSign) { if (!tryParse) { exc = int.GetFormatException(); } return false; } if (s.Substring(num, numberFormatInfo.PositiveSign.Length) == numberFormatInfo.PositiveSign) { if (!tryParse) { exc = int.GetFormatException(); } return false; } } if (flag7 && !flag12) { int.FindSign(ref num, s, numberFormatInfo, ref flag12, ref flag11); if (flag12) { if (flag9 && !int.JumpOverWhite(ref num, s, true, tryParse, ref exc)) { return false; } if (flag) { int.FindCurrency(ref num, s, numberFormatInfo, ref flag13); if (flag13 && flag9 && !int.JumpOverWhite(ref num, s, true, tryParse, ref exc)) { return false; } } } } if (flag && !flag13) { int.FindCurrency(ref num, s, numberFormatInfo, ref flag13); if (flag13) { if (flag9 && !int.JumpOverWhite(ref num, s, true, tryParse, ref exc)) { return false; } if (flag13 && !flag12 && flag7) { int.FindSign(ref num, s, numberFormatInfo, ref flag12, ref flag11); if (flag12 && flag9 && !int.JumpOverWhite(ref num, s, true, tryParse, ref exc)) { return false; } } } } ulong num2 = 0UL; int num3 = 0; bool flag14 = false; do { if (!int.ValidDigit(s[num], flag2)) { if (!flag3 || !int.FindOther(ref num, s, numberFormatInfo.NumberGroupSeparator)) { if (flag14 || !flag4 || !int.FindOther(ref num, s, numberFormatInfo.NumberDecimalSeparator)) { break; } flag14 = true; } } else if (flag2) { num3++; char c = s[num++]; ulong num4; if (char.IsDigit(c)) { num4 = (ulong)((long)(c - '0')); } else if (char.IsLower(c)) { num4 = (ulong)((long)(c - 'a' + '\n')); } else { num4 = (ulong)((long)(c - 'A' + '\n')); } if (tryParse) { bool flag15 = num2 > 65535UL; num2 = num2 * 16UL + num4; if (flag15 && num2 < 16UL) { return false; } } else { num2 = checked(num2 * 16UL + num4); } } else if (flag14) { num3++; if (s[num++] != '0') { goto Block_51; } } else { num3++; try { num2 = checked(num2 * 10UL + (ulong)(s[num++] - '0')); } catch (OverflowException) { if (!tryParse) { exc = new OverflowException(Locale.GetText("Value too large or too small.")); } return false; } } } while (num < s.Length); goto IL_44B; Block_51: if (!tryParse) { exc = new OverflowException(Locale.GetText("Value too large or too small.")); } return false; IL_44B: if (num3 == 0) { if (!tryParse) { exc = int.GetFormatException(); } return false; } if (flag6 && !flag12) { int.FindSign(ref num, s, numberFormatInfo, ref flag12, ref flag11); if (flag12) { if (flag8 && !int.JumpOverWhite(ref num, s, true, tryParse, ref exc)) { return false; } if (flag) { int.FindCurrency(ref num, s, numberFormatInfo, ref flag13); } } } if (flag && !flag13) { int.FindCurrency(ref num, s, numberFormatInfo, ref flag13); if (flag13) { if (flag8 && !int.JumpOverWhite(ref num, s, true, tryParse, ref exc)) { return false; } if (!flag12 && flag6) { int.FindSign(ref num, s, numberFormatInfo, ref flag12, ref flag11); } } } if (flag8 && num < s.Length && !int.JumpOverWhite(ref num, s, false, tryParse, ref exc)) { return false; } if (flag10) { if (num >= s.Length || s[num++] != ')') { if (!tryParse) { exc = int.GetFormatException(); } return false; } if (flag8 && num < s.Length && !int.JumpOverWhite(ref num, s, false, tryParse, ref exc)) { return false; } } if (num < s.Length && s[num] != '\0') { if (!tryParse) { exc = int.GetFormatException(); } return false; } if (flag11 && num2 > 0UL) { if (!tryParse) { exc = new OverflowException(Locale.GetText("Negative number")); } return false; } result = num2; return true; } /// Converts the string representation of a number in a specified style and culture-specific format to its 64-bit unsigned integer equivalent. /// A 64-bit unsigned integer equivalent to the number specified in . /// A string that represents the number to convert. The string is interpreted by using the style specified by the parameter. /// A bitwise combination of enumeration values that indicates the style elements that can be present in . A typical value to specify is . /// An object that supplies culture-specific formatting information about . /// The parameter is null. /// /// is not a value. -or- is not a combination of and values. /// The parameter is not in a format compliant with . /// The parameter represents a number less than or greater than . -or- includes non-zero, fractional digits. /// 1 // Token: 0x060000E9 RID: 233 RVA: 0x000051B4 File Offset: 0x000033B4 [CLSCompliant(false)] public static ulong Parse(string s, NumberStyles style, IFormatProvider provider) { ulong num; Exception ex; if (!ulong.Parse(s, style, provider, false, out num, out ex)) { throw ex; } return num; } /// Tries to convert the string representation of a number to its 64-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded or failed. /// true if was converted successfully; otherwise, false. /// A string that represents the number to convert. /// When this method returns, contains the 64-bit unsigned integer value that is equivalent to the number contained in , if the conversion succeeded, or zero if the conversion failed. The conversion fails if the parameter is null, is not of the correct format, or represents a number less than or greater than . This parameter is passed uninitialized. /// 1 // Token: 0x060000EA RID: 234 RVA: 0x000051D8 File Offset: 0x000033D8 [CLSCompliant(false)] public static bool TryParse(string s, out ulong result) { Exception ex; if (!ulong.Parse(s, NumberStyles.Integer, null, true, out result, out ex)) { result = 0UL; return false; } return true; } /// Tries to convert the string representation of a number in a specified style and culture-specific format to its 64-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded or failed. /// true if was converted successfully; otherwise, false. /// A string that represents the number to convert. The string is interpreted by using the style specified by the parameter. /// A bitwise combination of enumeration values that indicates the permitted format of . A typical value to specify is . /// An object that supplies culture-specific formatting information about . /// When this method returns, contains the 64-bit unsigned integer value equivalent to the number contained in , if the conversion succeeded, or zero if the conversion failed. The conversion fails if the parameter is null, is not in a format compliant with , or represents a number less than or greater than . This parameter is passed uninitialized. /// /// is not a value. -or- is not a combination of and values. /// 1 // Token: 0x060000EB RID: 235 RVA: 0x00005200 File Offset: 0x00003400 [CLSCompliant(false)] public static bool TryParse(string s, NumberStyles style, IFormatProvider provider, out ulong result) { Exception ex; if (!ulong.Parse(s, style, provider, true, out result, out ex)) { result = 0UL; return false; } return true; } /// Converts the numeric value of this instance to its equivalent string representation. /// The string representation of the value of this instance, consisting of a sequence of digits ranging from 0 to 9, without a sign or leading zeroes. /// 1 // Token: 0x060000EC RID: 236 RVA: 0x00005228 File Offset: 0x00003428 public override string ToString() { return NumberFormatter.NumberToString(this, null); } /// Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. /// The string representation of the value of this instance as specified by . /// An object that supplies culture-specific formatting information. /// 1 // Token: 0x060000ED RID: 237 RVA: 0x00005234 File Offset: 0x00003434 public string ToString(IFormatProvider provider) { return NumberFormatter.NumberToString(this, provider); } /// Converts the numeric value of this instance to its equivalent string representation using the specified format. /// The string representation of the value of this instance as specified by . /// A numeric format string. /// The parameter is invalid. /// 1 // Token: 0x060000EE RID: 238 RVA: 0x00005240 File Offset: 0x00003440 public string ToString(string format) { return this.ToString(format, null); } /// Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. /// The string representation of the value of this instance as specified by and . /// A numeric format string. /// An object that supplies culture-specific formatting information about this instance. /// The parameter is invalid. /// 1 // Token: 0x060000EF RID: 239 RVA: 0x0000524C File Offset: 0x0000344C public string ToString(string format, IFormatProvider provider) { return NumberFormatter.NumberToString(format, this, provider); } /// Returns the for value type . /// The enumerated constant, . /// 2 // Token: 0x060000F0 RID: 240 RVA: 0x00005258 File Offset: 0x00003458 public TypeCode GetTypeCode() { return TypeCode.UInt64; } /// Represents the largest possible value of . This field is constant. /// 1 // Token: 0x0400000F RID: 15 public const ulong MaxValue = 18446744073709551615UL; /// Represents the smallest possible value of . This field is constant. /// 1 // Token: 0x04000010 RID: 16 public const ulong MinValue = 0UL; // Token: 0x04000011 RID: 17 internal ulong m_value; } }