dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] pnetlib ChangeLog runtime/System/TimeSpan.cs


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] pnetlib ChangeLog runtime/System/TimeSpan.cs
Date: Sun, 15 Feb 2009 16:09:07 +0000

CVSROOT:        /cvsroot/dotgnu-pnet
Module name:    pnetlib
Changes by:     Klaus Treichel <ktreichel>      09/02/15 16:09:07

Modified files:
        .              : ChangeLog 
        runtime/System : TimeSpan.cs 

Log message:
        Add more 2.0 stuff.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnetlib/ChangeLog?cvsroot=dotgnu-pnet&r1=1.2558&r2=1.2559
http://cvs.savannah.gnu.org/viewcvs/pnetlib/runtime/System/TimeSpan.cs?cvsroot=dotgnu-pnet&r1=1.10&r2=1.11

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/ChangeLog,v
retrieving revision 1.2558
retrieving revision 1.2559
diff -u -b -r1.2558 -r1.2559
--- ChangeLog   15 Feb 2009 15:56:51 -0000      1.2558
+++ ChangeLog   15 Feb 2009 16:09:06 -0000      1.2559
@@ -9,10 +9,10 @@
        runtime/System/Int16.cs, runtime/System/Int32.cs,
        runtime/System/Int64.cs, runtime/System/SByte.cs,
        runtime/System/Single.cs, runtime/System/String.cs,
-       runtime/System/UInt16.cs, runtime/System/UInt32.cs,
-       runtime/System/UInt64.cs, runtime/System/Version.cs: Add in 2.0 ECMA
-       implemented generic interfaces IComparable<T> and IEquatable<T> and the
-       implementing methods.
+       runtime/System/TimeSpan.cs, runtime/System/UInt16.cs,
+       runtime/System/UInt32.cs, runtime/System/UInt64.cs,
+       runtime/System/Version.cs: Add in 2.0 ECMA implemented generic 
interfaces
+       IComparable<T> and IEquatable<T> and the implementing methods.
        Add missing non ECMA 2.0 attributes ComVisible(true) and Serializable
        where missing.
 

Index: runtime/System/TimeSpan.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/TimeSpan.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- runtime/System/TimeSpan.cs  27 Mar 2004 10:16:49 -0000      1.10
+++ runtime/System/TimeSpan.cs  15 Feb 2009 16:09:06 -0000      1.11
@@ -22,6 +22,9 @@
 {
 
 public struct TimeSpan : IComparable
+#if CONFIG_FRAMEWORK_2_0
+       , IComparable<TimeSpan>, IEquatable<TimeSpan>
+#endif
 {
        internal long value_;
 
@@ -96,6 +99,33 @@
                                }
                        }
 
+#if CONFIG_FRAMEWORK_2_0
+
+       // Implementation of the IComparable<TinaSpan> interface.
+       public int CompareTo(TimeSpan value)
+                       {
+                               if(value_ < value.value_)
+                               {
+                                       return -1;
+                               }
+                               else if(value_ > value.value_)
+                               {
+                                       return 1;
+                               }
+                               else
+                               {
+                                       return 0;
+                               }
+                       }
+
+       // Implementation of the IEquatable<TimeSpan> interface.
+       public bool Equals(TimeSpan obj)
+                       {
+                               return (value_ == obj.value_);
+                       }
+
+#endif // CONFIG_FRAMEWORK_2_0
+
        // Convert an integer value into two digits.
        private static String TwoDigits(int value)
                        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]