Update of /cvsroot/nullabletypes/NullableTypes/src/Types
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28078/src/Types
Modified Files:
NullableString.cs
Log Message:
Add missing conversions for NullableGuid & NullableTimeSpan (#1342422)
Index: NullableString.cs
===================================================================
RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableString.cs,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** NullableString.cs 6 Oct 2005 16:05:35 -0000 1.17
--- NullableString.cs 31 Oct 2005 12:06:57 -0000 1.18
***************
*** 24,28 ****
// other types in NullableTypes
// 18-Feb-2004 Luca Bug Fix ReadXml must read nil value also with a non empty element
! // 26-Sep-2005 DamienG Upgrade Add cast support for NullableGuid.
//
--- 24,30 ----
// other types in NullableTypes
// 18-Feb-2004 Luca Bug Fix ReadXml must read nil value also with a non empty element
! // 26-Sep-2005 DamienG Upgrade Add cast support for NullableGuid
! // 06-Oct-2005 DamienG Upgrade Implement NullableTimeSpan (#1278920)
! // 31-Oct-2005 DamienG Upgrade Add missing conversions for NullableGuid & NullableTimeSpan (#1342422)
//
***************
*** 1597,1600 ****
--- 1599,1620 ----
}
+ /// <summary>
+ /// Converts this <see cref="NullableString"/> instance to a
+ /// <see cref="NullableGuid"/>.
+ /// </summary>
+ /// <returns>
+ /// A <see cref="NullableGuid"/> that is
+ /// <see cref="NullableGuid.Null"/> if this <see cref="NullableString"/> is
+ /// <see cref="NullableString.Null"/> otherwise a <see cref="NullableGuid"/>
+ /// whose <see cref="NullableGuid.Value"/> equals the number represented
+ /// by this <see cref="NullableString"/> instance.
+ /// </returns>
+ /// <exception cref="System.FormatException">
+ /// this <see cref="NullableString"/> instance is not of the correct format.
+ /// <seealso cref="System.Guid"/>
+ /// </exception>
+ public NullableGuid ToNullableGuid() {
+ return (NullableGuid)this;
+ }
/// <summary>
***************
*** 1695,1698 ****
--- 1715,1742 ----
/// <summary>
+ /// Converts this <see cref="NullableString"/> instance to a
+ /// <see cref="NullableTimeSpan"/>.
+ /// </summary>
+ /// <returns>
+ /// A <see cref="NullableTimeSpan"/> that is
+ /// <see cref="NullableTimeSpan.Null"/> if this <see cref="NullableString"/> is
+ /// <see cref="NullableString.Null"/> otherwise a <see cref="NullableTimeSpan"/>
+ /// whose <see cref="NullableTimeSpan.Value"/> equals the time span represented
+ /// by this <see cref="NullableString"/> instance.
+ /// </returns>
+ /// <exception cref="System.FormatException">
+ /// this <see cref="NullableString"/> instance is not of the correct format.
+ /// <seealso cref="System.TimeSpan.Parse"/>
+ /// </exception>
+ /// <exception cref="System.OverflowException">
+ /// this <see cref="NullableString"/> instance represents a time span less than
+ /// <see cref="System.TimeSpan.MinValue"/> or greater than
+ /// <see cref="System.TimeSpan.MaxValue"/>.
+ /// </exception>
+ public NullableTimeSpan ToNullableTimeSpan() {
+ return (NullableTimeSpan)this;
+ }
+
+ /// <summary>
/// Converts this <see cref="NullableString"/> structure to a
/// <see cref="System.String"/>.
|