//
// Member Variables
//
- private char _value;
+ private char m_value; // Do not rename (binary serialization)
//
// Public Constants
// Calculate a hashcode for a 2 byte Unicode character.
public override int GetHashCode()
{
- return (int)_value | ((int)_value << 16);
+ return (int)m_value | ((int)m_value << 16);
}
// Used for comparing two boxed Char objects.
{
return false;
}
- return (_value == ((Char)obj)._value);
+ return (m_value == ((Char)obj).m_value);
}
[System.Runtime.Versioning.NonVersionable]
public bool Equals(Char obj)
{
- return _value == obj;
+ return m_value == obj;
}
// Compares this object to another object, returning an integer that
throw new ArgumentException(SR.Arg_MustBeChar);
}
- return (_value - ((Char)value)._value);
+ return (m_value - ((Char)value).m_value);
}
[Pure]
public int CompareTo(Char value)
{
- return (_value - value);
+ return (m_value - value);
}
// Overrides System.Object.ToString.
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
- return Char.ToString(_value);
+ return Char.ToString(m_value);
}
[Pure]
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Char.ToString(_value);
+ return Char.ToString(m_value);
}
//
char IConvertible.ToChar(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- return Convert.ToSByte(_value);
+ return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
- return Convert.ToByte(_value);
+ return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider provider)
{
- return Convert.ToInt16(_value);
+ return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- return Convert.ToUInt16(_value);
+ return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
- return Convert.ToInt32(_value);
+ return Convert.ToInt32(m_value);
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- return Convert.ToUInt32(_value);
+ return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider provider)
{
- return Convert.ToInt64(_value);
+ return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- return Convert.ToUInt64(_value);
+ return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
[Serializable]
public sealed class SortVersion : IEquatable<SortVersion>
{
- private int _nlsVersion;
- private Guid _sortId;
+ private int m_NlsVersion; // Do not rename (binary serialization)
+ private Guid m_SortId; // Do not rename (binary serialization)
public int FullVersion
{
get
{
- return _nlsVersion;
+ return m_NlsVersion;
}
}
{
get
{
- return _sortId;
+ return m_SortId;
}
}
public SortVersion(int fullVersion, Guid sortId)
{
- _sortId = sortId;
- _nlsVersion = fullVersion;
+ m_SortId = sortId;
+ m_NlsVersion = fullVersion;
}
internal SortVersion(int nlsVersion, int effectiveId, Guid customVersion)
{
- _nlsVersion = nlsVersion;
+ m_NlsVersion = nlsVersion;
if (customVersion == Guid.Empty)
{
customVersion = new Guid(0, 0, 0, 0, 0, 0, 0, b1, b2, b3, b4);
}
- _sortId = customVersion;
+ m_SortId = customVersion;
}
public override bool Equals(object obj)
return false;
}
- return _nlsVersion == other._nlsVersion && _sortId == other._sortId;
+ return m_NlsVersion == other.m_NlsVersion && m_SortId == other.m_SortId;
}
public override int GetHashCode()
{
- return _nlsVersion * 7 | _sortId.GetHashCode();
+ return m_NlsVersion * 7 | m_SortId.GetHashCode();
}
public static bool operator ==(SortVersion left, SortVersion right)
/// using parameters to the type's constructors.
/// </para>
/// </remarks>
- [Serializable]
[DebuggerTypeProxy(typeof(System_LazyDebugView<>))]
[DebuggerDisplay("ThreadSafetyMode={Mode}, IsValueCreated={IsValueCreated}, IsValueFaulted={IsValueFaulted}, Value={ValueForDebugDisplay}")]
public class Lazy<T>
private Func<T> _factory;
// _value eventually stores the lazily created value. It is valid when _state = null.
- private T _value;
+ private T m_value; // Do not rename (binary serialization)
/// <summary>
/// Initializes a new instance of the <see cref="T:System.Threading.Lazy{T}"/> class that
/// </remarks>
public Lazy(T value)
{
- _value = value;
+ m_value = value;
}
/// <summary>
private void ViaConstructor()
{
- _value = CreateViaDefaultConstructor();
+ m_value = CreateViaDefaultConstructor();
_state = null; // volatile write, must occur after setting _value
}
throw new InvalidOperationException(SR.Lazy_Value_RecursiveCallsToValue);
_factory = null;
- _value = factory();
+ m_value = factory();
_state = null; // volatile write, must occur after setting _value
}
catch (Exception exception)
if (previous == publicationOnly)
{
_factory = null;
- _value = possibleValue;
+ m_value = possibleValue;
_state = null; // volatile write, must occur after setting _value
}
}
{
return default(T);
}
- return _value;
+ return m_value;
}
}
/// from initialization delegate.
/// </remarks>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public T Value => _state == null ? _value : CreateValue();
+ public T Value => _state == null ? m_value : CreateValue();
}
/// <summary>A debugger view of the Lazy<T> to surface additional debugging properties and
namespace System
{
- [Serializable]
[Obsolete("System.TimeZone has been deprecated. Please investigate the use of System.TimeZoneInfo instead.")]
public abstract class TimeZone
{
//
// Member Variables
//
- private bool _value;
+ private bool m_value; // Do not rename (binary serialization)
- // The true value.
- //
+ // The true value.
+ //
internal const int True = 1;
// The false value.
// Provides a hash code for this instance.
public override int GetHashCode()
{
- return (_value) ? True : False;
+ return (m_value) ? True : False;
}
/*===================================ToString===================================
// Converts the boolean value of this instance to a String.
public override String ToString()
{
- if (false == _value)
+ if (false == m_value)
{
return FalseLiteral;
}
public String ToString(IFormatProvider provider)
{
- if (false == _value)
+ if (false == m_value)
{
return FalseLiteral;
}
return false;
}
- return (_value == ((Boolean)obj)._value);
+ return (m_value == ((Boolean)obj).m_value);
}
[System.Runtime.Versioning.NonVersionable]
public bool Equals(Boolean obj)
{
- return _value == obj;
+ return m_value == obj;
}
// Compares this object to another object, returning an integer that
throw new ArgumentException(SR.Arg_MustBeBoolean);
}
- if (_value == ((Boolean)obj)._value)
+ if (m_value == ((Boolean)obj).m_value)
{
return 0;
}
- else if (_value == false)
+ else if (m_value == false)
{
return -1;
}
public int CompareTo(Boolean value)
{
- if (_value == value)
+ if (m_value == value)
{
return 0;
}
- else if (_value == false)
+ else if (m_value == false)
{
return -1;
}
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
char IConvertible.ToChar(IFormatProvider provider)
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- return Convert.ToSByte(_value);
+ return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
- return Convert.ToByte(_value);
+ return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider provider)
{
- return Convert.ToInt16(_value);
+ return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- return Convert.ToUInt16(_value);
+ return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
- return Convert.ToInt32(_value);
+ return Convert.ToInt32(m_value);
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- return Convert.ToUInt32(_value);
+ return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider provider)
{
- return Convert.ToInt64(_value);
+ return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- return Convert.ToUInt64(_value);
+ return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
{
- return Convert.ToSingle(_value);
+ return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider provider)
{
- return Convert.ToDouble(_value);
+ return Convert.ToDouble(m_value);
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- return Convert.ToDecimal(_value);
+ return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)
public struct Byte : IComparable, IFormattable, IConvertible
, IComparable<Byte>, IEquatable<Byte>
{
- private byte _value;
+ private byte m_value; // Do not rename (binary serialization)
// The maximum value that a Byte may represent: 255.
public const byte MaxValue = (byte)0xFF;
throw new ArgumentException(SR.Arg_MustBeByte);
}
- return _value - (((Byte)value)._value);
+ return m_value - (((Byte)value).m_value);
}
public int CompareTo(Byte value)
{
- return _value - value;
+ return m_value - value;
}
// Determines whether two Byte objects are equal.
{
return false;
}
- return _value == ((Byte)obj)._value;
+ return m_value == ((Byte)obj).m_value;
}
[System.Runtime.Versioning.NonVersionable]
public bool Equals(Byte obj)
{
- return _value == obj;
+ return m_value == obj;
}
// Gets a hash code for this instance.
public override int GetHashCode()
{
- return _value;
+ return m_value;
}
[Pure]
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt32(_value, null, NumberFormatInfo.CurrentInfo);
+ return Number.FormatInt32(m_value, null, NumberFormatInfo.CurrentInfo);
}
[Pure]
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt32(_value, format, NumberFormatInfo.CurrentInfo);
+ return Number.FormatInt32(m_value, format, NumberFormatInfo.CurrentInfo);
}
[Pure]
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt32(_value, null, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt32(m_value, null, NumberFormatInfo.GetInstance(provider));
}
[Pure]
public String ToString(String format, IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt32(_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt32(m_value, format, NumberFormatInfo.GetInstance(provider));
}
//
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return Convert.ToBoolean(_value);
+ return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider provider)
{
- return Convert.ToChar(_value);
+ return Convert.ToChar(m_value);
}
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- return Convert.ToSByte(_value);
+ return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
short IConvertible.ToInt16(IFormatProvider provider)
{
- return Convert.ToInt16(_value);
+ return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- return Convert.ToUInt16(_value);
+ return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
- return Convert.ToInt32(_value);
+ return Convert.ToInt32(m_value);
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- return Convert.ToUInt32(_value);
+ return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider provider)
{
- return Convert.ToInt64(_value);
+ return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- return Convert.ToUInt64(_value);
+ return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
{
- return Convert.ToSingle(_value);
+ return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider provider)
{
- return Convert.ToDouble(_value);
+ return Convert.ToDouble(m_value);
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- return Convert.ToDecimal(_value);
+ return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)
using System.Globalization;
using System.Runtime;
using System.Runtime.CompilerServices;
+using System.Runtime.Serialization;
using System.Diagnostics.Contracts;
namespace System.Collections.Generic
}
[Serializable]
- internal class EnumEqualityComparer<T> : EqualityComparer<T> where T : struct
+ internal class EnumEqualityComparer<T> : EqualityComparer<T>, ISerializable where T : struct
{
[Pure]
public override bool Equals(T x, T y)
public EnumEqualityComparer() { }
+ // This is used by the serialization engine.
+ protected EnumEqualityComparer(SerializationInfo information, StreamingContext context) { }
+
// Equals method for the comparer itself.
public override bool Equals(Object obj) =>
obj != null && GetType() == obj.GetType();
}
return -1;
}
+
+ public void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ // For back-compat we need to serialize the comparers for enums with underlying types other than int as ObjectEqualityComparer
+ if (Type.GetTypeCode(Enum.GetUnderlyingType(typeof(T))) != TypeCode.Int32) {
+ info.SetType(typeof(ObjectEqualityComparer<T>));
+ }
+ }
}
[Serializable]
{
public SByteEnumEqualityComparer() { }
+ // This is used by the serialization engine.
+ public SByteEnumEqualityComparer(SerializationInfo information, StreamingContext context) { }
+
[Pure]
public override int GetHashCode(T obj)
{
}
[Serializable]
- internal sealed class ShortEnumEqualityComparer<T> : EnumEqualityComparer<T> where T : struct
+ internal sealed class ShortEnumEqualityComparer<T> : EnumEqualityComparer<T>, ISerializable where T : struct
{
public ShortEnumEqualityComparer() { }
+ // This is used by the serialization engine.
+ public ShortEnumEqualityComparer(SerializationInfo information, StreamingContext context) { }
+
[Pure]
public override int GetHashCode(T obj)
{
}
[Serializable]
- internal sealed class LongEnumEqualityComparer<T> : EqualityComparer<T> where T : struct
+ internal sealed class LongEnumEqualityComparer<T> : EqualityComparer<T>, ISerializable where T : struct
{
[Pure]
public override bool Equals(T x, T y)
}
return -1;
}
+
+ // This is used by the serialization engine.
+ public LongEnumEqualityComparer(SerializationInfo information, StreamingContext context) { }
+
+ public void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ // The LongEnumEqualityComparer does not exist on 4.0 so we need to serialize this comparer as ObjectEqualityComparer
+ // to allow for roundtrip between 4.0 and 4.5.
+ info.SetType(typeof(ObjectEqualityComparer<T>));
+ }
}
}
//
[DebuggerTypeProxy(typeof(System.Collections.Hashtable.HashtableDebugView))]
[DebuggerDisplay("Count = {Count}")]
+ [Serializable]
internal class Hashtable : IDictionary, ISerializable, IDeserializationCallback, ICloneable
{
/*
public struct Double : IComparable, IFormattable, IConvertible
, IComparable<Double>, IEquatable<Double>
{
- private double _value;
+ private double m_value; // Do not rename (binary serialization)
//
// Public Constants
if (value is Double)
{
double d = (double)value;
- if (_value < d) return -1;
- if (_value > d) return 1;
- if (_value == d) return 0;
+ if (m_value < d) return -1;
+ if (m_value > d) return 1;
+ if (m_value == d) return 0;
// At least one of the values is NaN.
- if (IsNaN(_value))
+ if (IsNaN(m_value))
return (IsNaN(d) ? 0 : -1);
else
return 1;
public int CompareTo(Double value)
{
- if (_value < value) return -1;
- if (_value > value) return 1;
- if (_value == value) return 0;
+ if (m_value < value) return -1;
+ if (m_value > value) return 1;
+ if (m_value == value) return 0;
// At least one of the values is NaN.
- if (IsNaN(_value))
+ if (IsNaN(m_value))
return (IsNaN(value) ? 0 : -1);
else
return 1;
{
return false;
}
- double temp = ((Double)obj)._value;
+ double temp = ((Double)obj).m_value;
// This code below is written this way for performance reasons i.e the != and == check is intentional.
- if (temp == _value)
+ if (temp == m_value)
{
return true;
}
- return IsNaN(temp) && IsNaN(_value);
+ return IsNaN(temp) && IsNaN(m_value);
}
[System.Runtime.Versioning.NonVersionable]
public bool Equals(Double obj)
{
- if (obj == _value)
+ if (obj == m_value)
{
return true;
}
- return IsNaN(obj) && IsNaN(_value);
+ return IsNaN(obj) && IsNaN(m_value);
}
//The hashcode for a double is the absolute value of the integer representation
//
public unsafe override int GetHashCode()
{
- double d = _value;
+ double d = m_value;
if (d == 0)
{
// Ensure that 0 and -0 have the same hash code
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatDouble(_value, null, NumberFormatInfo.CurrentInfo);
+ return Number.FormatDouble(m_value, null, NumberFormatInfo.CurrentInfo);
}
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatDouble(_value, format, NumberFormatInfo.CurrentInfo);
+ return Number.FormatDouble(m_value, format, NumberFormatInfo.CurrentInfo);
}
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatDouble(_value, null, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatDouble(m_value, null, NumberFormatInfo.GetInstance(provider));
}
public String ToString(String format, IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatDouble(_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatDouble(m_value, format, NumberFormatInfo.GetInstance(provider));
}
public static double Parse(String s)
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return Convert.ToBoolean(_value);
+ return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider provider)
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- return Convert.ToSByte(_value);
+ return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
- return Convert.ToByte(_value);
+ return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider provider)
{
- return Convert.ToInt16(_value);
+ return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- return Convert.ToUInt16(_value);
+ return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
- return Convert.ToInt32(_value);
+ return Convert.ToInt32(m_value);
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- return Convert.ToUInt32(_value);
+ return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider provider)
{
- return Convert.ToInt64(_value);
+ return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- return Convert.ToUInt64(_value);
+ return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
{
- return Convert.ToSingle(_value);
+ return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- return Convert.ToDecimal(_value);
+ return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
_sortName = culture.SortName;
- _name = culture._name;
+ m_name = culture._name;
_sortName = culture.SortName;
if (_invariantMode)
// locale, which is what SCOMPAREINFO does.
[OptionalField(VersionAdded = 2)]
- private string _name; // The name used to construct this CompareInfo
- [NonSerialized]
- private string _sortName; // The name that defines our behavior
+ private string m_name; // The name used to construct this CompareInfo. Do not rename (binary serialization)
+
+ [NonSerialized]
+ private string _sortName; // The name that defines our behavior.
[OptionalField(VersionAdded = 3)]
- private SortVersion _sortVersion;
+ private SortVersion m_sortVersion; // Do not rename (binary serialization)
// _invariantMode is defined for the perf reason as accessing the instance field is faster than access the static property GlobalizationMode.Invariant
- [NonSerialized]
+ [NonSerialized]
private readonly bool _invariantMode = GlobalizationMode.Invariant;
internal CompareInfo(CultureInfo culture)
{
- _name = culture._name;
+ m_name = culture._name;
InitSort(culture);
}
[OnDeserializing]
private void OnDeserializing(StreamingContext ctx)
{
- _name = null;
+ m_name = null;
}
void IDeserializationCallback.OnDeserialization(Object sender)
private void OnDeserialized()
{
- if (_name != null)
+ if (m_name != null)
{
- InitSort(CultureInfo.GetCultureInfo(_name));
+ InitSort(CultureInfo.GetCultureInfo(m_name));
}
}
{
get
{
- Debug.Assert(_name != null, "CompareInfo.Name Expected _name to be set");
- if (_name == "zh-CHT" || _name == "zh-CHS")
+ Debug.Assert(m_name != null, "CompareInfo.Name Expected _name to be set");
+ if (m_name == "zh-CHT" || m_name == "zh-CHS")
{
- return _name;
+ return m_name;
}
return _sortName;
{
get
{
- if (_sortVersion == null)
+ if (m_sortVersion == null)
{
if (_invariantMode)
{
- _sortVersion = new SortVersion(0, CultureInfo.LOCALE_INVARIANT, new Guid(0, 0, 0, 0, 0, 0, 0,
+ m_sortVersion = new SortVersion(0, CultureInfo.LOCALE_INVARIANT, new Guid(0, 0, 0, 0, 0, 0, 0,
(byte) (CultureInfo.LOCALE_INVARIANT >> 24),
(byte) ((CultureInfo.LOCALE_INVARIANT & 0x00FF0000) >> 16),
(byte) ((CultureInfo.LOCALE_INVARIANT & 0x0000FF00) >> 8),
}
else
{
- _sortVersion = GetSortVersion();
+ m_sortVersion = GetSortVersion();
}
}
- return _sortVersion;
+ return m_sortVersion;
}
}
public struct Int16 : IComparable, IFormattable, IConvertible
, IComparable<Int16>, IEquatable<Int16>
{
- private short _value;
+ private short m_value; // Do not rename (binary serialization)
public const short MaxValue = (short)0x7FFF;
public const short MinValue = unchecked((short)0x8000);
if (value is Int16)
{
- return _value - ((Int16)value)._value;
+ return m_value - ((Int16)value).m_value;
}
throw new ArgumentException(SR.Arg_MustBeInt16);
public int CompareTo(Int16 value)
{
- return _value - value;
+ return m_value - value;
}
public override bool Equals(Object obj)
{
return false;
}
- return _value == ((Int16)obj)._value;
+ return m_value == ((Int16)obj).m_value;
}
[System.Runtime.Versioning.NonVersionable]
public bool Equals(Int16 obj)
{
- return _value == obj;
+ return m_value == obj;
}
// Returns a HashCode for the Int16
public override int GetHashCode()
{
- return ((int)((ushort)_value) | (((int)_value) << 16));
+ return ((int)((ushort)m_value) | (((int)m_value) << 16));
}
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt32(_value, null, NumberFormatInfo.CurrentInfo);
+ return Number.FormatInt32(m_value, null, NumberFormatInfo.CurrentInfo);
}
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt32(_value, null, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt32(m_value, null, NumberFormatInfo.GetInstance(provider));
}
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != null);
- if (_value < 0 && format != null && format.Length > 0 && (format[0] == 'X' || format[0] == 'x'))
+ if (m_value < 0 && format != null && format.Length > 0 && (format[0] == 'X' || format[0] == 'x'))
{
- uint temp = (uint)(_value & 0x0000FFFF);
+ uint temp = (uint)(m_value & 0x0000FFFF);
return Number.FormatUInt32(temp, format, info);
}
- return Number.FormatInt32(_value, format, info);
+ return Number.FormatInt32(m_value, format, info);
}
public static short Parse(String s)
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return Convert.ToBoolean(_value);
+ return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider provider)
{
- return Convert.ToChar(_value);
+ return Convert.ToChar(m_value);
}
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- return Convert.ToSByte(_value);
+ return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
- return Convert.ToByte(_value);
+ return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- return Convert.ToUInt16(_value);
+ return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
- return Convert.ToInt32(_value);
+ return Convert.ToInt32(m_value);
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- return Convert.ToUInt32(_value);
+ return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider provider)
{
- return Convert.ToInt64(_value);
+ return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- return Convert.ToUInt64(_value);
+ return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
{
- return Convert.ToSingle(_value);
+ return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider provider)
{
- return Convert.ToDouble(_value);
+ return Convert.ToDouble(m_value);
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- return Convert.ToDecimal(_value);
+ return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)
public struct Int32 : IComparable, IFormattable, IConvertible
, IComparable<Int32>, IEquatable<Int32>
{
- private int _value;
+ private int m_value; // Do not rename (binary serialization)
public const int MaxValue = 0x7fffffff;
public const int MinValue = unchecked((int)0x80000000);
// Need to use compare because subtraction will wrap
// to positive for very large neg numbers, etc.
int i = (int)value;
- if (_value < i) return -1;
- if (_value > i) return 1;
+ if (m_value < i) return -1;
+ if (m_value > i) return 1;
return 0;
}
throw new ArgumentException(SR.Arg_MustBeInt32);
{
// Need to use compare because subtraction will wrap
// to positive for very large neg numbers, etc.
- if (_value < value) return -1;
- if (_value > value) return 1;
+ if (m_value < value) return -1;
+ if (m_value > value) return 1;
return 0;
}
{
return false;
}
- return _value == ((Int32)obj)._value;
+ return m_value == ((Int32)obj).m_value;
}
[System.Runtime.Versioning.NonVersionable]
public bool Equals(Int32 obj)
{
- return _value == obj;
+ return m_value == obj;
}
// The absolute value of the int contained.
public override int GetHashCode()
{
- return _value;
+ return m_value;
}
[Pure]
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt32(_value, null, NumberFormatInfo.CurrentInfo);
+ return Number.FormatInt32(m_value, null, NumberFormatInfo.CurrentInfo);
}
[Pure]
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt32(_value, format, NumberFormatInfo.CurrentInfo);
+ return Number.FormatInt32(m_value, format, NumberFormatInfo.CurrentInfo);
}
[Pure]
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt32(_value, null, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt32(m_value, null, NumberFormatInfo.GetInstance(provider));
}
[Pure]
public String ToString(String format, IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt32(_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt32(m_value, format, NumberFormatInfo.GetInstance(provider));
}
[Pure]
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return Convert.ToBoolean(_value);
+ return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider provider)
{
- return Convert.ToChar(_value);
+ return Convert.ToChar(m_value);
}
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- return Convert.ToSByte(_value);
+ return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
- return Convert.ToByte(_value);
+ return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider provider)
{
- return Convert.ToInt16(_value);
+ return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- return Convert.ToUInt16(_value);
+ return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- return Convert.ToUInt32(_value);
+ return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider provider)
{
- return Convert.ToInt64(_value);
+ return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- return Convert.ToUInt64(_value);
+ return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
{
- return Convert.ToSingle(_value);
+ return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider provider)
{
- return Convert.ToDouble(_value);
+ return Convert.ToDouble(m_value);
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- return Convert.ToDecimal(_value);
+ return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)
public struct Int64 : IComparable, IFormattable, IConvertible
, IComparable<Int64>, IEquatable<Int64>
{
- private long _value;
+ private long m_value; // Do not rename (binary serialization)
public const long MaxValue = 0x7fffffffffffffffL;
public const long MinValue = unchecked((long)0x8000000000000000L);
// Need to use compare because subtraction will wrap
// to positive for very large neg numbers, etc.
long i = (long)value;
- if (_value < i) return -1;
- if (_value > i) return 1;
+ if (m_value < i) return -1;
+ if (m_value > i) return 1;
return 0;
}
throw new ArgumentException(SR.Arg_MustBeInt64);
{
// Need to use compare because subtraction will wrap
// to positive for very large neg numbers, etc.
- if (_value < value) return -1;
- if (_value > value) return 1;
+ if (m_value < value) return -1;
+ if (m_value > value) return 1;
return 0;
}
{
return false;
}
- return _value == ((Int64)obj)._value;
+ return m_value == ((Int64)obj).m_value;
}
[System.Runtime.Versioning.NonVersionable]
public bool Equals(Int64 obj)
{
- return _value == obj;
+ return m_value == obj;
}
// The value of the lower 32 bits XORed with the uppper 32 bits.
public override int GetHashCode()
{
- return (unchecked((int)((long)_value)) ^ (int)(_value >> 32));
+ return (unchecked((int)((long)m_value)) ^ (int)(m_value >> 32));
}
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt64(_value, null, NumberFormatInfo.CurrentInfo);
+ return Number.FormatInt64(m_value, null, NumberFormatInfo.CurrentInfo);
}
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt64(_value, null, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt64(m_value, null, NumberFormatInfo.GetInstance(provider));
}
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt64(_value, format, NumberFormatInfo.CurrentInfo);
+ return Number.FormatInt64(m_value, format, NumberFormatInfo.CurrentInfo);
}
public String ToString(String format, IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt64(_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt64(m_value, format, NumberFormatInfo.GetInstance(provider));
}
public static long Parse(String s)
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return Convert.ToBoolean(_value);
+ return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider provider)
{
- return Convert.ToChar(_value);
+ return Convert.ToChar(m_value);
}
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- return Convert.ToSByte(_value);
+ return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
- return Convert.ToByte(_value);
+ return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider provider)
{
- return Convert.ToInt16(_value);
+ return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- return Convert.ToUInt16(_value);
+ return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
- return Convert.ToInt32(_value);
+ return Convert.ToInt32(m_value);
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- return Convert.ToUInt32(_value);
+ return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- return Convert.ToUInt64(_value);
+ return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
{
- return Convert.ToSingle(_value);
+ return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider provider)
{
- return Convert.ToDouble(_value);
+ return Convert.ToDouble(m_value);
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- return Convert.ToDecimal(_value);
+ return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)
public struct SByte : IComparable, IFormattable, IConvertible
, IComparable<SByte>, IEquatable<SByte>
{
- private sbyte _value;
+ private sbyte m_value; // Do not rename (binary serialization)
// The maximum value that a Byte may represent: 127.
public const sbyte MaxValue = (sbyte)0x7F;
{
throw new ArgumentException(SR.Arg_MustBeSByte);
}
- return _value - ((SByte)obj)._value;
+ return m_value - ((SByte)obj).m_value;
}
public int CompareTo(SByte value)
{
- return _value - value;
+ return m_value - value;
}
// Determines whether two Byte objects are equal.
{
return false;
}
- return _value == ((SByte)obj)._value;
+ return m_value == ((SByte)obj).m_value;
}
[System.Runtime.Versioning.NonVersionable]
public bool Equals(SByte obj)
{
- return _value == obj;
+ return m_value == obj;
}
// Gets a hash code for this instance.
public override int GetHashCode()
{
- return ((int)_value ^ (int)_value << 8);
+ return ((int)m_value ^ (int)m_value << 8);
}
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt32(_value, null, NumberFormatInfo.CurrentInfo);
+ return Number.FormatInt32(m_value, null, NumberFormatInfo.CurrentInfo);
}
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatInt32(_value, null, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt32(m_value, null, NumberFormatInfo.GetInstance(provider));
}
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != null);
- if (_value < 0 && format != null && format.Length > 0 && (format[0] == 'X' || format[0] == 'x'))
+ if (m_value < 0 && format != null && format.Length > 0 && (format[0] == 'X' || format[0] == 'x'))
{
- uint temp = (uint)(_value & 0x000000FF);
+ uint temp = (uint)(m_value & 0x000000FF);
return Number.FormatUInt32(temp, format, info);
}
- return Number.FormatInt32(_value, format, info);
+ return Number.FormatInt32(m_value, format, info);
}
[CLSCompliant(false)]
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return Convert.ToBoolean(_value);
+ return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider provider)
{
- return Convert.ToChar(_value);
+ return Convert.ToChar(m_value);
}
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
byte IConvertible.ToByte(IFormatProvider provider)
{
- return Convert.ToByte(_value);
+ return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider provider)
{
- return Convert.ToInt16(_value);
+ return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- return Convert.ToUInt16(_value);
+ return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- return Convert.ToUInt32(_value);
+ return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider provider)
{
- return Convert.ToInt64(_value);
+ return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- return Convert.ToUInt64(_value);
+ return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
{
- return Convert.ToSingle(_value);
+ return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider provider)
{
- return Convert.ToDouble(_value);
+ return Convert.ToDouble(m_value);
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- return Convert.ToDecimal(_value);
+ return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)
public struct Single : IComparable, IFormattable, IConvertible
, IComparable<Single>, IEquatable<Single>
{
- private float _value;
+ private float m_value; // Do not rename (binary serialization)
//
// Public constants
if (value is Single)
{
float f = (float)value;
- if (_value < f) return -1;
- if (_value > f) return 1;
- if (_value == f) return 0;
+ if (m_value < f) return -1;
+ if (m_value > f) return 1;
+ if (m_value == f) return 0;
// At least one of the values is NaN.
- if (IsNaN(_value))
+ if (IsNaN(m_value))
return (IsNaN(f) ? 0 : -1);
else // f is NaN.
return 1;
public int CompareTo(Single value)
{
- if (_value < value) return -1;
- if (_value > value) return 1;
- if (_value == value) return 0;
+ if (m_value < value) return -1;
+ if (m_value > value) return 1;
+ if (m_value == value) return 0;
// At least one of the values is NaN.
- if (IsNaN(_value))
+ if (IsNaN(m_value))
return (IsNaN(value) ? 0 : -1);
else // f is NaN.
return 1;
{
return false;
}
- float temp = ((Single)obj)._value;
- if (temp == _value)
+ float temp = ((Single)obj).m_value;
+ if (temp == m_value)
{
return true;
}
- return IsNaN(temp) && IsNaN(_value);
+ return IsNaN(temp) && IsNaN(m_value);
}
public bool Equals(Single obj)
{
- if (obj == _value)
+ if (obj == m_value)
{
return true;
}
- return IsNaN(obj) && IsNaN(_value);
+ return IsNaN(obj) && IsNaN(m_value);
}
public unsafe override int GetHashCode()
{
- float f = _value;
+ float f = m_value;
if (f == 0)
{
// Ensure that 0 and -0 have the same hash code
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatSingle(_value, null, NumberFormatInfo.CurrentInfo);
+ return Number.FormatSingle(m_value, null, NumberFormatInfo.CurrentInfo);
}
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatSingle(_value, null, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatSingle(m_value, null, NumberFormatInfo.GetInstance(provider));
}
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatSingle(_value, format, NumberFormatInfo.CurrentInfo);
+ return Number.FormatSingle(m_value, format, NumberFormatInfo.CurrentInfo);
}
public String ToString(String format, IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatSingle(_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatSingle(m_value, format, NumberFormatInfo.GetInstance(provider));
}
// Parses a float from a String in the given style. If
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return Convert.ToBoolean(_value);
+ return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider provider)
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- return Convert.ToSByte(_value);
+ return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
- return Convert.ToByte(_value);
+ return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider provider)
{
- return Convert.ToInt16(_value);
+ return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- return Convert.ToUInt16(_value);
+ return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
- return Convert.ToInt32(_value);
+ return Convert.ToInt32(m_value);
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- return Convert.ToUInt32(_value);
+ return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider provider)
{
- return Convert.ToInt64(_value);
+ return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- return Convert.ToUInt64(_value);
+ return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
double IConvertible.ToDouble(IFormatProvider provider)
{
- return Convert.ToDouble(_value);
+ return Convert.ToDouble(m_value);
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- return Convert.ToDecimal(_value);
+ return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)
public struct UInt16 : IComparable, IFormattable, IConvertible
, IComparable<UInt16>, IEquatable<UInt16>
{
- private ushort _value;
+ private ushort m_value; // Do not rename (binary serialization)
public const ushort MaxValue = (ushort)0xFFFF;
public const ushort MinValue = 0;
}
if (value is UInt16)
{
- return ((int)_value - (int)(((UInt16)value)._value));
+ return ((int)m_value - (int)(((UInt16)value).m_value));
}
throw new ArgumentException(SR.Arg_MustBeUInt16);
}
public int CompareTo(UInt16 value)
{
- return ((int)_value - (int)value);
+ return ((int)m_value - (int)value);
}
public override bool Equals(Object obj)
{
return false;
}
- return _value == ((UInt16)obj)._value;
+ return m_value == ((UInt16)obj).m_value;
}
[System.Runtime.Versioning.NonVersionable]
public bool Equals(UInt16 obj)
{
- return _value == obj;
+ return m_value == obj;
}
// Returns a HashCode for the UInt16
public override int GetHashCode()
{
- return (int)_value;
+ return (int)m_value;
}
// Converts the current value to a String in base-10 with no extra padding.
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatUInt32(_value, null, NumberFormatInfo.CurrentInfo);
+ return Number.FormatUInt32(m_value, null, NumberFormatInfo.CurrentInfo);
}
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatUInt32(_value, null, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatUInt32(m_value, null, NumberFormatInfo.GetInstance(provider));
}
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatUInt32(_value, format, NumberFormatInfo.CurrentInfo);
+ return Number.FormatUInt32(m_value, format, NumberFormatInfo.CurrentInfo);
}
public String ToString(String format, IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatUInt32(_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatUInt32(m_value, format, NumberFormatInfo.GetInstance(provider));
}
[CLSCompliant(false)]
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return Convert.ToBoolean(_value);
+ return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider provider)
{
- return Convert.ToChar(_value);
+ return Convert.ToChar(m_value);
}
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- return Convert.ToSByte(_value);
+ return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
- return Convert.ToByte(_value);
+ return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider provider)
{
- return Convert.ToInt16(_value);
+ return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
int IConvertible.ToInt32(IFormatProvider provider)
{
- return Convert.ToInt32(_value);
+ return Convert.ToInt32(m_value);
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- return Convert.ToUInt32(_value);
+ return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider provider)
{
- return Convert.ToInt64(_value);
+ return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- return Convert.ToUInt64(_value);
+ return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
{
- return Convert.ToSingle(_value);
+ return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider provider)
{
- return Convert.ToDouble(_value);
+ return Convert.ToDouble(m_value);
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- return Convert.ToDecimal(_value);
+ return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)
public struct UInt32 : IComparable, IFormattable, IConvertible
, IComparable<UInt32>, IEquatable<UInt32>
{
- private uint _value;
+ private uint m_value; // Do not rename (binary serialization)
public const uint MaxValue = (uint)0xffffffff;
public const uint MinValue = 0U;
// Need to use compare because subtraction will wrap
// to positive for very large neg numbers, etc.
uint i = (uint)value;
- if (_value < i) return -1;
- if (_value > i) return 1;
+ if (m_value < i) return -1;
+ if (m_value > i) return 1;
return 0;
}
throw new ArgumentException(SR.Arg_MustBeUInt32);
{
// Need to use compare because subtraction will wrap
// to positive for very large neg numbers, etc.
- if (_value < value) return -1;
- if (_value > value) return 1;
+ if (m_value < value) return -1;
+ if (m_value > value) return 1;
return 0;
}
{
return false;
}
- return _value == ((UInt32)obj)._value;
+ return m_value == ((UInt32)obj).m_value;
}
[System.Runtime.Versioning.NonVersionable]
public bool Equals(UInt32 obj)
{
- return _value == obj;
+ return m_value == obj;
}
// The absolute value of the int contained.
public override int GetHashCode()
{
- return ((int)_value);
+ return ((int)m_value);
}
// The base 10 representation of the number with no extra padding.
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatUInt32(_value, null, NumberFormatInfo.CurrentInfo);
+ return Number.FormatUInt32(m_value, null, NumberFormatInfo.CurrentInfo);
}
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatUInt32(_value, null, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatUInt32(m_value, null, NumberFormatInfo.GetInstance(provider));
}
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatUInt32(_value, format, NumberFormatInfo.CurrentInfo);
+ return Number.FormatUInt32(m_value, format, NumberFormatInfo.CurrentInfo);
}
public String ToString(String format, IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatUInt32(_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatUInt32(m_value, format, NumberFormatInfo.GetInstance(provider));
}
[CLSCompliant(false)]
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return Convert.ToBoolean(_value);
+ return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider provider)
{
- return Convert.ToChar(_value);
+ return Convert.ToChar(m_value);
}
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- return Convert.ToSByte(_value);
+ return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
- return Convert.ToByte(_value);
+ return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider provider)
{
- return Convert.ToInt16(_value);
+ return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- return Convert.ToUInt16(_value);
+ return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
- return Convert.ToInt32(_value);
+ return Convert.ToInt32(m_value);
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
long IConvertible.ToInt64(IFormatProvider provider)
{
- return Convert.ToInt64(_value);
+ return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- return Convert.ToUInt64(_value);
+ return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
{
- return Convert.ToSingle(_value);
+ return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider provider)
{
- return Convert.ToDouble(_value);
+ return Convert.ToDouble(m_value);
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- return Convert.ToDecimal(_value);
+ return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)
public struct UInt64 : IComparable, IFormattable, IConvertible
, IComparable<UInt64>, IEquatable<UInt64>
{
- private ulong _value;
+ private ulong m_value; // Do not rename (binary serialization)
public const ulong MaxValue = (ulong)0xffffffffffffffffL;
public const ulong MinValue = 0x0;
// Need to use compare because subtraction will wrap
// to positive for very large neg numbers, etc.
ulong i = (ulong)value;
- if (_value < i) return -1;
- if (_value > i) return 1;
+ if (m_value < i) return -1;
+ if (m_value > i) return 1;
return 0;
}
throw new ArgumentException(SR.Arg_MustBeUInt64);
{
// Need to use compare because subtraction will wrap
// to positive for very large neg numbers, etc.
- if (_value < value) return -1;
- if (_value > value) return 1;
+ if (m_value < value) return -1;
+ if (m_value > value) return 1;
return 0;
}
{
return false;
}
- return _value == ((UInt64)obj)._value;
+ return m_value == ((UInt64)obj).m_value;
}
[System.Runtime.Versioning.NonVersionable]
public bool Equals(UInt64 obj)
{
- return _value == obj;
+ return m_value == obj;
}
// The value of the lower 32 bits XORed with the uppper 32 bits.
public override int GetHashCode()
{
- return ((int)_value) ^ (int)(_value >> 32);
+ return ((int)m_value) ^ (int)(m_value >> 32);
}
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatUInt64(_value, null, NumberFormatInfo.CurrentInfo);
+ return Number.FormatUInt64(m_value, null, NumberFormatInfo.CurrentInfo);
}
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatUInt64(_value, null, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatUInt64(m_value, null, NumberFormatInfo.GetInstance(provider));
}
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatUInt64(_value, format, NumberFormatInfo.CurrentInfo);
+ return Number.FormatUInt64(m_value, format, NumberFormatInfo.CurrentInfo);
}
public String ToString(String format, IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Number.FormatUInt64(_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatUInt64(m_value, format, NumberFormatInfo.GetInstance(provider));
}
[CLSCompliant(false)]
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return Convert.ToBoolean(_value);
+ return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider provider)
{
- return Convert.ToChar(_value);
+ return Convert.ToChar(m_value);
}
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- return Convert.ToSByte(_value);
+ return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
- return Convert.ToByte(_value);
+ return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider provider)
{
- return Convert.ToInt16(_value);
+ return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- return Convert.ToUInt16(_value);
+ return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
- return Convert.ToInt32(_value);
+ return Convert.ToInt32(m_value);
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- return Convert.ToUInt32(_value);
+ return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider provider)
{
- return Convert.ToInt64(_value);
+ return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- return _value;
+ return m_value;
}
float IConvertible.ToSingle(IFormatProvider provider)
{
- return Convert.ToSingle(_value);
+ return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider provider)
{
- return Convert.ToDouble(_value);
+ return Convert.ToDouble(m_value);
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- return Convert.ToDecimal(_value);
+ return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)