Author: alp
Date: 2006-01-16 17:53:47 -0500 (Mon, 16 Jan 2006)
New Revision: 55659
Modified:
trunk/mcs/class/corlib/System/ChangeLog
trunk/mcs/class/corlib/System/TimeSpan.cs
Log:
2006-01-16 Alp Toker <[EMAIL PROTECTED]>
* TimeSpan.cs: Simple implementation of NET 2.0 TryParse() using
try/catch
Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog 2006-01-16 21:55:19 UTC (rev
55658)
+++ trunk/mcs/class/corlib/System/ChangeLog 2006-01-16 22:53:47 UTC (rev
55659)
@@ -1,3 +1,8 @@
+2006-01-16 Alp Toker <[EMAIL PROTECTED]>
+
+ * TimeSpan.cs: Simple implementation of NET 2.0 TryParse() using
+ try/catch
+
2006-01-05 Raja R Harinath <[EMAIL PROTECTED]>
Fix regressions introduced by the fix to #71300.
Modified: trunk/mcs/class/corlib/System/TimeSpan.cs
===================================================================
--- trunk/mcs/class/corlib/System/TimeSpan.cs 2006-01-16 21:55:19 UTC (rev
55658)
+++ trunk/mcs/class/corlib/System/TimeSpan.cs 2006-01-16 22:53:47 UTC (rev
55659)
@@ -331,6 +331,19 @@
return p.Execute ();
}
+#if NET_2_0
+ public static bool TryParse (string s, out TimeSpan result)
+ {
+ try {
+ result = Parse (s);
+ return true;
+ } catch {
+ result = TimeSpan.Zero;
+ return false;
+ }
+ }
+#endif
+
public TimeSpan Subtract (TimeSpan ts)
{
try {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches