Coretype variables renamed back to netfx counterpart for reflection based serializati...
authorViktor Hofer <viktor.hofer@microsoft.com>
Wed, 31 May 2017 00:16:32 +0000 (02:16 +0200)
committerDan Moseley <danmose@microsoft.com>
Wed, 31 May 2017 00:16:32 +0000 (17:16 -0700)
* Variables renamed for reflection based serialization

* Make EqualityComparers serialize like desktop

* add missing interfaces

* TimeZone serializable added

* Internal hashtable serializable

* Removed TimeZone as serializable type

* Remove Lazy<T>'s [Serializable] attribute for 2.0

For performance, Lazy was completely rewritten for .NET Core 2.0 and has an entirely different format than desktop; trying to get it to match the desktop serialization format would require either reverting or providing a complicated custom serialization/deserialization implementation to try to match.  Lazy can also wrap an Exception that occurred from trying to instantiate the object, and the only exception types that are serializable as of now in core are the base Exception and AggregateException.  As such, we're cutting it from the list of supported types in 2.0.  An easy workaround is simply to do what the implementation does: serialize lazy.Value instead of lazy.

* tiny fixes to equalitycomparer.cs

19 files changed:
src/mscorlib/shared/System/Char.cs
src/mscorlib/shared/System/Globalization/SortVersion.cs
src/mscorlib/shared/System/Lazy.cs
src/mscorlib/shared/System/TimeZone.cs
src/mscorlib/src/System/Boolean.cs
src/mscorlib/src/System/Byte.cs
src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs
src/mscorlib/src/System/Collections/Hashtable.cs
src/mscorlib/src/System/Double.cs
src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs
src/mscorlib/src/System/Globalization/CompareInfo.cs
src/mscorlib/src/System/Int16.cs
src/mscorlib/src/System/Int32.cs
src/mscorlib/src/System/Int64.cs
src/mscorlib/src/System/SByte.cs
src/mscorlib/src/System/Single.cs
src/mscorlib/src/System/UInt16.cs
src/mscorlib/src/System/UInt32.cs
src/mscorlib/src/System/UInt64.cs

index cb2a512193d95d66c0e7484999337d4b6a367066..3fad7a4827a1d9a7a4be56a63e2c62a900a86fff 100644 (file)
@@ -26,7 +26,7 @@ namespace System
         //
         // Member Variables
         //
-        private char _value;
+        private char m_value; // Do not rename (binary serialization)
 
         //
         // Public Constants
@@ -102,7 +102,7 @@ namespace System
         // 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.
@@ -113,13 +113,13 @@ namespace System
             {
                 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
@@ -140,13 +140,13 @@ namespace System
                 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.
@@ -154,14 +154,14 @@ namespace System
         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);
         }
 
         //
@@ -477,47 +477,47 @@ namespace System
 
         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)
index a7aef6d84bffaa322ec2f59cbee807d26e19f015..94c04d7063923cc1969500d15d44a1719728a560 100644 (file)
@@ -7,14 +7,14 @@ namespace System.Globalization
     [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;
             }
         }
 
@@ -22,19 +22,19 @@ namespace System.Globalization
         {
             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)
             {
@@ -45,7 +45,7 @@ namespace System.Globalization
                 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)
@@ -66,12 +66,12 @@ namespace System.Globalization
                 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)
index 55f915b65db5c6ed5e520b8b24c4423abde48285..5d68714c7ebb98364cedc79848207c7bab8f2c0c 100644 (file)
@@ -182,7 +182,6 @@ namespace System
     /// 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>
@@ -202,7 +201,7 @@ namespace System
         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 
@@ -226,7 +225,7 @@ namespace System
         /// </remarks>
         public Lazy(T value)
         {
-            _value = value;
+            m_value = value;
         }
 
         /// <summary>
@@ -312,7 +311,7 @@ namespace System
 
         private void ViaConstructor()
         {
-            _value = CreateViaDefaultConstructor();
+            m_value = CreateViaDefaultConstructor();
             _state = null; // volatile write, must occur after setting _value
         }
 
@@ -325,7 +324,7 @@ namespace System
                     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)
