using System;
using System.Globalization;
using System.Runtime.InteropServices;
namespace System
{
/// Represents a 16-bit unsigned integer.
/// 1
// Token: 0x02000016 RID: 22
[CLSCompliant(false)]
[ComVisible(true)]
[Serializable]
public struct UInt16 : 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: 0x06000150 RID: 336 RVA: 0x00005CB4 File Offset: 0x00003EB4
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: 0x06000151 RID: 337 RVA: 0x00005CC0 File Offset: 0x00003EC0
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: 0x06000152 RID: 338 RVA: 0x00005CCC File Offset: 0x00003ECC
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: 0x06000153 RID: 339 RVA: 0x00005CD8 File Offset: 0x00003ED8
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
return Convert.ToDateTime(this);
}
/// For a description of this member, see .
/// The current value of this instance, converted to a .
/// This parameter is ignored.
// Token: 0x06000154 RID: 340 RVA: 0x00005CE4 File Offset: 0x00003EE4
decimal IConvertible.ToDecimal(IFormatProvider provider)
{
return Convert.ToDecimal(this);
}
/// For a description of this member, see .
/// The current value of this instance, converted to a .
/// This parameter is ignored.
// Token: 0x06000155 RID: 341 RVA: 0x00005CF0 File Offset: 0x00003EF0
double IConvertible.ToDouble(IFormatProvider provider)
{
return Convert.ToDouble(this);
}
/// For a description of this member, see .
/// The current value of this instance, converted to an .
/// This parameter is ignored.
// Token: 0x06000156 RID: 342 RVA: 0x00005CFC File Offset: 0x00003EFC
short IConvertible.ToInt16(IFormatProvider provider)
{
return Convert.ToInt16(this);
}
/// For a description of this member, see .
/// The value of this instance, converted to an .
/// This parameter is ignored.
// Token: 0x06000157 RID: 343 RVA: 0x00005D08 File Offset: 0x00003F08
int IConvertible.ToInt32(IFormatProvider provider)
{
return Convert.ToInt32(this);
}
/// For a description of this member, see .
/// The current value of this instance, converted to an .
/// This parameter is ignored.
// Token: 0x06000158 RID: 344 RVA: 0x00005D14 File Offset: 0x00003F14
long IConvertible.ToInt64(IFormatProvider provider)
{
return Convert.ToInt64(this);
}
/// For a description of this member, see .
/// The current value of this instance, converted to an .
/// This parameter is ignored.
// Token: 0x06000159 RID: 345 RVA: 0x00005D20 File Offset: 0x00003F20
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
return Convert.ToSByte(this);
}
/// For a description of this member, see .
/// The current value pf this instance, converted to a .
/// This parameter is ignored.
// Token: 0x0600015A RID: 346 RVA: 0x00005D2C File Offset: 0x00003F2C
float IConvertible.ToSingle(IFormatProvider provider)
{
return Convert.ToSingle(this);
}
/// For a description of this member, see .
/// The current value of this instance, converted to .
/// The type to which to convert this value.
/// An implementation that supplies information about the format of the returned value.
// Token: 0x0600015B RID: 347 RVA: 0x00005D38 File Offset: 0x00003F38
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 current value of this instance, unchanged.
/// This parameter is ignored.
// Token: 0x0600015C RID: 348 RVA: 0x00005D68 File Offset: 0x00003F68
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
return this;
}
/// For a description of this member, see .
/// The current value of this instance, converted to a .
/// This parameter is ignored.
// Token: 0x0600015D RID: 349 RVA: 0x00005D6C File Offset: 0x00003F6C
uint IConvertible.ToUInt32(IFormatProvider provider)
{
return Convert.ToUInt32(this);
}
/// For a description of this member, see .
/// The current value of this instance, converted to a .
/// This parameter is ignored.
// Token: 0x0600015E RID: 350 RVA: 0x00005D78 File Offset: 0x00003F78
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
return Convert.ToUInt64(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: 0x0600015F RID: 351 RVA: 0x00005D84 File Offset: 0x00003F84
public int CompareTo(object value)
{
if (value == null)
{
return 1;
}
if (!(value is ushort))
{
throw new ArgumentException(Locale.GetText("Value is not a System.UInt16."));
}
return (int)(this - (ushort)value);
}
/// 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: 0x06000160 RID: 352 RVA: 0x00005DC0 File Offset: 0x00003FC0
public override bool Equals(object obj)
{
return obj is ushort && (ushort)obj == this;
}
/// Returns the hash code for this instance.
/// A 32-bit signed integer hash code.
/// 2
// Token: 0x06000161 RID: 353 RVA: 0x00005DDC File Offset: 0x00003FDC
public override int GetHashCode()
{
return (int)this;
}
/// Compares this instance to a specified 16-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: 0x06000162 RID: 354 RVA: 0x00005DE0 File Offset: 0x00003FE0
public int CompareTo(ushort value)
{
return (int)(this - value);
}
/// 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: 0x06000163 RID: 355 RVA: 0x00005DE8 File Offset: 0x00003FE8
public bool Equals(ushort obj)
{
return obj == this;
}
/// Converts the string representation of a number in a specified culture-specific format to its 16-bit unsigned integer equivalent.
/// A 16-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 .
///
/// is null.
///
/// is not in the correct format.
///
/// represents a number less than or greater than .
/// 1
// Token: 0x06000164 RID: 356 RVA: 0x00005DF0 File Offset: 0x00003FF0
[CLSCompliant(false)]
public static ushort Parse(string s, IFormatProvider provider)
{
return ushort.Parse(s, NumberStyles.Integer, provider);
}
/// Converts the string representation of a number in a specified style to its 16-bit unsigned integer equivalent.
/// A 16-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 specify the permitted format of . A typical value to specify is .
///
/// is null.
///
/// is not a value. -or- is not a combination of the and values.
///
/// is not in a format compliant with .
///
/// represents a number less than or greater than . -or- includes non-zero, fractional digits.
/// 1
// Token: 0x06000165 RID: 357 RVA: 0x00005DFC File Offset: 0x00003FFC
[CLSCompliant(false)]
public static ushort Parse(string s, NumberStyles style)
{
return ushort.Parse(s, style, null);
}
/// Converts the string representation of a number in a specified style and culture-specific format to its 16-bit unsigned integer equivalent.
/// A 16-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 indicate the style elements that can be present in . A typical value to specify is .
/// An object that supplies culture-specific formatting information about .
///
/// is null.
///
/// is not a value. -or- is not a combination of and values.
///
/// is not in a format compliant with .
///
/// represents a number less than or greater than .-or- includes non-zero, fractional digits.
/// 1
// Token: 0x06000166 RID: 358 RVA: 0x00005E08 File Offset: 0x00004008
[CLSCompliant(false)]
public static ushort Parse(string s, NumberStyles style, IFormatProvider provider)
{
uint num = uint.Parse(s, style, provider);
if (num > 65535U)
{
throw new OverflowException(Locale.GetText("Value too large."));
}
return (ushort)num;
}
/// Converts the string representation of a number to its 16-bit unsigned integer equivalent.
/// A 16-bit unsigned integer equivalent to the number contained in .
/// A string that represents the number to convert.
///
/// is null.
///
/// is not in the correct format.
///
/// represents a number less than or greater than .
/// 1
// Token: 0x06000167 RID: 359 RVA: 0x00005E3C File Offset: 0x0000403C
[CLSCompliant(false)]
public static ushort Parse(string s)
{
return ushort.Parse(s, NumberStyles.Number, null);
}
/// Converts the string representation of a number to its 16-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 16-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 in the correct format. , or represents a number less than or greater than . This parameter is passed uninitialized.
/// 1
// Token: 0x06000168 RID: 360 RVA: 0x00005E48 File Offset: 0x00004048
[CLSCompliant(false)]
public static bool TryParse(string s, out ushort result)
{
return ushort.TryParse(s, NumberStyles.Integer, null, out result);
}
/// Converts the string representation of a number in a specified style and culture-specific format to its 16-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 16-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: 0x06000169 RID: 361 RVA: 0x00005E54 File Offset: 0x00004054
[CLSCompliant(false)]
public static bool TryParse(string s, NumberStyles style, IFormatProvider provider, out ushort result)
{
result = 0;
uint num;
if (!uint.TryParse(s, style, provider, out num))
{
return false;
}
if (num > 65535U)
{
return false;
}
result = (ushort)num;
return true;
}
/// Converts the numeric value of this instance to its equivalent string representation.
/// The string representation of the value of this instance, which consists of a sequence of digits ranging from 0 to 9, without a sign or leading zeroes.
/// 1
// Token: 0x0600016A RID: 362 RVA: 0x00005E88 File Offset: 0x00004088
public override string ToString()
{
return NumberFormatter.NumberToString((int)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, which consists of a sequence of digits ranging from 0 to 9, without a sign or leading zeros.
/// An object that supplies culture-specific formatting information.
/// 1
// Token: 0x0600016B RID: 363 RVA: 0x00005E94 File Offset: 0x00004094
public string ToString(IFormatProvider provider)
{
return NumberFormatter.NumberToString((int)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: 0x0600016C RID: 364 RVA: 0x00005EA0 File Offset: 0x000040A0
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.
///
/// is invalid.
/// 1
// Token: 0x0600016D RID: 365 RVA: 0x00005EAC File Offset: 0x000040AC
public string ToString(string format, IFormatProvider provider)
{
return NumberFormatter.NumberToString(format, this, provider);
}
/// Returns the for value type .
/// The enumerated constant, .
/// 2
// Token: 0x0600016E RID: 366 RVA: 0x00005EB8 File Offset: 0x000040B8
public TypeCode GetTypeCode()
{
return TypeCode.UInt16;
}
/// Represents the largest possible value of . This field is constant.
/// 1
// Token: 0x0400001B RID: 27
public const ushort MaxValue = 65535;
/// Represents the smallest possible value of . This field is constant.
/// 1
// Token: 0x0400001C RID: 28
public const ushort MinValue = 0;
// Token: 0x0400001D RID: 29
internal ushort m_value;
}
}