using System; using System.Globalization; using System.Runtime.InteropServices; namespace System { /// Represents a Boolean value. /// 1 // Token: 0x02000022 RID: 34 [ComVisible(true)] [Serializable] public struct Boolean : IConvertible, IComparable, IComparable, IEquatable { /// For a description of this member, see . /// An object of the specified type, with a value that is equivalent to the value of this Boolean object. /// The desired type. /// An implementation that supplies culture-specific information about the format of the returned value. /// /// is null. /// The requested type conversion is not supported. // Token: 0x06000344 RID: 836 RVA: 0x0000D650 File Offset: 0x0000B850 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 . /// true or false. /// This parameter is ignored. // Token: 0x06000345 RID: 837 RVA: 0x0000D680 File Offset: 0x0000B880 bool IConvertible.ToBoolean(IFormatProvider provider) { return this; } /// For a description of this member, see . /// true, coerced to byte, if the value of this instance is nonzero; otherwise, false, coerced to byte. /// This parameter is ignored. // Token: 0x06000346 RID: 838 RVA: 0x0000D684 File Offset: 0x0000B884 byte IConvertible.ToByte(IFormatProvider provider) { return Convert.ToByte(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. /// You attempt to convert a value to a value. This conversion is not supported. // Token: 0x06000347 RID: 839 RVA: 0x0000D690 File Offset: 0x0000B890 char IConvertible.ToChar(IFormatProvider provider) { throw new InvalidCastException(); } /// 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. /// You attempt to convert a value to a value. This conversion is not supported. // Token: 0x06000348 RID: 840 RVA: 0x0000D698 File Offset: 0x0000B898 DateTime IConvertible.ToDateTime(IFormatProvider provider) { throw new InvalidCastException(); } /// For a description of this member, see .. /// 1 if this instance is nonzero (that is, true); otherwise, 0. /// This parameter is ignored. // Token: 0x06000349 RID: 841 RVA: 0x0000D6A0 File Offset: 0x0000B8A0 decimal IConvertible.ToDecimal(IFormatProvider provider) { return Convert.ToDecimal(this); } /// For a description of this member, see .. /// 1 if this instance is nonzero (that is, true); otherwise, 0. /// This parameter is ignored. // Token: 0x0600034A RID: 842 RVA: 0x0000D6AC File Offset: 0x0000B8AC double IConvertible.ToDouble(IFormatProvider provider) { return Convert.ToDouble(this); } /// For a description of this member, see . /// 1 if this instance is nonzero (that is, true); otherwise, 0. /// This parameter is ignored. // Token: 0x0600034B RID: 843 RVA: 0x0000D6B8 File Offset: 0x0000B8B8 short IConvertible.ToInt16(IFormatProvider provider) { return Convert.ToInt16(this); } /// For a description of this member, see . /// 1 if this instance is nonzero (that is, true); otherwise, 0. /// This parameter is ignored. // Token: 0x0600034C RID: 844 RVA: 0x0000D6C4 File Offset: 0x0000B8C4 int IConvertible.ToInt32(IFormatProvider provider) { return Convert.ToInt32(this); } /// For a description of this member, see . /// 1 if this instance is nonzero (that is, true); otherwise, 0. /// This parameter is ignored. // Token: 0x0600034D RID: 845 RVA: 0x0000D6D0 File Offset: 0x0000B8D0 long IConvertible.ToInt64(IFormatProvider provider) { return Convert.ToInt64(this); } /// For a description of this member, see . /// 1 if this instance is nonzero (that is, true); otherwise, 0. /// This parameter is ignored. // Token: 0x0600034E RID: 846 RVA: 0x0000D6DC File Offset: 0x0000B8DC sbyte IConvertible.ToSByte(IFormatProvider provider) { return Convert.ToSByte(this); } /// For a description of this member, see .. /// 1 if this instance is nonzero (that is, true); otherwise, 0. /// This parameter is ignored. // Token: 0x0600034F RID: 847 RVA: 0x0000D6E8 File Offset: 0x0000B8E8 float IConvertible.ToSingle(IFormatProvider provider) { return Convert.ToSingle(this); } /// For a description of this member, see . /// 1 if this instance is nonzero (that is, true); otherwise, 0. /// This parameter is ignored. // Token: 0x06000350 RID: 848 RVA: 0x0000D6F4 File Offset: 0x0000B8F4 ushort IConvertible.ToUInt16(IFormatProvider provider) { return Convert.ToUInt16(this); } /// For a description of this member, see . /// 1 if this instance is nonzero (that is, true); otherwise, 0. /// This parameter is ignored. // Token: 0x06000351 RID: 849 RVA: 0x0000D700 File Offset: 0x0000B900 uint IConvertible.ToUInt32(IFormatProvider provider) { return Convert.ToUInt32(this); } /// For a description of this member, see . /// 1 if this instance is nonzero (that is, true); otherwise, 0. /// This parameter is ignored. // Token: 0x06000352 RID: 850 RVA: 0x0000D70C File Offset: 0x0000B90C ulong IConvertible.ToUInt64(IFormatProvider provider) { return Convert.ToUInt64(this); } /// Compares this instance to a specified object and returns an integer that indicates their relationship to one another. /// A signed integer that indicates the relative order of this instance and .Return Value Condition Less than zero This instance is false and is true. Zero This instance and are equal (either both are true or both are false). Greater than zero This instance is true and is false.-or- is null. /// An object to compare to this instance, or null. /// /// is not a . /// 2 // Token: 0x06000353 RID: 851 RVA: 0x0000D718 File Offset: 0x0000B918 public int CompareTo(object obj) { if (obj == null) { return 1; } if (!(obj is bool)) { throw new ArgumentException(Locale.GetText("Object is not a Boolean.")); } bool flag = (bool)obj; if (this && !flag) { return 1; } return (this != flag) ? (-1) : 0; } /// Returns a value indicating whether this instance is equal to a specified object. /// true if is a and has the same value as this instance; otherwise, false. /// An object to compare to this instance. /// 2 // Token: 0x06000354 RID: 852 RVA: 0x0000D770 File Offset: 0x0000B970 public override bool Equals(object obj) { if (obj == null || !(obj is bool)) { return false; } bool flag = (bool)obj; return (!this) ? (!flag) : flag; } /// Compares this instance to a specified object and returns an integer that indicates their relationship to one another. /// A signed integer that indicates the relative values of this instance and .Return Value Condition Less than zero This instance is false and is true. Zero This instance and are equal (either both are true or both are false). Greater than zero This instance is true and is false. /// A object to compare to this instance. /// 2 // Token: 0x06000355 RID: 853 RVA: 0x0000D7A8 File Offset: 0x0000B9A8 public int CompareTo(bool value) { if (this == value) { return 0; } return this ? 1 : (-1); } /// Returns a value indicating whether this instance is equal to a specified object. /// true if has the same value as this instance; otherwise, false. /// A value to compare to this instance. /// 2 // Token: 0x06000356 RID: 854 RVA: 0x0000D7C4 File Offset: 0x0000B9C4 public bool Equals(bool obj) { return this == obj; } /// Returns the hash code for this instance. /// A hash code for the current . /// 2 // Token: 0x06000357 RID: 855 RVA: 0x0000D7CC File Offset: 0x0000B9CC public override int GetHashCode() { return (!this) ? 0 : 1; } /// Converts the specified string representation of a logical value to its equivalent, or throws an exception if the string is not equivalent to the value of or . /// true if is equivalent to the value of the field; false if is equivalent to the value of the field. /// A string containing the value to convert. /// /// is null. /// /// is not equivalent to the value of the or field. /// 1 // Token: 0x06000358 RID: 856 RVA: 0x0000D7DC File Offset: 0x0000B9DC public static bool Parse(string value) { if (value == null) { throw new ArgumentNullException("value"); } value = value.Trim(); if (string.Compare(value, bool.TrueString, true, CultureInfo.InvariantCulture) == 0) { return true; } if (string.Compare(value, bool.FalseString, true, CultureInfo.InvariantCulture) == 0) { return false; } throw new FormatException(Locale.GetText("Value is not equivalent to either TrueString or FalseString.")); } /// Tries to convert the specified string representation of a logical value to its equivalent. A return value indicates whether the conversion succeeded or failed. /// true if was converted successfully; otherwise, false. /// A string containing the value to convert. /// When this method returns, if the conversion succeeded, contains true if is equivalent to or false if is equivalent to . If the conversion failed, contains false. The conversion fails if is null or is not equivalent to the value of either the or field. /// 1 // Token: 0x06000359 RID: 857 RVA: 0x0000D844 File Offset: 0x0000BA44 public static bool TryParse(string value, out bool result) { result = false; if (value == null) { return false; } value = value.Trim(); if (string.Compare(value, bool.TrueString, true, CultureInfo.InvariantCulture) == 0) { result = true; return true; } return string.Compare(value, bool.FalseString, true, CultureInfo.InvariantCulture) == 0; } /// Converts the value of this instance to its equivalent string representation (either "True" or "False"). /// /// if the value of this instance is true, or if the value of this instance is false. /// 2 // Token: 0x0600035A RID: 858 RVA: 0x0000D898 File Offset: 0x0000BA98 public override string ToString() { return (!this) ? bool.FalseString : bool.TrueString; } /// Returns the for value type . /// The enumerated constant, . /// 2 // Token: 0x0600035B RID: 859 RVA: 0x0000D8B0 File Offset: 0x0000BAB0 public TypeCode GetTypeCode() { return TypeCode.Boolean; } /// Converts the value of this instance to its equivalent string representation (either "True" or "False"). /// /// if the value of this instance is true, or if the value of this instance is false. /// (Reserved) An object. /// 2 // Token: 0x0600035C RID: 860 RVA: 0x0000D8B4 File Offset: 0x0000BAB4 public string ToString(IFormatProvider provider) { return this.ToString(); } /// Represents the Boolean value false as a string. This field is read-only. /// 1 // Token: 0x04000053 RID: 83 public static readonly string FalseString = "False"; /// Represents the Boolean value true as a string. This field is read-only. /// 1 // Token: 0x04000054 RID: 84 public static readonly string TrueString = "True"; // Token: 0x04000055 RID: 85 internal bool m_value; } }