@@ -361,7 +360,7 @@ namespace System
             if (previous == publicationOnly)
             {
                 _factory = null;
-                _value = possibleValue;
+                m_value = possibleValue;
                 _state = null; // volatile write, must occur after setting _value
             }
         }
@@ -469,7 +468,7 @@ namespace System
                 {
                     return default(T);
                 }
-                return _value;
+                return m_value;
             }
         }
 
@@ -516,7 +515,7 @@ namespace System
         /// 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&lt;T&gt; to surface additional debugging properties and 
index 88e2e218641edd9e015ea65c4c84414c7a33fb64..d4059babfc30e614e7d02fcba760a6a2946aa5ad 100644 (file)
@@ -26,7 +26,6 @@ using System.Globalization;
 
 namespace System
 {
-    [Serializable]
     [Obsolete("System.TimeZone has been deprecated.  Please investigate the use of System.TimeZoneInfo instead.")]
     public abstract class TimeZone
     {
index dda14278427fdb970447361176c37a59fc8ec2f7..59cab744563940279cc87e0ed8521985c5910832 100644 (file)
@@ -26,10 +26,10 @@ namespace System
         //
         // 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.
@@ -74,7 +74,7 @@ namespace System
         // Provides a hash code for this instance.
         public override int GetHashCode()
         {
-            return (_value) ? True : False;
+            return (m_value) ? True : False;
         }
 
         /*===================================ToString===================================
@@ -85,7 +85,7 @@ namespace System
         // Converts the boolean value of this instance to a String.
         public override String ToString()
         {
-            if (false == _value)
+            if (false == m_value)
             {
                 return FalseLiteral;
             }
@@ -94,7 +94,7 @@ namespace System
 
         public String ToString(IFormatProvider provider)
         {
-            if (false == _value)
+            if (false == m_value)
             {
                 return FalseLiteral;
             }
@@ -110,13 +110,13 @@ namespace System
                 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
@@ -137,11 +137,11 @@ namespace System
                 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;
             }
@@ -150,11 +150,11 @@ namespace System
 
         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;
             }
@@ -261,7 +261,7 @@ namespace System
 
         bool IConvertible.ToBoolean(IFormatProvider provider)
         {
-            return _value;
+            return m_value;
         }
 
         char IConvertible.ToChar(IFormatProvider provider)
@@ -271,57 +271,57 @@ namespace System
 
         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)
index 187e966c1324862896ab05f645e905e86d9fd73b..da3b790ac6f6abdc12f598b5770301e1f80d4c7b 100644 (file)
@@ -28,7 +28,7 @@ namespace System
     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;
@@ -54,12 +54,12 @@ namespace System
                 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.
@@ -69,19 +69,19 @@ namespace System
             {
                 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]
@@ -161,28 +161,28 @@ namespace System
         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));
         }
 
         //
@@ -197,67 +197,67 @@ namespace System
 
         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)
index 0cd1bc1c12ed773d517fa7e6f8ff2330a8b45816..d6b213c9d7913a7735f31680b9e03da81ab0eb38 100644 (file)
@@ -10,6 +10,7 @@ using System.Security;
 using System.Globalization;
 using System.Runtime;
 using System.Runtime.CompilerServices;
+using System.Runtime.Serialization;
 using System.Diagnostics.Contracts;
 
 namespace System.Collections.Generic
@@ -352,7 +353,7 @@ 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)
@@ -371,6 +372,9 @@ namespace System.Collections.Generic
 
         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();
@@ -401,6 +405,14 @@ namespace System.Collections.Generic
             }
             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]
@@ -408,6 +420,9 @@ namespace System.Collections.Generic
     {
         public SByteEnumEqualityComparer() { }
 
+        // This is used by the serialization engine.
+        public SByteEnumEqualityComparer(SerializationInfo information, StreamingContext context) { }
+
         [Pure]
         public override int GetHashCode(T obj)
         {
@@ -417,10 +432,13 @@ namespace System.Collections.Generic
     }
 
     [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)
         {
@@ -430,7 +448,7 @@ namespace System.Collections.Generic
     }
 
     [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)
@@ -479,5 +497,15 @@ namespace System.Collections.Generic
             }
             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>));
+        }
     }
 }
index 0c8963282821b1c82be05c61d126692a2338314f..3967fcfadc5544fcd8467513ad2d9db3874d90f7 100644 (file)
@@ -66,6 +66,7 @@ namespace System.Collections
     // 
     [DebuggerTypeProxy(typeof(System.Collections.Hashtable.HashtableDebugView))]
     [DebuggerDisplay("Count = {Count}")]
+    [Serializable]
     internal class Hashtable : IDictionary, ISerializable, IDeserializationCallback, ICloneable
     {
         /*
index 00a401b78c00baa9f9323ffceea90bcfccbe507a..30fa1a58b35f70cd44a0efb4a7de745b421cf2b4 100644 (file)
@@ -26,7 +26,7 @@ namespace System
     public struct Double : IComparable, IFormattable, IConvertible
             , IComparable<Double>, IEquatable<Double>
     {
-        private double _value;
+        private double m_value; // Do not rename (binary serialization)
 
         //
         // Public Constants
@@ -110,12 +110,12 @@ namespace System
             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;
@@ -125,12 +125,12 @@ namespace System
 
         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;
@@ -144,13 +144,13 @@ namespace System
             {
                 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]
@@ -191,11 +191,11 @@ namespace System
 
         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
@@ -203,7 +203,7 @@ namespace System
         //
         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
@@ -216,25 +216,25 @@ namespace System
         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)
@@ -323,7 +323,7 @@ namespace System
 
         bool IConvertible.ToBoolean(IFormatProvider provider)
         {
-            return Convert.ToBoolean(_value);
+            return Convert.ToBoolean(m_value);
         }
 
         char IConvertible.ToChar(IFormatProvider provider)
@@ -333,57 +333,57 @@ namespace System
 
         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)
index 143a6bcaa15431ce815d658de551397bcac634ef..eb4dc5613edd81079e162680e63f7a93680454e9 100644 (file)
@@ -16,7 +16,7 @@ namespace System.Globalization
         {
             _sortName = culture.SortName;
 
-            _name = culture._name;
+            m_name = culture._name;
             _sortName = culture.SortName;
 
             if (_invariantMode)
index 4f43c67272f4a3becf3d03d0a5e5a8a32f0b4087..593e86415d612557f145867cc931ce44985630d8 100644 (file)
@@ -63,20 +63,21 @@ namespace System.Globalization
         // 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);
         }
 
@@ -216,7 +217,7 @@ namespace System.Globalization
         [OnDeserializing]
         private void OnDeserializing(StreamingContext ctx)
         {
-            _name = null;
+            m_name = null;
         }
 
         void IDeserializationCallback.OnDeserialization(Object sender)
@@ -232,9 +233,9 @@ namespace System.Globalization
 
         private void OnDeserialized()
         {
-            if (_name != null)
+            if (m_name != null)
             {
-                InitSort(CultureInfo.GetCultureInfo(_name));
+                InitSort(CultureInfo.GetCultureInfo(m_name));
             }
         }
 
@@ -258,10 +259,10 @@ namespace System.Globalization
         {
             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;
@@ -1207,11 +1208,11 @@ namespace System.Globalization
         {
             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),
@@ -1219,11 +1220,11 @@ namespace System.Globalization
                     }
                     else
                     {
-                        _sortVersion = GetSortVersion();
+                        m_sortVersion = GetSortVersion();
                     }
                 }
 
-                return _sortVersion;
+                return m_sortVersion;
             }
         }
 
index 4fc9e6bf730936c2091cd9e448b78b0ce75af46c..aced05df6dc0c9f3d1cbef6e9e6fa05073b3c1c3 100644 (file)
@@ -25,7 +25,7 @@ namespace System
     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);
@@ -45,7 +45,7 @@ namespace System
 
             if (value is Int16)
             {
-                return _value - ((Int16)value)._value;
+                return m_value - ((Int16)value).m_value;
             }
 
             throw new ArgumentException(SR.Arg_MustBeInt16);
@@ -53,7 +53,7 @@ namespace System
 
         public int CompareTo(Int16 value)
         {
-            return _value - value;
+            return m_value - value;
         }
 
         public override bool Equals(Object obj)
@@ -62,32 +62,32 @@ namespace System
             {
                 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)
@@ -106,12 +106,12 @@ namespace System
         {
             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)
@@ -215,67 +215,67 @@ namespace System
 
         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)
index 05b02a75190f83c473ac4ab9a448dc2511e78d4e..afee0e42d723b79c7943dcbef360cefddee42f9f 100644 (file)
@@ -25,7 +25,7 @@ namespace System
     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);
@@ -47,8 +47,8 @@ namespace System
                 // 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);
@@ -58,8 +58,8 @@ namespace System
         {
             // 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;
         }
 
@@ -69,47 +69,47 @@ namespace System
             {
                 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]
@@ -177,67 +177,67 @@ namespace System
 
         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)
index 045c212250b38ad5bfb060b82a5107f1b7688e46..619bf7e5d7d55d6fb9a9fb63a1bc2388f82d3e40 100644 (file)
@@ -24,7 +24,7 @@ namespace System
     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);
@@ -46,8 +46,8 @@ namespace System
                 // 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);
@@ -57,8 +57,8 @@ namespace System
         {
             // 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;
         }
 
@@ -68,43 +68,43 @@ namespace System
             {
                 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)
@@ -156,67 +156,67 @@ namespace System
 
         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)
index ee64e9cc796209ca41de2b4f4ac21641f84e27a6..9e550936fe62af46d1876b7570a4bfd661277f0e 100644 (file)
@@ -24,7 +24,7 @@ namespace System
     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;
@@ -49,12 +49,12 @@ namespace System
             {
                 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.
@@ -64,19 +64,19 @@ namespace System
             {
                 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);
         }
 
 
@@ -84,13 +84,13 @@ namespace System
         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)
@@ -109,12 +109,12 @@ namespace System
         {
             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)]
@@ -224,67 +224,67 @@ namespace System
 
         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)
index 60418676f348aa59094adb7fb931ddec2639a6fe..24e6839be6781bd9e698be1536965c2de9374988 100644 (file)
@@ -25,7 +25,7 @@ namespace System
     public struct Single : IComparable, IFormattable, IConvertible
             , IComparable<Single>, IEquatable<Single>
     {
-        private float _value;
+        private float m_value; // Do not rename (binary serialization)
 
         //
         // Public constants
@@ -88,12 +88,12 @@ namespace System
             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;
@@ -104,12 +104,12 @@ namespace System
 
         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;
@@ -157,28 +157,28 @@ namespace System
             {
                 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
@@ -191,25 +191,25 @@ namespace System
         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
@@ -299,7 +299,7 @@ namespace System
 
         bool IConvertible.ToBoolean(IFormatProvider provider)
         {
-            return Convert.ToBoolean(_value);
+            return Convert.ToBoolean(m_value);
         }
 
         char IConvertible.ToChar(IFormatProvider provider)
@@ -309,57 +309,57 @@ namespace System
 
         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)
index fcd7ab92047f0a8dab9d984620431a246033bbc9..c7be2e9a1fcd7791848b71cdc99119fe2aa2ce22 100644 (file)
@@ -24,7 +24,7 @@ namespace System
     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;
@@ -44,14 +44,14 @@ namespace System
             }
             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)
@@ -60,45 +60,45 @@ namespace System
             {
                 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)]
@@ -184,67 +184,67 @@ namespace System
 
         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)
index 83af625949213ba9efd7edfe3a9ca0eaa6b0ae25..2731047e06a5e63d5973c9d310f9247dd8b8bad6 100644 (file)
@@ -26,7 +26,7 @@ namespace System
     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;
@@ -49,8 +49,8 @@ namespace System
                 // 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);
@@ -60,8 +60,8 @@ namespace System
         {
             // 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;
         }
 
@@ -71,44 +71,44 @@ namespace System
             {
                 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)]
@@ -162,67 +162,67 @@ namespace System
 
         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)
index d6a1625af021f034cd46c6254aff2b7e72ca8530..a54bb69ba481c62dac4c1fbe8de5cbfe47b5a92a 100644 (file)
@@ -24,7 +24,7 @@ namespace System
     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;
@@ -46,8 +46,8 @@ namespace System
                 // 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);
@@ -57,8 +57,8 @@ namespace System
         {
             // 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;
         }
 
@@ -68,43 +68,43 @@ namespace System
             {
                 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)]
@@ -157,67 +157,67 @@ namespace System
 
         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)