Thread: NullableTypes/src/Types NullableBoolean.cs,1.22,1.23 NullableByte.cs,1.18,1.19 NullableDateTime.cs,1
Status: Inactive
Brought to you by:
lukadotnet
From: <luk...@us...> - 2004-02-20 00:53:12
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8752/src/Types Modified Files: NullableBoolean.cs NullableByte.cs NullableDateTime.cs NullableDecimal.cs NullableDouble.cs NullableInt16.cs NullableInt32.cs NullableInt64.cs NullableSingle.cs NullableString.cs TypeCode.cs Log Message: Index: NullableBoolean.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableBoolean.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** NullableBoolean.cs 8 Dec 2003 21:48:41 -0000 1.22 --- NullableBoolean.cs 20 Feb 2004 00:42:22 -0000 1.23 *************** *** 26,29 **** --- 26,30 ---- // other types in NullableTypes // 08-Dic-2003 Luca Bug Fix Replaced ReadString() with ReadElementString() in IXmlSerializable.ReadXml + // 18-Feb-2004 Luca Bug Fix ReadXml must read nil value also with a non empty element // *************** *** 275,280 **** [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! if (!reader.IsEmptyElement) { ! _value = (sbyte)(sysXml.XmlConvert.ToBoolean(reader.ReadElementString()) ? 1 : -1); } else --- 276,284 ---- [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! string nilValue = reader["nil", "http://www.w3.org/2001/XMLSchema-instance"]; ! string elementValue = reader.IsEmptyElement ? null : reader.ReadElementString(); ! ! if (nilValue == null || nilValue == "false" || nilValue == "0") { ! _value = (sbyte)(sysXml.XmlConvert.ToBoolean(elementValue) ? 1 : -1); } else Index: NullableByte.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableByte.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NullableByte.cs 8 Dec 2003 21:53:16 -0000 1.18 --- NullableByte.cs 20 Feb 2004 00:42:22 -0000 1.19 *************** *** 22,25 **** --- 22,26 ---- // 06-Dic-2003 Luca Bug Fix Replaced Target Namespace for Xml Schema to avoid duplicate namespace with // other types in NullableTypes + // 18-Feb-2004 Luca Bug Fix ReadXml must read nil value also with a non empty element // *************** *** 242,247 **** [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! if (!reader.IsEmptyElement) { ! _value = sysXml.XmlConvert.ToByte(reader.ReadElementString()); _notNull = true; } --- 243,251 ---- [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! string nilValue = reader["nil", "http://www.w3.org/2001/XMLSchema-instance"]; ! string elementValue = reader.IsEmptyElement ? null : reader.ReadElementString(); ! ! if (nilValue == null || nilValue == "false" || nilValue == "0") { ! _value = sysXml.XmlConvert.ToByte(elementValue); _notNull = true; } Index: NullableDateTime.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableDateTime.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** NullableDateTime.cs 8 Dec 2003 21:57:27 -0000 1.20 --- NullableDateTime.cs 20 Feb 2004 00:42:22 -0000 1.21 *************** *** 26,29 **** --- 26,30 ---- // 06-Dic-2003 Luca Bug Fix Replaced Target Namespace for Xml Schema to avoid duplicate namespace with // other types in NullableTypes + // 18-Feb-2004 Luca Bug Fix ReadXml must read nil value also with a non empty element // *************** *** 131,135 **** /// <param name="year">The year (1 through 9999).</param> /// <param name="month">The month (1 through 12).</param> ! /// <param name="day">The day (1 through the number of days in <code>month</code>.</param> public NullableDateTime(int year, int month, int day) { _value = new sys.DateTime(year, month, day); --- 132,136 ---- /// <param name="year">The year (1 through 9999).</param> /// <param name="month">The month (1 through 12).</param> ! /// <param name="day">The day (1 through the number of days in <paramref name="month"/>.</param> public NullableDateTime(int year, int month, int day) { _value = new sys.DateTime(year, month, day); *************** *** 143,147 **** /// <param name="year">The year (1 through 9999).</param> /// <param name="month">The month (1 through 12).</param> ! /// <param name="day">The day (1 through the number of days in <code>month</code>.</param> /// <param name="hour">The hours (0 through 23).</param> /// <param name="minute">The minutes (0 through 59).</param> --- 144,148 ---- /// <param name="year">The year (1 through 9999).</param> /// <param name="month">The month (1 through 12).</param> ! /// <param name="day">The day (1 through the number of days in <paramref name="month"/>.</param> /// <param name="hour">The hours (0 through 23).</param> /// <param name="minute">The minutes (0 through 59).</param> *************** *** 158,162 **** /// <param name="year">The year (1 through 9999).</param> /// <param name="month">The month (1 through 12).</param> ! /// <param name="day">The day (1 through the number of days in <code>month</code>.</param> /// <param name="hour">The hours (0 through 23).</param> /// <param name="minute">The minutes (0 through 59).</param> --- 159,163 ---- /// <param name="year">The year (1 through 9999).</param> /// <param name="month">The month (1 through 12).</param> ! /// <param name="day">The day (1 through the number of days in <paramref name="month"/>.</param> /// <param name="hour">The hours (0 through 23).</param> /// <param name="minute">The minutes (0 through 59).</param> *************** *** 276,281 **** [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! if (!reader.IsEmptyElement) { ! _value = sys.Xml.XmlConvert.ToDateTime(reader.ReadElementString()); _notNull = true; } --- 277,285 ---- [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! string nilValue = reader["nil", "http://www.w3.org/2001/XMLSchema-instance"]; ! string elementValue = reader.IsEmptyElement ? null : reader.ReadElementString(); ! ! if (nilValue == null || nilValue == "false" || nilValue == "0") { ! _value = sys.Xml.XmlConvert.ToDateTime(elementValue); _notNull = true; } *************** *** 292,296 **** /// </summary> /// <param name="value">An object to compare, or null reference</param> ! /// <returns>True if the instance is equal to <code>value</code>. /// False otherwise. /// </returns> --- 296,300 ---- /// </summary> /// <param name="value">An object to compare, or null reference</param> ! /// <returns>True if the instance is equal to <paramref name="value"/>. /// False otherwise. /// </returns> *************** *** 444,449 **** /// </summary> /// <param name="t">A System.TimeSpan</param> ! /// <returns>A NullableDateTime that is the difference of this structure ! /// and <code>t</code>.</returns> /// <remarks> /// This method does not change the value of this NullableDateTime. Instead, a new NullableDateTime --- 448,454 ---- /// </summary> /// <param name="t">A System.TimeSpan</param> ! /// <returns> ! /// A NullableDateTime that is the difference of this structure and <paramref name="t"/>. ! /// </returns> /// <remarks> /// This method does not change the value of this NullableDateTime. Instead, a new NullableDateTime *************** *** 461,467 **** /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <code>x</code> is greater than <code>y</code>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <code>x</code> is less than or equal to <code>y</code>. /// </returns> public static NullableBoolean GreaterThan(NullableDateTime x, NullableDateTime y) { --- 466,472 ---- /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <paramref name="x"/> is greater than <paramref name="y"/>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <paramref name="x"/> is less than or equal to <paramref name="y"/>. /// </returns> public static NullableBoolean GreaterThan(NullableDateTime x, NullableDateTime y) { *************** *** 474,480 **** /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <code>x</code> is greater than or equal to <code>y</code>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <code>x</code> is less than <code>y</code>. /// </returns> public static NullableBoolean GreaterThanOrEqual(NullableDateTime x, NullableDateTime y) { --- 479,485 ---- /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <paramref name="x"/> is greater than or equal to <paramref name="y"/>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <paramref name="x"/> is less than <paramref name="y"/>. /// </returns> public static NullableBoolean GreaterThanOrEqual(NullableDateTime x, NullableDateTime y) { *************** *** 487,493 **** /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <code>x</code> is less than <code>y</code>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <code>x</code> is greater than or equal to <code>y</code>. /// </returns> public static NullableBoolean LessThan(NullableDateTime x, NullableDateTime y) { --- 492,498 ---- /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <paramref name="x"/> is less than <paramref name="y"/>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <paramref name="x"/> is greater than or equal to <paramref name="y"/>. /// </returns> public static NullableBoolean LessThan(NullableDateTime x, NullableDateTime y) { *************** *** 500,506 **** /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <code>x</code> is less than or equal to <code>y</code>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <code>x</code> is greater than <code>y</code>. /// </returns> public static NullableBoolean LessThanOrEqual(NullableDateTime x, NullableDateTime y) { --- 505,511 ---- /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <paramref name="x"/> is less than or equal to <paramref name="y"/>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <paramref name="x"/> is greater than <paramref name="y"/>. /// </returns> public static NullableBoolean LessThanOrEqual(NullableDateTime x, NullableDateTime y) { *************** *** 518,527 **** /// a value representative of the instant in time.</returns> /// <exception cref="sys.ArgumentNullException"> ! /// <code>s</code> is null.</exception> /// <exception cref="sys.FormatException"> ! /// <code>s</code> is not a properly formatted date and time. /// </exception> /// <exception cref="sys.OverflowException"> ! /// <code>s</code>represents a time instant less than MinValue or /// greater than MaxValue. /// </exception> --- 523,532 ---- /// a value representative of the instant in time.</returns> /// <exception cref="sys.ArgumentNullException"> ! /// <paramref name="s"/> is null.</exception> /// <exception cref="sys.FormatException"> ! /// <paramref name="s"/> is not a properly formatted date and time. /// </exception> /// <exception cref="sys.OverflowException"> ! /// <paramref name="s"/> represents a time instant less than MinValue or /// greater than MaxValue. /// </exception> *************** *** 552,557 **** /// <param name="x">A NullableDateTime</param> /// <param name="t">A System.TimeSpan</param> ! /// <returns>A NullableDateTime that is the sum of <code>x</code> ! /// and <code>t</code>.</returns> public static NullableDateTime operator + (NullableDateTime x, sys.TimeSpan t) { if (x.IsNull) --- 557,563 ---- /// <param name="x">A NullableDateTime</param> /// <param name="t">A System.TimeSpan</param> ! /// <returns> ! /// A NullableDateTime that is the sum of <paramref name="x"/> and <paramref name="t"/>. ! /// </returns> public static NullableDateTime operator + (NullableDateTime x, sys.TimeSpan t) { if (x.IsNull) *************** *** 567,573 **** /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <code>x</code> is greater than <code>y</code>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <code>x</code> is less than or equal to <code>y</code>. /// </returns> public static NullableBoolean operator > (NullableDateTime x, NullableDateTime y) { --- 573,579 ---- /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <paramref name="x"/> is greater than <paramref name="y"/>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <paramref name="x"/> is less than or equal to <paramref name="y"/>. /// </returns> public static NullableBoolean operator > (NullableDateTime x, NullableDateTime y) { *************** *** 584,590 **** /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <code>x</code> is greater than or equal to <code>y</code>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <code>x</code> is less than <code>y</code>. /// </returns> public static NullableBoolean operator >= (NullableDateTime x, NullableDateTime y) { --- 590,596 ---- /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <paramref name="x"/> is greater than or equal to <paramref name="y"/>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <paramref name="x"/> is less than <paramref name="y"/>. /// </returns> public static NullableBoolean operator >= (NullableDateTime x, NullableDateTime y) { *************** *** 601,607 **** /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <code>x</code> is less than <code>y</code>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <code>x</code> is greater than or equal to <code>y</code>. /// </returns> public static NullableBoolean operator < (NullableDateTime x, NullableDateTime y) { --- 607,613 ---- /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <paramref name="x"/> is less than <paramref name="y"/>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <paramref name="x"/> is greater than or equal to <paramref name="y"/>. /// </returns> public static NullableBoolean operator < (NullableDateTime x, NullableDateTime y) { *************** *** 617,623 **** /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <code>x</code> is less than or equal to <code>y</code>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <code>x</code> is greater than <code>y</code>. /// </returns> public static NullableBoolean operator <= (NullableDateTime x, NullableDateTime y) { --- 623,629 ---- /// <param name="x">Instance to compare from.</param> /// <param name="y">Instance to compare to.</param> ! /// <returns>True if <paramref name="x"/> is less than or equal to <paramref name="y"/>, /// null value if one or both of the instances are NullableDatetime.Null, ! /// false if <paramref name="x"/> is greater than <paramref name="y"/>. /// </returns> public static NullableBoolean operator <= (NullableDateTime x, NullableDateTime y) { *************** *** 634,639 **** /// <param name="x">A NullableDateTime</param> /// <param name="t">A System.TimeSpan</param> ! /// <returns>A NullableDateTime that is the difference of <code>x</code> ! /// and <code>t</code>.</returns> public static NullableDateTime operator - (NullableDateTime x, sys.TimeSpan t) { if (x.IsNull) --- 640,646 ---- /// <param name="x">A NullableDateTime</param> /// <param name="t">A System.TimeSpan</param> ! /// <returns> ! /// A NullableDateTime that is the difference of <paramref name="x"/> and <paramref name="t"/>. ! /// </returns> public static NullableDateTime operator - (NullableDateTime x, sys.TimeSpan t) { if (x.IsNull) Index: NullableDecimal.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableDecimal.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** NullableDecimal.cs 8 Dec 2003 21:57:27 -0000 1.19 --- NullableDecimal.cs 20 Feb 2004 00:42:22 -0000 1.20 *************** *** 22,25 **** --- 22,26 ---- // 06-Dic-2003 Luca Bug Fix Replaced Target Namespace for Xml Schema to avoid duplicate namespace with // other types in NullableTypes + // 18-Feb-2004 Luca Bug Fix ReadXml must read nil value also with a non empty element // *************** *** 268,273 **** /// <param name="hi">The high 32 bits of a 96-bit integer.</param> /// <param name="isNegative"> ! /// The sign of the number; <code>true</code> is negative, ! /// <code>false</code> is positive. /// </param> /// <param name="scale">A power of 10 ranging from 0 to 28.</param> --- 269,273 ---- /// <param name="hi">The high 32 bits of a 96-bit integer.</param> /// <param name="isNegative"> ! /// The sign of the number; true is negative, false is positive. /// </param> /// <param name="scale">A power of 10 ranging from 0 to 28.</param> *************** *** 432,437 **** [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! if (!reader.IsEmptyElement) { ! _value = sysXml.XmlConvert.ToDecimal(reader.ReadElementString()); _notNull = true; } --- 432,440 ---- [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! string nilValue = reader["nil", "http://www.w3.org/2001/XMLSchema-instance"]; ! string elementValue = reader.IsEmptyElement ? null : reader.ReadElementString(); ! ! if (nilValue == null || nilValue == "false" || nilValue == "0") { ! _value = sysXml.XmlConvert.ToDecimal(elementValue); _notNull = true; } Index: NullableDouble.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableDouble.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** NullableDouble.cs 8 Dec 2003 21:57:27 -0000 1.17 --- NullableDouble.cs 20 Feb 2004 00:42:22 -0000 1.18 *************** *** 20,23 **** --- 20,24 ---- // 06-Dic-2003 Luca Bug Fix Replaced Target Namespace for Xml Schema to avoid duplicate namespace with // other types in NullableTypes + // 18-Feb-2004 Luca Bug Fix ReadXml must read nil value also with a non empty element // *************** *** 286,291 **** [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! if (!reader.IsEmptyElement) { ! _value = sysXml.XmlConvert.ToDouble(reader.ReadElementString()); _notNull = true; } --- 287,295 ---- [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! string nilValue = reader["nil", "http://www.w3.org/2001/XMLSchema-instance"]; ! string elementValue = reader.IsEmptyElement ? null : reader.ReadElementString(); ! ! if (nilValue == null || nilValue == "false" || nilValue == "0") { ! _value = sysXml.XmlConvert.ToDouble(elementValue); _notNull = true; } Index: NullableInt16.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableInt16.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NullableInt16.cs 30 Jan 2004 16:31:03 -0000 1.13 --- NullableInt16.cs 20 Feb 2004 00:42:22 -0000 1.14 *************** *** 23,26 **** --- 23,27 ---- // other types in NullableTypes // 30-Dec-2003 Partha Upgrade Replaced hardcoded MInValue and MaxValue values with Int16.MinValue/MaxValue + // 18-Feb-2004 Luca Bug Fix ReadXml must read nil value also with a non empty element // *************** *** 190,195 **** [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! if (!reader.IsEmptyElement) { ! _value = sysXml.XmlConvert.ToInt16(reader.ReadElementString()); _notNull = true; } --- 191,199 ---- [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! string nilValue = reader["nil", "http://www.w3.org/2001/XMLSchema-instance"]; ! string elementValue = reader.IsEmptyElement ? null : reader.ReadElementString(); ! ! if (nilValue == null || nilValue == "false" || nilValue == "0") { ! _value = sysXml.XmlConvert.ToInt16(elementValue); _notNull = true; } Index: NullableInt32.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableInt32.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** NullableInt32.cs 30 Jan 2004 16:31:03 -0000 1.20 --- NullableInt32.cs 20 Feb 2004 00:42:22 -0000 1.21 *************** *** 17,25 **** // 05-Oct-2003 DamienG Upgrade New requirement: the type must be XmlSerializable // 06-Oct-2003 Luca Upgrade Code upgrade: Replaced tabs with spaces and removed commented out code ! // 06-Dic-2003 Luca Bug Fix Replaced Xml Schema id "NullableInt32XmlSchema" with "NullableInt32" // because VSDesigner use it as type-name in the auto-generated WS client Proxy ! // 06-Dic-2003 Luca Bug Fix Replaced Target Namespace for Xml Schema to avoid duplicate namespace with // other types in NullableTypes // 30-Dec-2003 Partha Upgrade Replaced hardcoded MInValue and MaxValue values with Int16.MinValue/MaxValue // --- 17,26 ---- // 05-Oct-2003 DamienG Upgrade New requirement: the type must be XmlSerializable // 06-Oct-2003 Luca Upgrade Code upgrade: Replaced tabs with spaces and removed commented out code ! // 06-Dec-2003 Luca Bug Fix Replaced Xml Schema id "NullableInt32XmlSchema" with "NullableInt32" // because VSDesigner use it as type-name in the auto-generated WS client Proxy ! // 06-Dec-2003 Luca Bug Fix Replaced Target Namespace for Xml Schema to avoid duplicate namespace with // other types in NullableTypes // 30-Dec-2003 Partha Upgrade Replaced hardcoded MInValue and MaxValue values with Int16.MinValue/MaxValue + // 18-Feb-2004 Luca Bug Fix ReadXml must read nil value also with a non empty element // *************** *** 248,253 **** [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! if (!reader.IsEmptyElement) { ! _value = sysXml.XmlConvert.ToInt32(reader.ReadElementString()); _notNull = true; } --- 249,257 ---- [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! string nilValue = reader["nil", "http://www.w3.org/2001/XMLSchema-instance"]; ! string elementValue = reader.IsEmptyElement ? null : reader.ReadElementString(); ! ! if (nilValue == null || nilValue == "false" || nilValue == "0") { ! _value = sysXml.XmlConvert.ToInt32(elementValue); _notNull = true; } Index: NullableInt64.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableInt64.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** NullableInt64.cs 8 Dec 2003 21:57:27 -0000 1.12 --- NullableInt64.cs 20 Feb 2004 00:42:22 -0000 1.13 *************** *** 19,22 **** --- 19,23 ---- // 06-Dic-2003 Luca Bug Fix Replaced Target Namespace for Xml Schema to avoid duplicate namespace with // other types in NullableTypes + // 18-Feb-2004 Luca Bug Fix ReadXml must read nil value also with a non empty element // *************** *** 245,250 **** [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! if (!reader.IsEmptyElement) { ! _value = sysXml.XmlConvert.ToInt64(reader.ReadElementString()); _notNull = true; } --- 246,254 ---- [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! string nilValue = reader["nil", "http://www.w3.org/2001/XMLSchema-instance"]; ! string elementValue = reader.IsEmptyElement ? null : reader.ReadElementString(); ! ! if (nilValue == null || nilValue == "false" || nilValue == "0") { ! _value = sysXml.XmlConvert.ToInt64(elementValue); _notNull = true; } Index: NullableSingle.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableSingle.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** NullableSingle.cs 8 Dec 2003 21:57:27 -0000 1.19 --- NullableSingle.cs 20 Feb 2004 00:42:22 -0000 1.20 *************** *** 20,23 **** --- 20,24 ---- // 06-Dic-2003 Luca Bug Fix Replaced Target Namespace for Xml Schema to avoid duplicate namespace with // other types in NullableTypes + // 18-Feb-2004 Luca Bug Fix ReadXml must read nil value also with a non empty element // *************** *** 307,312 **** [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! if (!reader.IsEmptyElement) { ! _value = sysXml.XmlConvert.ToSingle(reader.ReadElementString()); _notNull = true; } --- 308,316 ---- [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! string nilValue = reader["nil", "http://www.w3.org/2001/XMLSchema-instance"]; ! string elementValue = reader.IsEmptyElement ? null : reader.ReadElementString(); ! ! if (nilValue == null || nilValue == "false" || nilValue == "0") { ! _value = sysXml.XmlConvert.ToSingle(elementValue); _notNull = true; } *************** *** 758,765 **** /// <remarks> /// The <paramref name="s"/> parameter can contain ! /// <see cref="System.Globalization.NumberFormatInfo.CurrentInfo.PositiveInfinitySymbol"/>, ! /// <see cref="System.Globalization.NumberFormatInfo.CurrentInfo.NegativeInfinitySymbol"/> /// and ! /// <see cref="System.Globalization.NumberFormatInfo.CurrentInfo.NaNSymbol"/>. /// </remarks> /// <seealso cref="System.Single.Parse"/> --- 762,769 ---- /// <remarks> /// The <paramref name="s"/> parameter can contain ! /// <see cref="System.Globalization.NumberFormatInfo.PositiveInfinitySymbol"/>, ! /// <see cref="System.Globalization.NumberFormatInfo.NegativeInfinitySymbol"/> /// and ! /// <see cref="System.Globalization.NumberFormatInfo.NaNSymbol"/>. /// </remarks> /// <seealso cref="System.Single.Parse"/> Index: NullableString.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableString.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** NullableString.cs 8 Dec 2003 21:57:27 -0000 1.14 --- NullableString.cs 20 Feb 2004 00:42:23 -0000 1.15 *************** *** 23,26 **** --- 23,27 ---- // 06-Dic-2003 Luca Bug Fix Replaced Target Namespace for Xml Schema to avoid duplicate namespace with // other types in NullableTypes + // 18-Feb-2004 Luca Bug Fix ReadXml must read nil value also with a non empty element // *************** *** 381,387 **** [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! if (!reader.IsEmptyElement) { ! _value = reader.ReadElementString(); ! } else _value = null; --- 382,390 ---- [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] void sysXmlSrl.IXmlSerializable.ReadXml(sysXml.XmlReader reader) { ! string nilValue = reader["nil", "http://www.w3.org/2001/XMLSchema-instance"]; ! string elementValue = reader.IsEmptyElement ? null : reader.ReadElementString(); ! ! if (nilValue == null || nilValue == "false" || nilValue == "0") ! _value = elementValue; else _value = null; Index: TypeCode.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/TypeCode.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TypeCode.cs 30 Jun 2003 12:38:57 -0000 1.2 --- TypeCode.cs 20 Feb 2004 00:42:23 -0000 1.3 *************** *** 21,27 **** ///<summary> ///Represents a boolean value that is either ! ///<see cref="NullableBoolean.True"/>, ! ///<see cref="NullableBoolean.False"/> or ! ///<see cref="NullableBoolean.Null"/>. ///</summary> NullableBoolean = 3, // Boolean --- 21,27 ---- ///<summary> ///Represents a boolean value that is either ! ///<see cref="NullableTypes.NullableBoolean.True"/>, ! ///<see cref="NullableTypes.NullableBoolean.False"/> or ! ///<see cref="NullableTypes.NullableBoolean.Null"/>. ///</summary> NullableBoolean = 3, // Boolean *************** *** 29,33 **** /// <summary> /// Represents a byte value that is either an 8-bit unsigned integer in the ! /// range of 0 through 255 or <see cref="NullableByte.Null"/>. /// </summary> NullableByte = 6, // Byte --- 29,33 ---- /// <summary> /// Represents a byte value that is either an 8-bit unsigned integer in the ! /// range of 0 through 255 or <see cref="NullableTypes.NullableByte.Null"/>. /// </summary> NullableByte = 6, // Byte *************** *** 35,39 **** /// <summary> /// Represents an Int16 that is either a 16-bit signed integer or ! /// <see cref="NullableInt16.Null"/>. /// </summary> NullableInt16 = 7, // Signed 16-bit integer --- 35,39 ---- /// <summary> /// Represents an Int16 that is either a 16-bit signed integer or ! /// <see cref="NullableTypes.NullableInt16.Null"/>. /// </summary> NullableInt16 = 7, // Signed 16-bit integer *************** *** 41,45 **** /// <summary> /// Represents an Int32 that is either a 32-bit signed integer or ! /// <see cref="NullableInt32.Null"/>. /// </summary> NullableInt32 = 9, // Signed 32-bit integer --- 41,45 ---- /// <summary> /// Represents an Int32 that is either a 32-bit signed integer or ! /// <see cref="NullableTypes.NullableInt32.Null"/>. /// </summary> NullableInt32 = 9, // Signed 32-bit integer *************** *** 47,51 **** /// <summary> /// Represents an Int64 that is either a 64-bit signed integer or ! /// <see cref="NullableInt64.Null"/>. /// </summary> NullableInt64 = 11, // Signed 64-bit integer --- 47,51 ---- /// <summary> /// Represents an Int64 that is either a 64-bit signed integer or ! /// <see cref="NullableTypes.NullableInt64.Null"/>. /// </summary> NullableInt64 = 11, // Signed 64-bit integer *************** *** 53,57 **** /// <summary> /// Represents a Single value that is either a single-precision floating point ! /// number or <see cref="NullableSingle.Null"/>. /// </summary> NullableSingle = 13, // IEEE 32-bit float --- 53,57 ---- /// <summary> /// Represents a Single value that is either a single-precision floating point ! /// number or <see cref="NullableTypes.NullableSingle.Null"/>. /// </summary> NullableSingle = 13, // IEEE 32-bit float *************** *** 59,63 **** /// <summary> /// Represents a Double value that is either a double-precision floating point ! /// number or <see cref="NullableDouble.Null"/>. /// </summary> NullableDouble = 14, // IEEE 64-bit double --- 59,63 ---- /// <summary> /// Represents a Double value that is either a double-precision floating point ! /// number or <see cref="NullableTypes.NullableDouble.Null"/>. /// </summary> NullableDouble = 14, // IEEE 64-bit double *************** *** 65,69 **** /// <summary> /// Represents a Decimal that is either a decimal number value or ! /// <see cref="NullableDecimal.Null"/>. /// </summary> NullableDecimal = 15, // Decimal --- 65,69 ---- /// <summary> /// Represents a Decimal that is either a decimal number value or ! /// <see cref="NullableTypes.NullableDecimal.Null"/>. /// </summary> NullableDecimal = 15, // Decimal *************** *** 71,75 **** /// <summary> /// Represents a DateTime that is either a date and time data or ! /// <see cref="NullableDateTime.Null"/>. /// </summary> NullableDateTime = 16, // DateTime --- 71,75 ---- /// <summary> /// Represents a DateTime that is either a date and time data or ! /// <see cref="NullableTypes.NullableDateTime.Null"/>. /// </summary> NullableDateTime = 16, // DateTime *************** *** 77,81 **** /// <summary> /// Represents a String that is either a variable-length stream of characters ! /// or <see cref="NullableString.Null"/>. /// </summary> NullableString = 18 // Unicode character string --- 77,81 ---- /// <summary> /// Represents a String that is either a variable-length stream of characters ! /// or <see cref="NullableTypes.NullableString.Null"/>. /// </summary> NullableString = 18 // Unicode character string |