nullabletypes-cvs Mailing List for NullableTypes (Page 3)
Status: Inactive
Brought to you by:
lukadotnet
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
(3) |
Mar
|
Apr
|
May
(4) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
(4) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
(32) |
Nov
(2) |
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(3) |
Jul
(5) |
Aug
(1) |
Sep
(10) |
Oct
(7) |
Nov
(23) |
Dec
(29) |
2009 |
Jan
(15) |
Feb
(15) |
Mar
(13) |
Apr
(17) |
May
(32) |
Jun
(25) |
Jul
(29) |
Aug
(8) |
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
2010 |
Jan
(10) |
Feb
(7) |
Mar
(3) |
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
From: \(luKa\) <luk...@us...> - 2005-10-30 15:25:24
|
Update of /cvsroot/nullabletypes/NullableTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14466 Modified Files: ReadMe.txt ReleaseNotes.txt Log Message: Index: ReleaseNotes.txt =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/ReleaseNotes.txt,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ReleaseNotes.txt 30 Oct 2005 14:24:40 -0000 1.17 --- ReleaseNotes.txt 30 Oct 2005 15:25:09 -0000 1.18 *************** *** 12,20 **** NullConvert, unit tests and xml documentation ! - Security - Reduced attack surface of NullableTypes assembly - Reduced permissions required for NullableTypes callers. ! - Bug fix that break backward compatibility - Fixed NullableDateTime Add method: it have to return a new DateTime instead of changing the current DateTime value. --- 12,21 ---- NullConvert, unit tests and xml documentation ! - Security (changes that use new features of .NET Framework 1.1 not supported by 1.0) - Reduced attack surface of NullableTypes assembly + AspNetHostingPermission is non supported in .NET Framework 1.0 - Reduced permissions required for NullableTypes callers. ! - Bug fix (that break NullableTypes backward compatibility with ver 1.0 and 1.2) - Fixed NullableDateTime Add method: it have to return a new DateTime instead of changing the current DateTime value. Index: ReadMe.txt =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/ReadMe.txt,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ReadMe.txt 30 Oct 2005 14:26:46 -0000 1.20 --- ReadMe.txt 30 Oct 2005 15:25:09 -0000 1.21 *************** *** 91,95 **** 'NullableTypes.Tests.dll-v1.0' to 'NullableTypes.Tests.dll' in the 'bin' folder and do run tests again. ! NullableTypes 1.4 break Backward compatibility VS.NET compatibility --- 91,98 ---- 'NullableTypes.Tests.dll-v1.0' to 'NullableTypes.Tests.dll' in the 'bin' folder and do run tests again. ! NullableTypes 1.4 break Backward compatibility with NullableTypes 1.2 and 1.0. ! NullableTypes 1.4 cannot run with .NET Framework 1.1 because it make us of AspNetHostingPermission is not ! supported in .NET Framework 1.0. ! VS.NET compatibility |
From: \(luKa\) <luk...@us...> - 2005-10-30 14:27:07
|
Update of /cvsroot/nullabletypes/NullableTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3311 Modified Files: ReadMe.txt Log Message: Index: ReadMe.txt =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/ReadMe.txt,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ReadMe.txt 30 Oct 2005 13:30:42 -0000 1.19 --- ReadMe.txt 30 Oct 2005 14:26:46 -0000 1.20 *************** *** 1,4 **** ========================================================== ! NullableTypes ver. 1.3 ========================================================== --- 1,4 ---- ========================================================== ! NullableTypes ver. 1.4 ========================================================== *************** *** 91,95 **** 'NullableTypes.Tests.dll-v1.0' to 'NullableTypes.Tests.dll' in the 'bin' folder and do run tests again. ! NullableTypes 1.3 break Backward compatibility VS.NET compatibility --- 91,95 ---- 'NullableTypes.Tests.dll-v1.0' to 'NullableTypes.Tests.dll' in the 'bin' folder and do run tests again. ! NullableTypes 1.4 break Backward compatibility VS.NET compatibility |
From: \(luKa\) <luk...@us...> - 2005-10-30 14:25:08
|
Update of /cvsroot/nullabletypes/NullableTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2952 Modified Files: ReleaseNotes.txt Log Message: Index: ReleaseNotes.txt =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/ReleaseNotes.txt,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ReleaseNotes.txt 30 Oct 2005 13:30:42 -0000 1.16 --- ReleaseNotes.txt 30 Oct 2005 14:24:40 -0000 1.17 *************** *** 1,3 **** ! NullableTypes ver. 1.3 ---------------------------------------------------------- In this beta more improvements after the official release v1.2. --- 1,3 ---- ! NullableTypes ver. 1.3.1 ---------------------------------------------------------- In this beta more improvements after the official release v1.2. |
From: \(luKa\) <luk...@us...> - 2005-10-30 14:21:12
|
Update of /cvsroot/nullabletypes/NullableTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2158 Modified Files: license.txt Log Message: Index: license.txt =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/license.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** license.txt 25 May 2004 22:05:06 -0000 1.4 --- license.txt 30 Oct 2005 14:21:00 -0000 1.5 *************** *** 1,5 **** MIT License for NullableTypes ! Copyright (c) 2003-2004 Luca Minudel Permission is hereby granted, free of charge, to any --- 1,5 ---- MIT License for NullableTypes ! Copyright (c) 2003-2005 Luca Minudel Permission is hereby granted, free of charge, to any |
From: \(luKa\) <luk...@us...> - 2005-10-30 14:16:44
|
Update of /cvsroot/nullabletypes/NullableTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1173 Modified Files: NullableTypes.ndoc Log Message: Index: NullableTypes.ndoc =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/NullableTypes.ndoc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NullableTypes.ndoc 1 Jun 2004 18:40:31 -0000 1.13 --- NullableTypes.ndoc 30 Oct 2005 14:16:33 -0000 1.14 *************** *** 1,5 **** <project> <assemblies> ! <assembly location="I:\_nullabletypes\NullableTypes\src\Types\bin\Release\NullableTypes.dll" documentation="I:\_nullabletypes\NullableTypes\src\Types\bin\Release\NullableTypes.xml" /> </assemblies> <namespaces> --- 1,5 ---- <project> <assemblies> ! <assembly location="E:\_nullabletypes\NullableTypes\src\Types\bin\Release\NullableTypes.dll" documentation="E:\_nullabletypes\NullableTypes\src\Types\bin\Release\NullableTypes.xml" /> </assemblies> <namespaces> |
From: \(luKa\) <luk...@us...> - 2005-10-30 13:45:50
|
Update of /cvsroot/nullabletypes/NullableTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26249 Modified Files: codeInspection.FxCop Log Message: Index: codeInspection.FxCop =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/codeInspection.FxCop,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** codeInspection.FxCop 19 Aug 2003 20:58:17 -0000 1.2 --- codeInspection.FxCop 30 Oct 2005 13:45:41 -0000 1.3 *************** *** 6,10 **** </ProjectOptions> <TargetAssemblies> ! <TargetAssembly Visible="True">i:\_nullabletypes\nullabletypes\src\types\bin\release\nullabletypes.dll</TargetAssembly> </TargetAssemblies> <Rules> --- 6,10 ---- </ProjectOptions> <TargetAssemblies> ! <TargetAssembly Visible="True">e:\_nullabletypes\nullabletypes\src\types\bin\release\nullabletypes.dll</TargetAssembly> </TargetAssemblies> <Rules> |
From: \(luKa\) <luk...@us...> - 2005-10-30 13:30:55
|
Update of /cvsroot/nullabletypes/NullableTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24207 Modified Files: ReadMe.txt ReleaseNotes.txt Log Message: Index: ReleaseNotes.txt =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/ReleaseNotes.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ReleaseNotes.txt 12 Feb 2005 03:44:33 -0000 1.15 --- ReleaseNotes.txt 30 Oct 2005 13:30:42 -0000 1.16 *************** *** 1,29 **** NullableTypes ver. 1.3 ---------------------------------------------------------- ! This is the first beta after the official release v1.2. It adds ! minor improvements. It include binary, samples in C# and VB.NET, help and source code. Changes from ver. 1.2 - - Security: Reduced attack surface of NullableTypes assembly - - Security: Reduced permissions required for NullableTypes callers. - - Improved tests NullableSingleTest.ParseFormatException() and - NullableDoubleTest.ParseFormatException() to make them pass also - with the current culture 'German (Switzerland)' 'de-CH' 'LCID=2055' - - NullableStringTest2.XmlSerializable test was broken - not nu.Test and - not calling correct function. - - Added new type NullableGuid and added NullableGuid tests, - added NullableGuid conversions in DBNullConvert and NullConvert ! NullableTypes ver. 1.2 ! ---------------------------------------------------------- ! This official release follow the first official v1.0, it enable ! NullableTypes to work smoothly with Web Services as built-in types. ! It include binary, samples in C# and VB.NET, help and source code. ! Types available are: - NullableBoolean - NullableByte --- 1,36 ---- NullableTypes ver. 1.3 ---------------------------------------------------------- ! In this beta more improvements after the official release v1.2. It include binary, samples in C# and VB.NET, help and source code. Changes from ver. 1.2 + - New nullable types + - Added NullableGuid with relative conversions in DBNullConvert and + NullConvert, unit tests and xml documentation + - Added NullableTimeSpan with relative conversions in DBNullConvert and + NullConvert, unit tests and xml documentation + - Security + - Reduced attack surface of NullableTypes assembly + - Reduced permissions required for NullableTypes callers. + - Bug fix that break backward compatibility + - Fixed NullableDateTime Add method: it have to return a new DateTime instead + of changing the current DateTime value. ! - Changes ! - NullableInt16 GetHashcode made compliant with native Int16 ! - Improved unit tests ! - Improved ParseFormatException() test in NullableSingleTest and NullableDoubleTest ! to support also the culture 'German (Switzerland)' 'de-CH' 'LCID=2055' ! - Fixed NullableStringTest2.XmlSerializable test. ! - Added missing tests for Add and Subtract methods of NullableDateTime ! ! - Xml documentation corrections ! ! ! Now available types are: - NullableBoolean - NullableByte *************** *** 36,39 **** --- 43,48 ---- - NullableString - NullableDateTime + - NullableGuid + - NullableTimeSpan - DBNullConvert - NullConvert *************** *** 41,44 **** --- 50,61 ---- + + NullableTypes ver. 1.2 + ---------------------------------------------------------- + This official release follow the first official v1.0, it enable + NullableTypes to work smoothly with Web Services as built-in types. + It include binary, samples in C# and VB.NET, help and source code. + + Changes from ver. 1.0 - NullableTypes enabled to work with Web Services by Index: ReadMe.txt =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/ReadMe.txt,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ReadMe.txt 1 Jun 2004 18:40:31 -0000 1.18 --- ReadMe.txt 30 Oct 2005 13:30:42 -0000 1.19 *************** *** 1,4 **** ========================================================== ! NullableTypes ver. 1.2 ========================================================== --- 1,4 ---- ========================================================== ! NullableTypes ver. 1.3 ========================================================== *************** *** 24,28 **** Types implemented by NullableTypes are: NullableBoolean, NullableByte, NullableInt16, NullableInt32, ! NullableInt64, NullableSingle, NullableDouble, NullableDecimal, NullableString and NullableDateTime. Helper functions provide seamless integration with Windows and ASP.NET user controls and with ADO.NET. --- 24,29 ---- Types implemented by NullableTypes are: NullableBoolean, NullableByte, NullableInt16, NullableInt32, ! NullableInt64, NullableSingle, NullableDouble, NullableDecimal, NullableString, NullableDateTime, ! NullableTimeSpan and NullableGuid. Helper functions provide seamless integration with Windows and ASP.NET user controls and with ADO.NET. *************** *** 81,85 **** NullableTypes 1.2 source code still compile with .NET Framework v1.0. ! NullableTypes Backward compatibility NullableTypes 1.2 assembly is backward compatibile with NullableTypes 1.0 assembly. To use a NullableTypes 1.2 assembly where a NullableTypes 1.0 assembly is expected, register the --- 82,86 ---- NullableTypes 1.2 source code still compile with .NET Framework v1.0. ! NullableTypes 1.2 Backward compatibility NullableTypes 1.2 assembly is backward compatibile with NullableTypes 1.0 assembly. To use a NullableTypes 1.2 assembly where a NullableTypes 1.0 assembly is expected, register the *************** *** 90,93 **** --- 91,96 ---- 'NullableTypes.Tests.dll-v1.0' to 'NullableTypes.Tests.dll' in the 'bin' folder and do run tests again. + NullableTypes 1.3 break Backward compatibility + VS.NET compatibility NullableTypes projects and source code are created using VS.NET 2002 and have been converted to VS.NET 2003. *************** *** 97,106 **** ======================= ! What about NullableTypes and SqlTypes (or other nullable types provided by the .NET Data Provider, as the ! structures in System.Data.OracleClient or types in Oracle.DataAccess.Types)? ! What about NullableTypes and Nullable<T> (Whidbey)? ! ! Find the answer here: ! http://nullabletypes.sourceforge.net/#faq --- 100,104 ---- ======================= ! http://nullabletypes.sourceforge.net/#faq *************** *** 125,128 **** --- 123,128 ---- using NString = NullableTypes.NullableString; using NDateTime = NullableTypes.NullableDateTime; + using NTimeStamp = NullableTypes.NullableTimeStamp; + using NGuid = NullableTypes.NullableGuid; *************** *** 139,142 **** --- 139,144 ---- Imports NString = NullableTypes.NullableString Imports NDateTime = NullableTypes.NullableDateTime + Imports NTimeStamp = NullableTypes.NullableTimeStamp + Imports NGuid = NullableTypes.NullableGuid *************** *** 144,147 **** --- 146,150 ---- =============== Thanks goes to the NullableTypes project members: + - Damien Guard (NullableTimeStamp, NullableGuid, Web Services support) - Abhijeet Dev (NullableDecimal, NullableInt16) - Eric Lau (NullableDateTime) *************** *** 150,155 **** Thanks also goes to Massimo Roccaforte, Roni Burd, Partha Choudhury, Shaun Bowe and ! Alberto Tronchin for their suggestions and to Damien Guard for his help implementing Web Services ! support. At the end thanks also goes to the open-source community that developed these tools: --- 153,157 ---- Thanks also goes to Massimo Roccaforte, Roni Burd, Partha Choudhury, Shaun Bowe and ! Alberto Tronchin for their suggestions. At the end thanks also goes to the open-source community that developed these tools: *************** *** 212,217 **** --- ! Regards, ! (luKa) ! NullableTypes Project Manager --- 214,219 ---- --- ! Regards ! (luKa), Project Manager ! |
From: \(luKa\) <luk...@us...> - 2005-10-30 13:30:55
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types/internal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24207/src/Types/internal Modified Files: AssemblyInfo.cs Log Message: Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/internal/AssemblyInfo.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** AssemblyInfo.cs 12 Feb 2005 03:44:34 -0000 1.20 --- AssemblyInfo.cs 30 Oct 2005 13:30:42 -0000 1.21 *************** *** 34,38 **** [assembly: AssemblyVersion("1.3.*")] ! [assembly: AssemblyInformationalVersion("1.3.0")] // odd beta version 1.3.* - stable will be 1.4 // // In order to sign your assembly you must specify a key to use. Refer to the --- 34,38 ---- [assembly: AssemblyVersion("1.3.*")] ! [assembly: AssemblyInformationalVersion("1.3.1")] // odd beta version 1.3.* - stable will be 1.4 // // In order to sign your assembly you must specify a key to use. Refer to the *************** *** 64,68 **** [assembly: AssemblyKeyFile("")] #else ! [assembly: AssemblyKeyFile("..\\..\\snk\\NullableTypes.snk")] #endif [assembly: AssemblyKeyName("")] --- 64,68 ---- [assembly: AssemblyKeyFile("")] #else ! [assembly: AssemblyKeyFile("E:\\_nullabletypes\\snk\\NullableTypes.snk")] #endif [assembly: AssemblyKeyName("")] |
From: \(luKa\) <luk...@us...> - 2005-10-30 13:30:55
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24207/src/Tests Modified Files: AssemblyInfo.cs Log Message: Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Tests/AssemblyInfo.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** AssemblyInfo.cs 12 Feb 2005 03:44:34 -0000 1.11 --- AssemblyInfo.cs 30 Oct 2005 13:30:42 -0000 1.12 *************** *** 29,33 **** [assembly: AssemblyVersion("1.3.*")] ! [assembly: AssemblyInformationalVersion("1.3.0")] // odd beta version 1.1.* - stable will be 1.2 // --- 29,33 ---- [assembly: AssemblyVersion("1.3.*")] ! [assembly: AssemblyInformationalVersion("1.3.1")] // odd beta version 1.1.* - stable will be 1.2 // *************** *** 60,64 **** [assembly: AssemblyKeyFile("")] #else ! [assembly: AssemblyKeyFile("..\\..\\snk\\NullableTypes.snk")] #endif [assembly: AssemblyKeyName("")] --- 60,64 ---- [assembly: AssemblyKeyFile("")] #else ! [assembly: AssemblyKeyFile("E:\\_nullabletypes\\snk\\NullableTypes.snk")] #endif [assembly: AssemblyKeyName("")] |
From: \(luKa\) <luk...@us...> - 2005-10-29 20:49:54
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17045/src/Types Modified Files: Types.csproj Log Message: Index: Types.csproj =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/Types.csproj,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Types.csproj 6 Oct 2005 16:05:35 -0000 1.19 --- Types.csproj 29 Oct 2005 20:49:45 -0000 1.20 *************** *** 78,82 **** Name = "System.Data" AssemblyName = "System.Data" ! HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" /> </References> --- 78,82 ---- Name = "System.Data" AssemblyName = "System.Data" ! HintPath = "H:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" /> </References> |
From: Damien G. <dam...@us...> - 2005-10-25 23:23:35
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11677/src/Types Modified Files: NullConvert.cs Log Message: Add missing "string From(NullableTimeSpan x, string conventionalNullValue)" method to NullConvert. Index: NullConvert.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullConvert.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** NullConvert.cs 25 Oct 2005 11:50:46 -0000 1.9 --- NullConvert.cs 25 Oct 2005 23:23:27 -0000 1.10 *************** *** 15,18 **** --- 15,19 ---- // 11-Oct-2005 DamienG Upgrade Remove formated NullableGuid converter and added XML docs for NullableTimeSpan. // 25-Oct-2005 DamienG Upgrade Added formatted NullableGuid converter back in and fixed some more XML docs. + // 26-Oct-2005 DamienG Upgrade Added "string From(NullableTimeSpan x, string conventionalNullValue)" method. // *************** *** 681,687 **** /// <returns> /// <paramref name="conventionalNullValue"/> if <paramref name="x"/> is ! /// <see cref="NullableTimeSpan.Null"/> otherwise the equivalent string of the ! /// <see cref="NullableTimeSpan.Value"/> of <paramref name="x"/> formatted as specified by ! /// <paramref name="format"/>. /// </returns> public static sys.TimeSpan From(NullableTimeSpan x, sys.TimeSpan conventionalNullValue) { --- 682,687 ---- /// <returns> /// <paramref name="conventionalNullValue"/> if <paramref name="x"/> is ! /// <see cref="NullableDecimal.Null"/> otherwise the <see cref="NullableTimeSpan.Value"/> of ! /// <paramref name="x"/>. /// </returns> public static sys.TimeSpan From(NullableTimeSpan x, sys.TimeSpan conventionalNullValue) { *************** *** 691,695 **** return x.Value; } ! #endregion // From converters #region To converters --- 691,719 ---- return x.Value; } ! ! /// <summary> ! /// Converts the specified <see cref="NullableTimeSpan"/> value to an equivalent ! /// <see cref="System.String"/> value using a conventional <see cref="System.String"/> value to ! /// represent the <see cref="NullableTimeSpan.Null"/> value. ! /// </summary> ! /// <param name="x"> ! /// The <see cref="NullableTimeSpan"/> value to convert. ! /// </param> ! /// <param name="conventionalNullValue"> ! /// The <see cref="System.String"/> value that conventionally represent the ! /// <see cref="NullableTimeSpan.Null"/> value. ! /// </param> ! /// <returns> ! /// <paramref name="conventionalNullValue"/> if <paramref name="x"/> is ! /// <see cref="NullableTimeSpan.Null"/> otherwise the equivalent string of the ! /// <see cref="NullableTimeSpan.Value"/> of <paramref name="x"/>. ! /// </returns> ! public static string From(NullableTimeSpan x, string conventionalNullValue) { ! if (x.IsNull) ! return conventionalNullValue; ! ! return x.Value.ToString(); ! } ! #endregion // From converters #region To converters *************** *** 1368,1372 **** return new NullableTimeSpan(x); } ! #endregion // To converters } } --- 1392,1396 ---- return new NullableTimeSpan(x); } ! #endregion // To converters } } |
From: Damien G. <dam...@us...> - 2005-10-25 11:53:33
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27491/src/Tests Modified Files: NullConvertTest.cs Log Message: Added test for NullableTimeSpan. Added test for NullableGuid to formatted string. Index: NullConvertTest.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Tests/NullConvertTest.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** NullConvertTest.cs 11 Oct 2005 09:58:40 -0000 1.10 --- NullConvertTest.cs 25 Oct 2005 11:53:22 -0000 1.11 *************** *** 10,13 **** --- 10,16 ---- // from user regional settings // 06-Oct-2003 Luca Upgrade Code upgrade: Replaced tabs with spaces + // 28-Jan-2005 DamienG Upgrade Added tests for NullableGuid. + // 25-Oct-2005 DamienG Upgrade Added test for NullableTimeSpan. + // Added test for NullableGuid to formatted string. // *************** *** 441,444 **** --- 444,448 ---- } + [nu.Test, nu.ExpectedException(typeof(sys.OverflowException))] public void ToNullableDateTimeFromStringOverflowException() { *************** *** 446,449 **** --- 450,454 ---- } + [nu.Test] public void ToNullableGuid() { *************** *** 451,456 **** nua.AssertEquals("TestA#210", NullableGuid.Null, NullConvert.ToNullableGuid(conventionalNullGuid, conventionalNullGuid)); ! sys.Guid conventionalGuid = sys.Guid.NewGuid(); ! nua.AssertEquals("TestA#211", new NullableGuid(conventionalGuid).Value, NullConvert.ToNullableGuid(conventionalGuid, conventionalNullGuid)); } --- 456,471 ---- nua.AssertEquals("TestA#210", NullableGuid.Null, NullConvert.ToNullableGuid(conventionalNullGuid, conventionalNullGuid)); ! sys.Guid normalGuid = sys.Guid.NewGuid(); ! nua.AssertEquals("TestA#211", new NullableGuid(normalGuid), NullConvert.ToNullableGuid(normalGuid, conventionalNullGuid)); ! } ! ! ! [nu.Test] ! public void ToNullableTimeSpan() { ! sys.TimeSpan conventionalNullTimeSpan = new sys.TimeSpan(0,1,0,9,0); ! nua.AssertEquals("TestA#220", NullableTimeSpan.Null, NullConvert.ToNullableTimeSpan(conventionalNullTimeSpan, conventionalNullTimeSpan)); ! ! sys.TimeSpan normalTimeSpan = new sys.TimeSpan(9,1,5,3,6); ! nua.AssertEquals("TestA#221", new NullableTimeSpan(normalTimeSpan), NullConvert.ToNullableTimeSpan(normalTimeSpan, conventionalNullTimeSpan)); } *************** *** 602,605 **** --- 617,635 ---- } + [nu.Test] + public void FromNullableTimeSpan() { + sys.TimeSpan zero = new sys.TimeSpan(0); + + nua.AssertEquals("TestB#099", sys.TimeSpan.MinValue, NullConvert.From(NullableTimeSpan.Null, sys.TimeSpan.MinValue)); + nua.AssertEquals("TestB#100", zero, NullConvert.From(NullableTimeSpan.Null, zero)); + nua.AssertEquals("TestB#101", sys.TimeSpan.MaxValue, NullConvert.From(NullableTimeSpan.Null, sys.TimeSpan.MaxValue)); + + sys.TimeSpan one = new sys.TimeSpan(1111, 11, 11, 11, 11); + nua.AssertEquals("TestB#102", sys.TimeSpan.MinValue, NullConvert.From(NullableTimeSpan.MinValue, one)); + nua.AssertEquals("TestB#103", zero, NullConvert.From(zero, one)); + nua.AssertEquals("TestB#104", sys.TimeSpan.MaxValue, NullConvert.From(NullableTimeSpan.MaxValue, one)); + + } + #endregion // NullableTypes to non nullable built-in types *************** *** 905,908 **** --- 935,969 ---- NullConvert.From(_zero, "null", " "); } + + + [nu.Test] + public void FromNullableGuidToString() { + nua.AssertEquals("TestC#181", null, NullConvert.From(NullableGuid.Null, null, null)); + nua.AssertEquals("TestC#182", string.Empty, NullConvert.From(NullableGuid.Null, string.Empty, null)); + nua.AssertEquals("TestC#183", "unknown", NullConvert.From(NullableGuid.Null, "unknown", null)); + + sys.Guid testGuid = sys.Guid.NewGuid(); + NullableGuid testNullableGuid = new NullableGuid(testGuid); + + sysGlb.CultureInfo currCult = sys.Threading.Thread.CurrentThread.CurrentCulture; + try { + sysThr.Thread.CurrentThread.CurrentCulture = sysGlb.CultureInfo.InvariantCulture; + + nua.AssertEquals("TestC#184", testGuid.ToString("N"), NullConvert.From(testNullableGuid, string.Empty, "N")); + nua.AssertEquals("TestC#185", testGuid.ToString("D"), NullConvert.From(testNullableGuid, string.Empty, "D")); + nua.AssertEquals("TestC#186", testGuid.ToString("B"), NullConvert.From(testNullableGuid, string.Empty, "B")); + nua.AssertEquals("TestC#187", testGuid.ToString("P"), NullConvert.From(testNullableGuid, string.Empty, "P")); + } + finally { + sysThr.Thread.CurrentThread.CurrentCulture = currCult; + } + } + + + [nu.Test, nu.ExpectedException(typeof(System.FormatException))] + public void FromNullableGuidToStringFormatException() { + NullConvert.From(new NullableGuid(sys.Guid.NewGuid()), "null", " "); + } + #endregion // NullableTypes to string representation - C# } |
From: Damien G. <dam...@us...> - 2005-10-25 11:52:29
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27251/src/Tests Modified Files: DBNullConvertTest.cs Log Message: Added tests for NullableTimeSpan exceptions when passed String or Int64. Index: DBNullConvertTest.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Tests/DBNullConvertTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DBNullConvertTest.cs 6 Oct 2005 16:05:35 -0000 1.4 --- DBNullConvertTest.cs 25 Oct 2005 11:52:20 -0000 1.5 *************** *** 9,14 **** // NullableTypes.HelperFunctions as for DBNullConvert class // 06-Oct-2003 Luca Upgrade Code upgrade: Replaced tabs with spaces ! // 05-Sep-2005 DamienG Upgrade Added tests for NullableGuid conversion ! // 26-Sep-2005 DamienG Upgrade Added tests for NullableTimeSpan conversion // --- 9,15 ---- // NullableTypes.HelperFunctions as for DBNullConvert class // 06-Oct-2003 Luca Upgrade Code upgrade: Replaced tabs with spaces ! // 05-Sep-2005 DamienG Upgrade Added tests for NullableGuid conversion. ! // 26-Sep-2005 DamienG Upgrade Added tests for NullableTimeSpan conversion. ! // 25-Oct-2005 DamienG Upgrade Added tests for NullableTimeSpan exceptions when passed String or Int64. // *************** *** 539,549 **** - [nu.Test, nu.ExpectedException(typeof(sys.FormatException))] - public void ToNullableTimeSpanInvalidCastException() - { - DBNullConvert.ToNullableTimeSpan("invalid"); - } - - [nu.Test, nu.ExpectedException(typeof(sys.ArgumentNullException))] public void ToNullableTimeSpanArgumentNullException() --- 540,543 ---- *************** *** 552,555 **** --- 546,568 ---- } + + [nu.Test, nu.ExpectedException(typeof(sys.InvalidCastException))] + public void ToNullableTimeSpanCastException() { + _dbTable.Columns.Add("System.String", typeof(string)); + _dbTable.Rows.Add(new object[] {false}); + + DBNullConvert.ToNullableTimeSpan(_dbTable.Rows[0][0]); + } + + + [nu.Test, nu.ExpectedException(typeof(sys.InvalidCastException))] + public void ToNullableTimeSpanCastException2() { + _dbTable.Columns.Add("System.Int64", typeof(long)); + _dbTable.Rows.Add(new object[] {false}); + + DBNullConvert.ToNullableTimeSpan(_dbTable.Rows[0][0]); + } + + #endregion // DbValue to NullableTypes Tests - A# |
From: Damien G. <dam...@us...> - 2005-10-25 11:51:47
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27034/src/Tests Modified Files: NullableGuidTest.cs Log Message: New test to exercise Equals and NotEquals static methods. Index: NullableGuidTest.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Tests/NullableGuidTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableGuidTest.cs 25 Oct 2005 10:17:23 -0000 1.3 --- NullableGuidTest.cs 25 Oct 2005 11:51:30 -0000 1.4 *************** *** 28,31 **** --- 28,32 ---- private NullableGuid Test2; private NullableGuid Test3; + private NullableGuid Test4; [nu.SetUp] *************** *** 35,38 **** --- 36,40 ---- Test2 = new NullableGuid("1C432B6D-9AF7-4665-A553-12CB71E46EE5"); Test3 = new NullableGuid("E64EDB0F-E4E1-4B35-99CD-4BEDFB2E7AF0"); + Test4 = new NullableGuid(Test1.Value); } *************** *** 86,91 **** [nu.Test] public void StaticEqualsAndEqualityOperator() ! { ! NullableGuid _null = NullableGuid.Null; // Case 1: either is NullableGuid.Null --- 88,93 ---- [nu.Test] public void StaticEqualsAndEqualityOperator() ! { ! NullableGuid _null = NullableGuid.Null; // Case 1: either is NullableGuid.Null *************** *** 100,107 **** // Case 3: both are equal ! NullableGuid x = Test1; ! nua.AssertEquals("D#07", NullableBoolean.True, x == Test1); ! nua.AssertEquals("D#08", NullableBoolean.True, NullableGuid.Equals(Test1, x)); ! nua.AssertEquals("D#09", NullableBoolean.False, NullableGuid.NotEquals(Test1, x)); // Case 4: inequality --- 102,108 ---- // Case 3: both are equal ! nua.AssertEquals("D#07", NullableBoolean.True, Test4 == Test1); ! nua.AssertEquals("D#08", NullableBoolean.True, NullableGuid.Equals(Test1, Test4)); ! nua.AssertEquals("D#09", NullableBoolean.False, NullableGuid.NotEquals(Test1, Test4)); // Case 4: inequality |
From: Damien G. <dam...@us...> - 2005-10-25 11:50:55
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26930/src/Types Modified Files: NullConvert.cs Log Message: Added formatted NullableGuid converter back in and fixed some more XML docs. Index: NullConvert.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullConvert.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NullConvert.cs 11 Oct 2005 12:18:52 -0000 1.8 --- NullConvert.cs 25 Oct 2005 11:50:46 -0000 1.9 *************** *** 14,17 **** --- 14,18 ---- // 26-Sep-2005 DamienG Upgrade Added helpers for NullableTimeSpan. // 11-Oct-2005 DamienG Upgrade Remove formated NullableGuid converter and added XML docs for NullableTimeSpan. + // 25-Oct-2005 DamienG Upgrade Added formatted NullableGuid converter back in and fixed some more XML docs. // *************** *** 121,125 **** /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableByte.Null"/> and the <paramref name="format"/> ! /// is invalid for a Byte. /// </exception> /// <remarks> --- 122,126 ---- /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableByte.Null"/> and the <paramref name="format"/> ! /// is invalid for a <see cref="System.Byte" />. /// </exception> /// <remarks> *************** *** 161,164 **** --- 162,197 ---- } + + /// <summary> + /// Converts the specified <see cref="NullableGuid"/> value to an equivalent + /// <see cref="System.Guid"/> value using a conventional <see cref="System.Guid"/> value to + /// represent the <see cref="NullableGuid.Null"/> value. + /// </summary> + /// <param name="x"> + /// The <see cref="NullableGuid"/> value to convert. + /// </param> + /// <param name="conventionalNullValue"> + /// The <see cref="System.Guid"/> value that conventionally represent the null value. + /// </param> + /// <param name="format"> + /// A string that specifies the return format of <paramref name="x"/> if it is not + /// <see cref="NullableGuid.Null"/>. + /// </param> + /// <returns> + /// <paramref name="conventionalNullValue"/> if <paramref name="x"/> is + /// <see cref="NullableGuid.Null"/> otherwise the <see cref="NullableGuid.Value"/> of + /// <paramref name="x"/>. + /// </returns> + /// <exception cref="System.FormatException"> + /// <paramref name="x"/> is not <see cref="NullableByte.Null"/> and the <paramref name="format"/> + /// is invalid for a <see cref="System.Guid" />. + /// </exception> + public static string From(NullableGuid x, string conventionalNullValue, string format) { + if (x.IsNull) + return conventionalNullValue; + + return x.Value.ToString(format, sysGlb.CultureInfo.CurrentCulture); + } + /// <summary> /// Converts the specified <see cref="NullableInt16"/> value to an equivalent *************** *** 208,212 **** /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableInt16.Null"/> and the <paramref name="format"/> ! /// is invalid for an Int16. /// </exception> /// <remarks> --- 241,245 ---- /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableInt16.Null"/> and the <paramref name="format"/> ! /// is invalid for an <see cref="System.Int16" />. /// </exception> /// <remarks> *************** *** 272,276 **** /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableInt32.Null"/> and the <paramref name="format"/> ! /// is invalid for an Int32. /// </exception> /// <remarks> --- 305,309 ---- /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableInt32.Null"/> and the <paramref name="format"/> ! /// is invalid for an <see cref="System.Int32"/>. /// </exception> /// <remarks> *************** *** 336,340 **** /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableInt64.Null"/> and the <paramref name="format"/> ! /// is invalid for an Int64. /// </exception> /// <remarks> --- 369,373 ---- /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableInt64.Null"/> and the <paramref name="format"/> ! /// is invalid for an <see cref="System.Int64" />. /// </exception> /// <remarks> *************** *** 400,404 **** /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableSingle.Null"/> and the <paramref name="format"/> ! /// is invalid for a Single. /// </exception> /// <remarks> --- 433,437 ---- /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableSingle.Null"/> and the <paramref name="format"/> ! /// is invalid for a <see cref="System.Single" />. /// </exception> /// <remarks> *************** *** 464,468 **** /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableDouble.Null"/> and the <paramref name="format"/> ! /// is invalid for a Double. /// </exception> /// <remarks> --- 497,501 ---- /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableDouble.Null"/> and the <paramref name="format"/> ! /// is invalid for a <see cref="System.Double" />. /// </exception> /// <remarks> *************** *** 528,532 **** /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableDecimal.Null"/> and the <paramref name="format"/> ! /// is invalid for a Decimal. /// </exception> /// <remarks> --- 561,565 ---- /// <exception cref="System.FormatException"> /// <paramref name="x"/> is not <see cref="NullableDecimal.Null"/> and the <paramref name="format"/> ! /// is invalid for a <see cref="System.Decimal" />. /// </exception> /// <remarks> *************** *** 592,596 **** /// <exception cref="System.FormatException"> /// The length of <paramref name="format"/> is 1, and it is not one of the format specifier characters ! /// defined for DateTimeFormatInfo. /// <para> -or- </para> /// <paramref name="format"/> does not contain a valid custom format pattern. --- 625,629 ---- /// <exception cref="System.FormatException"> /// The length of <paramref name="format"/> is 1, and it is not one of the format specifier characters ! /// defined for <see cref="System.Globalization.DateTimeFormatInfo"/>. /// <para> -or- </para> /// <paramref name="format"/> does not contain a valid custom format pattern. |
From: Damien G. <dam...@us...> - 2005-10-25 11:50:16
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26825/src/Types Modified Files: DbNullConvert.cs Log Message: Remove long and string parse support for NullableTimeSpan. Index: DbNullConvert.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/DbNullConvert.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DbNullConvert.cs 11 Oct 2005 12:19:41 -0000 1.7 --- DbNullConvert.cs 25 Oct 2005 11:50:07 -0000 1.8 *************** *** 17,20 **** --- 17,21 ---- // 05-Sep-2005 DamienG Upgrade Added NullableTimeSpan. // 11-Oct-2005 DamienG Bugfix Correct exception raised XML documentation for NullableTimeSpan. + // 25-Oct-2005 DamienG Upgrade Remove long and string parse support for NullableTimeSpan. // *************** *** 458,462 **** /// </exception> /// <exception cref="System.InvalidCastException"> ! /// <paramref name="x"/> is not DBNull, <see cref="System.TimeSpan"/> or <see cref="System.Int64" />. /// </exception> public static NullableTimeSpan ToNullableTimeSpan(object x) { --- 459,463 ---- /// </exception> /// <exception cref="System.InvalidCastException"> ! /// <paramref name="x"/> is not DBNull or <see cref="System.TimeSpan"/>. /// </exception> public static NullableTimeSpan ToNullableTimeSpan(object x) { *************** *** 464,476 **** return NullableTimeSpan.Null; - if (x is long) - return new NullableTimeSpan((long)x); - if (x is sys.TimeSpan) return new NullableTimeSpan((sys.TimeSpan) x); - if (x is string) - return NullableTimeSpan.Parse((string) x); - if (x == null) throw new sys.ArgumentNullException("x"); --- 465,471 ---- *************** *** 478,482 **** throw new sys.InvalidCastException( string.Format(sysGlb.CultureInfo.CurrentCulture, Locale.GetText( ! "Value is not a {0} neither a DBNull Value."), "System.TimeSpan, System.String, System.Int64")); } #endregion // To converters --- 473,477 ---- throw new sys.InvalidCastException( string.Format(sysGlb.CultureInfo.CurrentCulture, Locale.GetText( ! "Value is not a {0} neither a DBNull Value."), "System.TimeSpan")); } #endregion // To converters |
From: Damien G. <dam...@us...> - 2005-10-25 10:17:44
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7502/src/Tests Modified Files: NullableGuidTest.cs Log Message: New test to exercise NullableGuid.Equals and NullableGuid.NotEquals static methods. Index: NullableGuidTest.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Tests/NullableGuidTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableGuidTest.cs 23 Sep 2005 09:31:50 -0000 1.2 --- NullableGuidTest.cs 25 Oct 2005 10:17:23 -0000 1.3 *************** *** 6,10 **** // Date Author Changes Reasons // 28-Jan-2005 DamienG Create ! // 05-Sep-2005 DamienG Update Test to expose #265822 - NullableGuid Equals method throws NullableNullValueException // --- 6,11 ---- // Date Author Changes Reasons // 28-Jan-2005 DamienG Create ! // 05-Sep-2005 DamienG Upgrade Test to expose #265822 - NullableGuid Equals method throws NullableNullValueException ! // 25-Oct-2005 DamienG Ugrade New test to exercise Equals and NotEquals static methods. // *************** *** 84,87 **** --- 85,115 ---- [nu.Test] + public void StaticEqualsAndEqualityOperator() + { + NullableGuid _null = NullableGuid.Null; + + // Case 1: either is NullableGuid.Null + nua.AssertEquals("D#01", NullableBoolean.Null, _null == Test1); + nua.AssertEquals("D#02", NullableBoolean.Null, NullableGuid.Equals(Test2, _null)); + nua.AssertEquals("D#03", NullableBoolean.Null, NullableGuid.NotEquals(Test3, _null)); + + // Case 2: both are NullableGuid.Null + nua.AssertEquals("D#04", NullableBoolean.Null, _null == NullableGuid.Null); + nua.AssertEquals("D#05", NullableBoolean.Null, NullableGuid.Equals(NullableGuid.Null, _null)); + nua.AssertEquals("D#06", NullableBoolean.Null, NullableGuid.NotEquals(NullableGuid.Null, _null)); + + // Case 3: both are equal + NullableGuid x = Test1; + nua.AssertEquals("D#07", NullableBoolean.True, x == Test1); + nua.AssertEquals("D#08", NullableBoolean.True, NullableGuid.Equals(Test1, x)); + nua.AssertEquals("D#09", NullableBoolean.False, NullableGuid.NotEquals(Test1, x)); + + // Case 4: inequality + nua.AssertEquals("D#10", NullableBoolean.False, Test2 == Test3); + nua.AssertEquals("D#11", NullableBoolean.False, NullableGuid.Equals(Test1, Test2)); + nua.AssertEquals("D#12", NullableBoolean.True, NullableGuid.NotEquals(Test3, Test1)); + } + + [nu.Test] public void EqualsMethods() { *************** *** 91,100 **** nua.Assert("#E02", !Test3.Equals(Test1)); nua.Assert("#E03", Test2.Equals(t2)); ! nua.Assert("#E06", !Test2.Equals(tn)); ! nua.Assert("#E07", !tn.Equals(Test2)); ! ! // Static Equals()-method ! nua.Assert("#E04", NullableGuid.Equals(Test2, t2).Value); ! nua.Assert("#E05", !NullableGuid.Equals (Test1, Test3).Value); } --- 119,124 ---- nua.Assert("#E02", !Test3.Equals(Test1)); nua.Assert("#E03", Test2.Equals(t2)); ! nua.Assert("#E04", !Test2.Equals(tn)); ! nua.Assert("#E05", !tn.Equals(Test2)); } |
From: Damien G. <dam...@us...> - 2005-10-24 21:37:23
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18648/src/Types Modified Files: NullableTimeSpan.cs Log Message: Fix XML comment naming with variables for NullableTimeSpan.NotEquals. Index: NullableTimeSpan.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableTimeSpan.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableTimeSpan.cs 24 Oct 2005 21:28:57 -0000 1.3 --- NullableTimeSpan.cs 24 Oct 2005 21:37:12 -0000 1.4 *************** *** 238,247 **** /// <see cref="NullableBoolean"/> will be <see cref="NullableBoolean.Null"/>. /// </returns> ! public static NullableBoolean NotEquals(NullableTimeSpan g1, NullableTimeSpan g2) { ! if (g1.IsNull || g2.IsNull) return NullableBoolean.Null; ! return new NullableBoolean(g1._value != g2._value); } --- 238,247 ---- /// <see cref="NullableBoolean"/> will be <see cref="NullableBoolean.Null"/>. /// </returns> ! public static NullableBoolean NotEquals(NullableTimeSpan t1, NullableTimeSpan t2) { ! if (t1.IsNull || t2.IsNull) return NullableBoolean.Null; ! return new NullableBoolean(t1._value != t2._value); } |
From: Damien G. <dam...@us...> - 2005-10-24 21:29:09
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16569/src/Types Modified Files: NullableGuid.cs NullableTimeSpan.cs Log Message: Add missing NotEquals methods. Index: NullableGuid.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableGuid.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NullableGuid.cs 11 Oct 2005 09:55:44 -0000 1.7 --- NullableGuid.cs 24 Oct 2005 21:28:57 -0000 1.8 *************** *** 199,202 **** --- 199,223 ---- } + /// <summary> + /// Compares two <see cref="NullableGuid"/> instances to determine if + /// they are not equivalent. + /// </summary> + /// <param name="g1">A <see cref="NullableGuid"/> structure.</param> + /// <param name="g2">A <see cref="NullableGuid"/> structure.</param> + /// <returns> + /// A <see cref="NullableBoolean"/> that is + /// <see cref="NullableBoolean.False"/> if the two instances are equivalent + /// or <see cref="NullableBoolean.True"/> if the two instances are not + /// equivalent. If either instance of <see cref="NullableGuid"/> is + /// <see cref="Null"/>, the <see cref="NullableBoolean.Value"/> of the + /// <see cref="NullableBoolean"/> will be <see cref="NullableBoolean.Null"/>. + /// </returns> + public static NullableBoolean NotEquals(NullableGuid g1, NullableGuid g2) { + if (g1.IsNull || g2.IsNull) + return NullableBoolean.Null; + + return new NullableBoolean(g1._value != g2._value); + } + #endregion // Equivalence Index: NullableTimeSpan.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableTimeSpan.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableTimeSpan.cs 11 Oct 2005 09:25:33 -0000 1.2 --- NullableTimeSpan.cs 24 Oct 2005 21:28:57 -0000 1.3 *************** *** 220,227 **** /// <see cref="NullableBoolean.True"/> if the values of <paramref name="t1"/> and <paramref name="t2"/> are equal, /// <see cref="NullableBoolean.False"/> if the values of <paramref name="t1"/> and <paramref name="t2"/> are not equal. ! public static NullableBoolean Equals(NullableTimeSpan t1, NullableTimeSpan t2) { return (t1 == t2); } #endregion // Equivalence --- 220,249 ---- /// <see cref="NullableBoolean.True"/> if the values of <paramref name="t1"/> and <paramref name="t2"/> are equal, /// <see cref="NullableBoolean.False"/> if the values of <paramref name="t1"/> and <paramref name="t2"/> are not equal. ! public static NullableBoolean Equals(NullableTimeSpan t1, NullableTimeSpan t2) { return (t1 == t2); } + /// <summary> + /// Compares two <see cref="NullableTimeSpan"/> structures to determine if + /// they are not equivalent. + /// </summary> + /// <param name="t1">A <see cref="NullableTimeSpan"/> structure.</param> + /// <param name="t2">A <see cref="NullableTimeSpan"/> structure.</param> + /// <returns> + /// A <see cref="NullableBoolean"/> that is + /// <see cref="NullableBoolean.False"/> if the two instances are equivalent + /// or <see cref="NullableBoolean.True"/> if the two instances are not + /// equivalent. If either instance of <see cref="NullableTimeSpan"/> is + /// <see cref="Null"/>, the <see cref="NullableBoolean.Value"/> of the + /// <see cref="NullableBoolean"/> will be <see cref="NullableBoolean.Null"/>. + /// </returns> + public static NullableBoolean NotEquals(NullableTimeSpan g1, NullableTimeSpan g2) + { + if (g1.IsNull || g2.IsNull) + return NullableBoolean.Null; + + return new NullableBoolean(g1._value != g2._value); + } + #endregion // Equivalence |
From: Damien G. <dam...@us...> - 2005-10-17 09:49:27
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25268/src/Types Modified Files: NullableInt16.cs Log Message: Bring hashing for NullableInt16.GetHashCode in line with Int16's. Index: NullableInt16.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableInt16.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** NullableInt16.cs 20 Feb 2004 00:42:22 -0000 1.14 --- NullableInt16.cs 17 Oct 2005 09:49:19 -0000 1.15 *************** *** 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 // --- 23,28 ---- // 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 ! // 11-Oct-2005 DamienG Bug Fix Make GetHashCode compliant with native Int16 type. // *************** *** 255,259 **** // if IsNull then _value will always be 0 // hash code for Null will be 0 ! return _value; } --- 256,260 ---- // if IsNull then _value will always be 0 // hash code for Null will be 0 ! return _value.GetHashCode(); } |
From: Damien G. <dam...@us...> - 2005-10-11 12:19:35
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4298/src/Types Modified Files: DbNullConvert.cs Log Message: Correct exception raised XML documentation for NullableTimeSpan. Index: DbNullConvert.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/DbNullConvert.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DbNullConvert.cs 6 Oct 2005 16:05:35 -0000 1.6 --- DbNullConvert.cs 11 Oct 2005 12:19:41 -0000 1.7 *************** *** 16,19 **** --- 16,20 ---- // 28-Jan-2005 DamienG Upgrade Added support for NullableGuid and added regions. // 05-Sep-2005 DamienG Upgrade Added NullableTimeSpan. + // 11-Oct-2005 DamienG Bugfix Correct exception raised XML documentation for NullableTimeSpan. // *************** *** 456,461 **** /// <paramref name="x"/> is null. /// </exception> ! /// <exception cref="System.InvalidFormatException"> ! /// <paramref name="x"/> is not DBNull, <see cref="System.TimeSpan"/> or <see cref="System.Int6$" />. /// </exception> public static NullableTimeSpan ToNullableTimeSpan(object x) { --- 457,462 ---- /// <paramref name="x"/> is null. /// </exception> ! /// <exception cref="System.InvalidCastException"> ! /// <paramref name="x"/> is not DBNull, <see cref="System.TimeSpan"/> or <see cref="System.Int64" />. /// </exception> public static NullableTimeSpan ToNullableTimeSpan(object x) { |
From: Damien G. <dam...@us...> - 2005-10-11 12:18:45
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4083/src/Types Modified Files: NullConvert.cs Log Message: Remove formatted NullableGuid conversion and add XML documentation to NullableTimeSpan conversion. Index: NullConvert.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullConvert.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NullConvert.cs 6 Oct 2005 16:05:35 -0000 1.7 --- NullConvert.cs 11 Oct 2005 12:18:52 -0000 1.8 *************** *** 13,16 **** --- 13,17 ---- // 28-Jan-2005 DamienG Upgrade Added helpers for NullableGuid and added regions. // 26-Sep-2005 DamienG Upgrade Added helpers for NullableTimeSpan. + // 11-Oct-2005 DamienG Upgrade Remove formated NullableGuid converter and added XML docs for NullableTimeSpan. // *************** *** 139,143 **** /// <summary> /// Converts the specified <see cref="NullableGuid"/> value to an equivalent ! /// <see cref="System.Byte"/> value using a conventional <see cref="System.Byte"/> value to /// represent the <see cref="NullableGuid.Null"/> value. /// </summary> --- 140,144 ---- /// <summary> /// Converts the specified <see cref="NullableGuid"/> value to an equivalent ! /// <see cref="System.Guid"/> value using a conventional <see cref="System.Guid"/> value to /// represent the <see cref="NullableGuid.Null"/> value. /// </summary> *************** *** 161,205 **** /// <summary> - /// Converts the specified <see cref="NullableGuid"/> value to an equivalent - /// <see cref="System.String"/> value using a conventional <see cref="System.String"/> value to - /// represent the <see cref="NullableGuid.Null"/> value. - /// </summary> - /// <param name="x"> - /// The <see cref="NullableGuid"/> value to convert. - /// </param> - /// <param name="conventionalNullValue"> - /// The <see cref="System.String"/> value that conventionally represent the - /// <see cref="NullableGuid.Null"/> value. - /// </param> - /// <param name="format"> - /// A string that specifies the return format of <paramref name="x"/> if it is not - /// <see cref="NullableGuid.Null"/>. - /// </param> - /// <returns> - /// <paramref name="conventionalNullValue"/> if <paramref name="x"/> is - /// <see cref="NullableGuid.Null"/> otherwise the equivalent string of the - /// <see cref="NullableGuid.Value"/> of <paramref name="x"/> formatted as specified by - /// <paramref name="format"/>. - /// </returns> - /// <exception cref="System.FormatException"> - /// <paramref name="x"/> is not <see cref="NullableGuid.Null"/> and the <paramref name="format"/> - /// is invalid for a Byte. - /// </exception> - /// <remarks> - /// If <paramref name="format"/> is a null reference (Nothing in Visual Basic) or an empty string (""), - /// general format specifier ("G") will be used. - /// <para> - /// The <see cref="System.Globalization.NumberFormatInfo"/> for the current culture is used when - /// applying fomatting. - /// </para> - /// </remarks> - public static string From(NullableGuid x, string conventionalNullValue, string format) { - if (x.IsNull) - return conventionalNullValue; - - return x.Value.ToString(format, sysGlb.CultureInfo.CurrentCulture); - } - - /// <summary> /// Converts the specified <see cref="NullableInt16"/> value to an equivalent /// <see cref="System.Int16"/> value using a conventional <see cref="System.Int16"/> value to --- 162,165 ---- *************** *** 686,693 **** /// <see cref="NullableTimeSpan.Null"/> value. /// </param> - /// <param name="format"> - /// A string that specifies the return format of <paramref name="x"/> if it is not - /// <see cref="NullableTimeSpan.Null"/>. - /// </param> /// <returns> /// <paramref name="conventionalNullValue"/> if <paramref name="x"/> is --- 646,649 ---- *************** *** 696,705 **** /// <paramref name="format"/>. /// </returns> - /// <exception cref="System.FormatException"> - /// The length of <paramref name="format"/> is 1, and it is not one of the format specifier characters - /// defined for DateTimeFormatInfo. - /// <para> -or- </para> - /// <paramref name="format"/> does not contain a valid custom format pattern. - /// </exception> public static sys.TimeSpan From(NullableTimeSpan x, sys.TimeSpan conventionalNullValue) { if (x.IsNull) --- 652,655 ---- *************** *** 1352,1355 **** --- 1302,1332 ---- } + /// <summary> + /// Converts the specified <see cref="System.String"/> representation of a number to its + /// <see cref="NullableTimeSpan"/> equivalent. + /// </summary> + /// <param name="x"> + /// The <see cref="System.String"/> value to convert. + /// </param> + /// <param name="conventionalNullValue"> + /// The <see cref="System.String"/> value that conventionally represent the null value. + /// </param> + /// <returns> + /// <see cref="NullableTimeSpan.Null"/> if <paramref name="x"/> is equals to + /// <paramref name="conventionalNullValue"/> otherwise a <see cref="NullableTimeSpan"/> constructed + /// parsing <paramref name="x"/>. + /// </returns> + /// <exception cref="System.ArgumentNullException"> + /// <paramref name="x"/> is a null reference (Nothing in Visual Basic) and + /// <paramref name="conventionalNullValue"/> is not a null reference. + /// </exception> + /// <exception cref="System.FormatException"> + /// <paramref name="x"/> value is not <paramref name="conventionalNullValue"/> and + /// <see cref="NullableDateTime.Parse"/> failed on <paramref name="x"/>. + /// </exception> + /// <exception cref="System.OverflowException"> + /// <paramref name="x"/> value is not <paramref name="conventionalNullValue"/> and + /// <see cref="NullableDateTime.Parse"/> caused an overflow on <paramref name="x"/>. + /// </exception> public static NullableTimeSpan ToNullableTimeSpan(sys.TimeSpan x, sys.TimeSpan conventionalNullValue) { if (x == conventionalNullValue) |
From: Damien G. <dam...@us...> - 2005-10-11 09:58:36
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3191/src/Tests Modified Files: NullConvertTest.cs Log Message: Remove NullConvert formatted tests against NullableGuid, redundant formatting method removed. Index: NullConvertTest.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Tests/NullConvertTest.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** NullConvertTest.cs 6 Oct 2005 16:05:35 -0000 1.9 --- NullConvertTest.cs 11 Oct 2005 09:58:40 -0000 1.10 *************** *** 446,459 **** } ! [nu.Test] public void ToNullableGuid() { ! sys.Guid conventionalNullGuid = sys.Guid.NewGuid(); nua.AssertEquals("TestA#210", NullableGuid.Null, NullConvert.ToNullableGuid(conventionalNullGuid, conventionalNullGuid)); ! sys.Guid conventionalGuid = sys.Guid.NewGuid(); nua.AssertEquals("TestA#211", new NullableGuid(conventionalGuid).Value, NullConvert.ToNullableGuid(conventionalGuid, conventionalNullGuid)); } ! ! #endregion // Non nullable built-in types to NullableTypes #region NullableTypes to non nullable built-in types - B# --- 446,459 ---- } ! [nu.Test] public void ToNullableGuid() { ! sys.Guid conventionalNullGuid = sys.Guid.NewGuid(); nua.AssertEquals("TestA#210", NullableGuid.Null, NullConvert.ToNullableGuid(conventionalNullGuid, conventionalNullGuid)); ! sys.Guid conventionalGuid = sys.Guid.NewGuid(); nua.AssertEquals("TestA#211", new NullableGuid(conventionalGuid).Value, NullConvert.ToNullableGuid(conventionalGuid, conventionalNullGuid)); } ! ! #endregion // Non nullable built-in types to NullableTypes #region NullableTypes to non nullable built-in types - B# *************** *** 596,605 **** [nu.Test] public void FromNullableGuid() { ! sys.Guid testGuid = sys.Guid.NewGuid(); ! nua.AssertEquals("TestB#097", sys.Guid.Empty, NullConvert.From(NullableGuid.Null, sys.Guid.Empty)); ! nua.AssertEquals("TestB#098", null, NullConvert.From(NullableGuid.Null, null, "")); ! nua.AssertEquals("TestB#099", sys.Guid.Empty, NullConvert.From(NullableGuid.Empty, testGuid)); ! nua.AssertEquals("TestB#100", testGuid, NullConvert.From(testGuid, null, "")); } --- 596,603 ---- [nu.Test] public void FromNullableGuid() { ! sys.Guid testGuid = sys.Guid.NewGuid(); ! nua.AssertEquals("TestB#097", sys.Guid.Empty, NullConvert.From(NullableGuid.Null, sys.Guid.Empty)); ! nua.AssertEquals("TestB#098", sys.Guid.Empty, NullConvert.From(NullableGuid.Empty, testGuid)); } |
From: Damien G. <dam...@us...> - 2005-10-11 09:56:54
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2695/src/Tests Modified Files: NullableTimeSpanTest.cs Log Message: Add missing NullableTimeSpanTest Subtract test and correct Add test for NullableTimeSpan now that the Add method is instance not static. Index: NullableTimeSpanTest.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Tests/NullableTimeSpanTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableTimeSpanTest.cs 6 Oct 2005 16:05:35 -0000 1.1 --- NullableTimeSpanTest.cs 11 Oct 2005 09:56:57 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- // Date Author Changes Reasons // 29-Sep-2005 DamienG Create + // 11-Oct-2005 DamienG Upgrade Add new test for Subtract, fix test for Add. // *************** *** 179,183 **** #region Method Tests - G# [nu.Test] ! public void Add() { long ix = -97643554; long iy = 20; --- 180,184 ---- #region Method Tests - G# [nu.Test] ! public void AddSubtract() { long ix = -97643554; long iy = 20; *************** *** 186,190 **** NullableTimeSpan y = new NullableTimeSpan(iy);; ! nua.AssertEquals("TestG#01", new sys.TimeSpan(ix + iy), NullableTimeSpan.Add(x,y).Value); } --- 187,192 ---- NullableTimeSpan y = new NullableTimeSpan(iy);; ! nua.AssertEquals("TestG#01", new sys.TimeSpan(ix + iy), x.Add(y).Value); ! nua.AssertEquals("TestG#02", new sys.TimeSpan(ix - iy), x.Subtract(y).Value); } |
From: Damien G. <dam...@us...> - 2005-10-11 09:55:43
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2446/src/Types Modified Files: NullableGuid.cs Log Message: Clean up NullableGuid and add missing XML documentation. Index: NullableGuid.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/NullableGuid.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NullableGuid.cs 26 Sep 2005 13:34:17 -0000 1.6 --- NullableGuid.cs 11 Oct 2005 09:55:44 -0000 1.7 *************** *** 13,16 **** --- 13,17 ---- // 05-Sep-2005 DamienG Upgrade Added new Empty handling as per NullableString. // 26-Sep-2005 DamienG Bugfix Change ToNullableString to cast via NullableString. + // 11-Oct-2005 DamienG Upgrade Clean up and add missing XML documentation. // *************** *** 21,31 **** using sysXmlScm = System.Xml.Schema; [sys.Serializable] public struct NullableGuid : INullable, sys.IComparable, sysXmlSrl.IXmlSerializable { #region Fields ! sys.Guid _value; private bool _notNull; public static readonly NullableGuid Null; public static readonly NullableGuid Empty = new NullableGuid(System.Guid.Empty); --- 22,42 ---- using sysXmlScm = System.Xml.Schema; + /// <summary> + /// Represents a globally unique identifier that is either a a <see cref="System.Guid"/> or <see cref="Null"/>. + /// </summary> [sys.Serializable] public struct NullableGuid : INullable, sys.IComparable, sysXmlSrl.IXmlSerializable { + #region Fields ! ! private sys.Guid _value; private bool _notNull; + /// Represents the null <see cref="NullableGuid"/>. This field is read-only. public static readonly NullableGuid Null; + + /// <summary> + /// Represents the empty <see cref="NullableGuid"/> value. This field is read-only. + /// </summary> public static readonly NullableGuid Empty = new NullableGuid(System.Guid.Empty); *************** *** 33,51 **** #region Constructors ! public NullableGuid (byte[] value) { ! _value = new sys.Guid (value); _notNull = true; } ! public NullableGuid (sys.Guid g) { ! _value = g; _notNull = true; } ! public NullableGuid (string s) { ! _value = new sys.Guid (s); _notNull = true; } public NullableGuid(int a, short b, short c, byte[] d) { _value = new sys.Guid(a, b, c, d); --- 44,88 ---- #region Constructors ! ! /// <summary> ! /// Initializes a new instance of the class using the <see cref="System.Guid"/> specified. ! /// </summary> ! /// <param name="g">A <see cref="System.Guid"/>.</param> ! public NullableGuid(sys.Guid g) { ! _value = g; _notNull = true; } ! /// <summary> ! /// Initializes a new instance of the class using the specified array of bytes. ! /// </summary> ! /// <param name="b">A 16 element byte array containing values with which to initialize the Guid.</param> ! /// <exception cref="System.ArgumentNullException"><paramref name="b"/> is <see cref="Null"/>.</exception> ! /// <exception cref="System.ArgumentException"><paramref name="b"/> is not 16 bytes long.</exception> ! public NullableGuid(byte[] b) { ! _value = new sys.Guid (b); _notNull = true; } ! /// <summary> ! /// Initializes a new instance of the Guid class using the value represented by the specified string. ! /// </summary> ! /// <param name="g">A <see cref="System.String"/> that contains a Guid in an acceptible format for <see cref="System.TimeSpan"/>.</param> ! /// <exception cref="System.ArgumentNullException"><paramref name="g"/> is <see cref="Null"/>.</exception> ! /// <exception cref="System.FormatException">The format of <paramref name="g"/> is invalid.</exception> ! public NullableGuid(string g) { ! _value = new sys.Guid(g); _notNull = true; } + /// <summary> + /// Initializes a new instance of the class using the specified integers and byte array. + /// </summary> + /// <param name="a">The first 4 bytes of the GUID.</param> + /// <param name="b">The next 2 bytes of the GUID.</param> + /// <param name="c">The next 2 bytes of the GUID.</param> + /// <param name="d">The remaining 8 bytes of the GUID.</param> + /// <exception cref="System.ArgumentNullException"><paramref name="d"/> is <see langword="null"/>.</exception> + /// <exception cref="System.ArgumentException"><paramref name="d"/>d is not 8 bytes long.</exception> public NullableGuid(int a, short b, short c, byte[] d) { _value = new sys.Guid(a, b, c, d); *************** *** 53,79 **** } public NullableGuid (int a, short b, short c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k) { _value = new sys.Guid (a, b, c, d, e, f, g, h, i, j, k); _notNull = true; } #endregion // Constructors #region INullable public bool IsNull { get { return !_notNull; } } #endregion // INullable #region IComparable - Ordering ! public int CompareTo(object value) { ! if (value == null) ! return 1; ! else if (!(value is NullableGuid)) throw new sys.ArgumentException(string.Format(Locale.GetText("Value is not a {0}."), "NullableTypes.NullableGuid")); ! else if (((NullableGuid)value).IsNull) ! return 1; ! else ! return _value.CompareTo(((NullableGuid)value).Value); } --- 90,145 ---- } + /// <summary> + /// Initializes a new instance of the class using the specified integers and bytes. + /// </summary> + /// <param name="a">The first 4 bytes of the GUID.</param> + /// <param name="b">The next 2 bytes of the GUID.</param> + /// <param name="c">The next 2 bytes of the GUID.</param> + /// <param name="d">The next byte of the GUID.</param> + /// <param name="e">The next byte of the GUID.</param> + /// <param name="f">The next byte of the GUID.</param> + /// <param name="g">The next byte of the GUID.</param> + /// <param name="h">The next byte of the GUID.</param> + /// <param name="i">The next byte of the GUID.</param> + /// <param name="j">The next byte of the GUID.</param> + /// <param name="k">The next byte of the GUID.</param> public NullableGuid (int a, short b, short c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k) { _value = new sys.Guid (a, b, c, d, e, f, g, h, i, j, k); _notNull = true; } + #endregion // Constructors #region INullable + /// <summary> + /// Indicates whether or not the value of the <see cref="NullableGuid"/> + /// structure is null. + /// </summary> + /// <value> + /// true if the <see cref="NullableGuid"/> structure is null, otherwise + /// false. + /// </value> public bool IsNull { get { return !_notNull; } } + #endregion // INullable #region IComparable - Ordering ! ! /// <summary> ! /// Compares this instance to a specified object and returns an indication of their relative values. ! /// </summary> ! /// <param name="o">An object to compare, or <see langword="null"/>.</param> ! /// <returns></returns> ! /// <exception cref="System.ArgumentException"><paramref name="o"/> is not a <see cref="NullableGuid"/>.</exception> ! public int CompareTo(object o) { ! if (o == null)return 1; ! if (!(o is NullableGuid)) throw new sys.ArgumentException(string.Format(Locale.GetText("Value is not a {0}."), "NullableTypes.NullableGuid")); ! ! NullableGuid g = (NullableGuid) o; ! return (g.IsNull) ? 1 : _value.CompareTo(g.Value); } *************** *** 81,123 **** #region Equivalence - public override bool Equals(object value) { - if (!(value is NullableGuid)) - return false; - else if (this.IsNull && ((NullableGuid)value).IsNull) - return true; - else if (this.IsNull) - return false; - else if (((NullableGuid)value).IsNull) - return false; - else - return (bool) (this == (NullableGuid)value); - } ! public static NullableBoolean NotEquals(NullableGuid x, NullableGuid y) { ! return (x != y); } ! public static NullableBoolean operator == (NullableGuid x, NullableGuid y) { ! if (x.IsNull || y.IsNull) return NullableBoolean.Null; ! return new NullableBoolean (x.Value == y.Value); } ! public static NullableBoolean operator != (NullableGuid x, NullableGuid y) { ! if (x.IsNull || y.IsNull) return NullableBoolean.Null; ! return new NullableBoolean (!(x.Value == y.Value)); } ! public static NullableBoolean Equals(NullableGuid x, NullableGuid y) { ! return (x == y); } - public override int GetHashCode() { - System.Guid tmp = (IsNull) ? System.Guid.Empty : _value; - - return tmp.GetHashCode(); - } #endregion // Equivalence #region IXmlSerializable /// <summary> /// This member supports the .NET Framework infrastructure and is not intended to be used directly --- 147,206 ---- #region Equivalence ! /// <summary> ! /// Returns a value indicating whether this instance is equal to a specified object. ! /// </summary> ! /// <param name="o">An object to compare with this instance.</param> ! /// <returns>true if value is a <see cref="NullableGuid"/> that represents the same time as this instance; otherwise, false.</returns> ! public override bool Equals(object o) { ! if (!(o is NullableGuid)) return false; ! NullableGuid g = (NullableGuid) o; ! if (IsNull && g.IsNull) return true; ! if (IsNull || g.IsNull) return false; ! return (bool) (this == g); } ! /// <summary> ! /// Returns an indication whether the values of two specified <see cref="NullableGuid"/> objects are equal. ! /// </summary> ! /// <param name="g1">A <see cref="NullableGuid"/> object.</param> ! /// <param name="g2">A <see cref="NullableGuid"/> object.</param> ! /// <see cref="NullableBoolean.Null"/> if either <paramref name="g1"/> or <paramref name="g2"/> are <see cref="Null"/>, ! /// <see cref="NullableBoolean.True"/> if the values of <paramref name="g1"/> and <paramref name="g2"/> are equal, ! /// <see cref="NullableBoolean.False"/> if the values of <paramref name="g1"/> and <paramref name="g2"/> are not equal. ! public static NullableBoolean operator == (NullableGuid g1, NullableGuid g2) { ! if (g1.IsNull || g2.IsNull) return NullableBoolean.Null; ! return new NullableBoolean (g1.Value == g2.Value); } ! /// <summary> ! /// Returns an indication whether the values of two specified <see cref="NullableGuid"/> objects are not equal. ! /// </summary> ! /// <param name="g1">A <see cref="NullableGuid"/> object.</param> ! /// <param name="g2">A <see cref="NullableGuid"/> object.</param> ! /// <see cref="NullableBoolean.Null"/> if either <paramref name="g1"/> or <paramref name="g2"/> are <see cref="Null"/>, ! /// <see cref="NullableBoolean.True"/> if the values of <paramref name="g1"/> and <paramref name="g2"/> are not equal, ! /// <see cref="NullableBoolean.False"/> if the values of <paramref name="g1"/> and <paramref name="g2"/> are equal. ! public static NullableBoolean operator != (NullableGuid g1, NullableGuid g2) { ! if (g1.IsNull || g2.IsNull) return NullableBoolean.Null; ! return new NullableBoolean (!(g1.Value == g2.Value)); } ! /// <summary> ! /// Indicates whether two <see cref="NullableGuid"/> instances are equal. ! /// </summary> ! /// <param name="g1">A <see cref="NullableGuid"/>.</param> ! /// <param name="g2">A <see cref="NullableGuid"/>.</param> ! /// <see cref="NullableBoolean.Null"/> if either <paramref name="g1"/> or <paramref name="g2"/> are <see cref="Null"/>, ! /// <see cref="NullableBoolean.True"/> if the values of <paramref name="g1"/> and <paramref name="g2"/> are equal, ! /// <see cref="NullableBoolean.False"/> if the values of <paramref name="g1"/> and <paramref name="g2"/> are not equal. ! public static NullableBoolean Equals(NullableGuid g1, NullableGuid g2) { ! return (g1 == g2); } #endregion // Equivalence #region IXmlSerializable + /// <summary> /// This member supports the .NET Framework infrastructure and is not intended to be used directly *************** *** 180,189 **** _notNull = false; } #endregion // IXmlSerializable #region Properties public sys.Guid Value { get { ! if (this.IsNull) throw new NullableNullValueException(); --- 263,278 ---- _notNull = false; } + #endregion // IXmlSerializable #region Properties + + /// <summary> + /// Contains the <see cref="System.Guid"/> this instance represents if it is not <see cref="Null"/>. + /// </summary> + /// <exception cref="NullableNullValueException">instance is <see cref="Null"/>.</exception> public sys.Guid Value { get { ! if (IsNull) throw new NullableNullValueException(); *************** *** 191,269 **** } } #endregion // Properties #region Methods ! public static NullableBoolean GreaterThan(NullableGuid x, NullableGuid y) { ! return (x > y); } ! public static NullableBoolean GreaterThanOrEqual(NullableGuid x, NullableGuid y) { ! return (x >= y); } ! public static NullableBoolean LessThan(NullableGuid x, NullableGuid y) { ! return (x < y); } ! public static NullableBoolean LessThanOrEqual(NullableGuid x, NullableGuid y) { ! return (x <= y); } ! public static NullableGuid Parse(string s) { ! return new NullableGuid (s); } #endregion // Methods #region Operators - public static NullableBoolean operator > (NullableGuid x, NullableGuid y) { - if (x.IsNull || y.IsNull) - return NullableBoolean.Null; ! if (x.Value.CompareTo (y.Value) > 0) ! return new NullableBoolean (true); else ! return new NullableBoolean (false); } ! public static NullableBoolean operator >= (NullableGuid x, NullableGuid y) { ! if (x.IsNull || y.IsNull) return NullableBoolean.Null; - - if (x.Value.CompareTo (y.Value) >= 0) - return new NullableBoolean (true); else ! return new NullableBoolean (false); } ! public static NullableBoolean operator < (NullableGuid x, NullableGuid y) { ! if (x.IsNull || y.IsNull) return NullableBoolean.Null; - - if (x.Value.CompareTo (y.Value) < 0) - return new NullableBoolean (true); else ! return new NullableBoolean (false); } ! public static NullableBoolean operator <= (NullableGuid x, NullableGuid y) { ! if (x.IsNull || y.IsNull) return NullableBoolean.Null; - - if (x.Value.CompareTo (y.Value) <= 0) - return new NullableBoolean (true); else ! return new NullableBoolean (false); } #endregion // Operators #region Conversion Operators public static explicit operator sys.Guid(NullableGuid x) { return x.Value; } public static explicit operator NullableGuid(NullableString x) { return new NullableGuid (x.Value); } public static implicit operator NullableGuid(sys.Guid x) { return new NullableGuid (x); --- 280,475 ---- } } + #endregion // Properties #region Methods ! ! /// <summary> ! /// Indicates whether a specified <see cref="NullableGuid"/> is greater than another specified <see cref="NullableGuid"/>. ! /// </summary> ! /// <param name="g1">A <see cref="NullableGuid"/>.</param> ! /// <param name="g2">A <see cref="NullableGuid"/>.</param> ! /// <returns> ! /// <see cref="NullableBoolean.True"/> if <paramref name="g1"/> is greater than <paramref name="g2"/>, ! /// <see cref="NullableBoolean.Null"/> if one or both of the instances are NullableGuid.Null, ! /// <see cref="NullableBoolean.False"/> if <paramref name="g1"/> is less than or equal to <paramref name="g2"/>. ! /// </returns> ! public static NullableBoolean GreaterThan(NullableGuid g1, NullableGuid g2) { ! return (g1 > g2); } ! /// <summary> ! /// Indicates whether a specified <see cref="NullableGuid"/> is greater than or equal to another specified <see cref="NullableGuid"/>. ! /// </summary> ! /// <param name="g1">A <see cref="NullableGuid"/>.</param> ! /// <param name="g2">A <see cref="NullableGuid"/>.</param> ! /// <returns> ! /// <see cref="NullableBoolean.True"/> if <paramref name="g1"/> is greater than or equal to <paramref name="g2"/>, ! /// <see cref="NullableBoolean.Null"/> if one or both of the instances are NullableGuid.Null, ! /// <see cref="NullableBoolean.False"/> if <paramref name="g1"/> is less than <paramref name="g2"/>. ! /// </returns> ! public static NullableBoolean GreaterThanOrEqual(NullableGuid g1, NullableGuid g2) { ! return (g1 >= g2); } ! /// <summary> ! /// Indicates whether a specified <see cref="NullableGuid"/> is less than another specified <see cref="NullableGuid"/>. ! /// </summary> ! /// <param name="g1">A <see cref="NullableGuid"/>.</param> ! /// <param name="g2">A <see cref="NullableGuid"/>.</param> ! /// <returns> ! /// <see cref="NullableBoolean.True"/> if <paramref name="g1"/> is less than <paramref name="g2"/>, ! /// <see cref="NullableBoolean.Null"/> if one or both of the instances are NullableGuid.Null, ! /// <see cref="NullableBoolean.False"/> if <paramref name="g1"/> is greater than or equal to <paramref name="g2"/>. ! /// </returns> ! public static NullableBoolean LessThan(NullableGuid g1, NullableGuid g2) { ! return (g1 < g2); } ! /// <summary> ! /// Indicates whether a specified <see cref="NullableGuid"/> is less than another specified <see cref="NullableGuid"/>. ! /// </summary> ! /// <param name="g1">A <see cref="NullableGuid"/>.</param> ! /// <param name="g2">A <see cref="NullableGuid"/>.</param> ! /// <returns> ! /// <see cref="NullableBoolean.True"/> if <paramref name="g1"/> is less than <paramref name="g2"/>, ! /// <see cref="NullableBoolean.Null"/> if one or both of the instances are NullableGuid.Null, ! /// <see cref="NullableBoolean.False"/> if <paramref name="g1"/> is greater than or equal to <paramref name="g2"/>. ! /// </returns> ! public static NullableBoolean LessThanOrEqual(NullableGuid g1, NullableGuid g2) { ! return (g1 <= g2); } ! /// <summary> ! /// Returns a hash code for this instance. ! /// </summary> ! /// <returns>A 32-bit signed integer hash code.</returns> ! public override int GetHashCode() ! { ! System.Guid tmp = (IsNull) ? System.Guid.Empty : _value; ! return tmp.GetHashCode(); } + #endregion // Methods #region Operators ! /// <summary> ! /// Indicates whether a specified <see cref="NullableGuid"/> is greater than another specified <see cref="NullableGuid"/>. ! /// </summary> ! /// <param name="g1">A <see cref="NullableGuid"/>.</param> ! /// <param name="g2">A <see cref="NullableGuid"/>.</param> ! /// <returns> ! /// <see cref="NullableBoolean.True"/> if <paramref name="g1"/> is greater than <paramref name="g2"/>, ! /// <see cref="NullableBoolean.Null"/> if one or both of the instances are NullableGuid.Null, ! /// <see cref="NullableBoolean.False"/> if <paramref name="g1"/> is less than or equal to <paramref name="g2"/>. ! /// </returns> ! public static NullableBoolean operator > (NullableGuid g1, NullableGuid g2) { ! if (g1.IsNull || g2.IsNull) ! return NullableBoolean.Null; else ! return new NullableBoolean(g1.Value.CompareTo(g2.Value) > 0); } ! /// <summary> ! /// Indicates whether a specified <see cref="NullableGuid"/> is greater than or equal to another specified <see cref="NullableGuid"/>. ! /// </summary> ! /// <param name="g1">A <see cref="NullableGuid"/>.</param> ! /// <param name="g2">A <see cref="NullableGuid"/>.</param> ! /// <returns> ! /// <see cref="NullableBoolean.True"/> if <paramref name="g1"/> is greater than or equal to <paramref name="g2"/>, ! /// <see cref="NullableBoolean.Null"/> if one or both of the instances are NullableGuid.Null, ! /// <see cref="NullableBoolean.False"/> if <paramref name="g1"/> is less than <paramref name="g2"/>. ! /// </returns> ! public static NullableBoolean operator >= (NullableGuid g1, NullableGuid g2) { ! if (g1.IsNull || g2.IsNull) return NullableBoolean.Null; else ! return new NullableBoolean(g1.Value.CompareTo(g2.Value) >= 0); } ! /// <summary> ! /// Indicates whether a specified <see cref="NullableGuid"/> is less than another specified <see cref="NullableGuid"/>. ! /// </summary> ! /// <param name="g1">A <see cref="NullableGuid"/>.</param> ! /// <param name="g2">A <see cref="NullableGuid"/>.</param> ! /// <returns> ! /// <see cref="NullableBoolean.True"/> if <paramref name="g1"/> is less than <paramref name="g2"/>, ! /// <see cref="NullableBoolean.Null"/> if one or both of the instances are NullableGuid.Null, ! /// <see cref="NullableBoolean.False"/> if <paramref name="g1"/> is greater than or equal to <paramref name="g2"/>. ! /// </returns> ! public static NullableBoolean operator < (NullableGuid g1, NullableGuid g2) { ! if (g1.IsNull || g2.IsNull) return NullableBoolean.Null; else ! return new NullableBoolean(g1.Value.CompareTo(g2.Value) < 0); } ! /// <summary> ! /// Indicates whether a specified <see cref="NullableGuid"/> is less than another specified <see cref="NullableGuid"/>. ! /// </summary> ! /// <param name="g1">A <see cref="NullableGuid"/>.</param> ! /// <param name="g2">A <see cref="NullableGuid"/>.</param> ! /// <returns> ! /// <see cref="NullableBoolean.True"/> if <paramref name="g1"/> is less than <paramref name="g2"/>, ! /// <see cref="NullableBoolean.Null"/> if one or both of the instances are NullableGuid.Null, ! /// <see cref="NullableBoolean.False"/> if <paramref name="g1"/> is greater than or equal to <paramref name="g2"/>. ! /// </returns> ! public static NullableBoolean operator <= (NullableGuid g1, NullableGuid g2) { ! if (g1.IsNull || g2.IsNull) return NullableBoolean.Null; else ! return new NullableBoolean(g1.Value.CompareTo(g2.Value) <= 0); } + #endregion // Operators #region Conversion Operators + + /// <summary> + /// Converts the specified <see cref="NullableGuid"/> to a <see cref="System.Guid"/>. + /// </summary> + /// <param name="x">A <see cref="NullableGuid"/> to convert.</param> + /// <returns> + /// A <see cref="System.Guid"/> set to the <see cref="Value"/> of the + /// <see cref="NullableGuid"/>. + /// </returns> + /// <exception cref="NullableNullValueException"> + /// <paramref name="x"/> is <see cref="Null"/>. + /// </exception> public static explicit operator sys.Guid(NullableGuid x) { return x.Value; } + /// <summary> + /// Converts the specified <see cref="NullableString"/> to a <see cref="NullableGuid"/>. + /// </summary> + /// <param name="x">A <see cref="NullableString"/> to convert.</param> + /// <returns> + /// <see cref="Null"/> if <paramref name="x"/> is + /// <see cref="NullableString.Null"/> otherwise a new + /// <see cref="NullableGuid"/> containing the parsed value. + /// </returns> + /// <exception cref="System.ArgumentException"> + /// <paramref name="x"/> is <see langword="null" />. + /// </exception> + /// <exception cref="System.FormatException"> + /// <paramref name="x"/> does not consist solely of an optional sign followed + /// by a sequence of digits ranging from 0 to 9. + /// </exception> public static explicit operator NullableGuid(NullableString x) { return new NullableGuid (x.Value); } + /// <summary> + /// Converts the specified <see cref="System.Guid"/> to a <see cref="NullableGuid"/>. + /// </summary> + /// <param name="x"> + /// A <see cref="System.TimeSpan"/> to convert. + /// </param> + /// <returns> + /// A new <see cref="NullableGuid"/> structure constructed from + /// <paramref name="x"/>. + /// </returns> public static implicit operator NullableGuid(sys.Guid x) { return new NullableGuid (x); *************** *** 274,291 **** #region Conversions public byte[] ToByteArray() { ! return _value.ToByteArray (); } public NullableString ToNullableString () { ! return (NullableString) this; } public override string ToString () { ! if (this.IsNull) ! return string.Empty; ! else ! return _value.ToString (); } #endregion // Conversions } --- 480,508 ---- #region Conversions + /// <summary> + /// Returns a 16-element byte array that contains the value of the <see cref="System.Guid"/>. + /// </summary> + /// <returns>A 16-element byte array.</returns> public byte[] ToByteArray() { ! return Value.ToByteArray (); } + /// <summary> + /// Returns the <see cref="NullableString"/> representation of this instance. + /// </summary> + /// <returns>A <see cref="NullableString"/> that represents this instance.</returns> public NullableString ToNullableString () { ! return (NullableString) this; } + /// <summary> + /// Returns the string representation of the value of this instance. + /// </summary> + /// <returns>A string that represents this instance.</returns> public override string ToString () { ! if (IsNull) return string.Empty; ! return Value.ToString (); } + #endregion // Conversions } |