Update of /cvsroot/nullabletypes/NullableTypes/src/Types
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7283/src/Types
Modified Files:
NullableGuid.cs NullableString.cs
Log Message:
Add missing conversion cast from NullableGuid to NullableString.
Index: NullableString.cs
===================================================================
RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableString.cs,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** NullableString.cs 20 Feb 2004 00:42:23 -0000 1.15
--- NullableString.cs 26 Sep 2005 13:34:17 -0000 1.16
***************
*** 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
//
--- 23,28 ----
// 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
! // 26-Sep-2005 DamienG Upgrade Add cast support for NullableGuid.
//
***************
*** 1409,1412 ****
--- 1410,1435 ----
/// <summary>
+ /// Converts the <see cref="NullableGuid"/> parameter to a
+ /// <see cref="NullableString"/> structure.
+ /// </summary>
+ /// <param name="x">
+ /// A <see cref="NullableGuid"/> to be converted to a
+ /// <see cref="NullableString"/> structure.
+ /// </param>
+ /// <returns>
+ /// <see cref="Null"/> if <paramref name="x"/> is
+ /// <see cref="NullableGuid.Null"/> otherwise a new
+ /// <see cref="NullableString"/> structure that's the string representation
+ /// of <paramref name="x"/>.
+ /// </returns>
+ public static explicit operator NullableString(NullableGuid x) {
+ if (x.IsNull)
+ return NullableString.Null;
+
+ return new NullableString(x.Value.ToString());
+ }
+
+
+ /// <summary>
/// Converts a <see cref="NullableString"/> to a <see cref="System.String"/>.
/// </summary>
Index: NullableGuid.cs
===================================================================
RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableGuid.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** NullableGuid.cs 23 Sep 2005 09:31:50 -0000 1.5
--- NullableGuid.cs 26 Sep 2005 13:34:17 -0000 1.6
***************
*** 12,15 ****
--- 12,16 ----
// from patrickvd
// 05-Sep-2005 DamienG Upgrade Added new Empty handling as per NullableString.
+ // 26-Sep-2005 DamienG Bugfix Change ToNullableString to cast via NullableString.
//
***************
*** 278,285 ****
public NullableString ToNullableString () {
! if (this.IsNull)
! return NullableString.Null;
! else
! return new NullableString(_value.ToString());
}
--- 279,283 ----
public NullableString ToNullableString () {
! return (NullableString) this;
}
|