CompareTo() public method

Returns the result of comparing this instance to another Object.
public CompareTo ( Object other ) : int
other Object The other instance to compare with.
return int
Beispiel #1
0
 /// <summary>
 /// Compares two <see cref="Time"/> instances to determine if the
 /// first is equal to or smaller than the second.
 /// </summary>
 /// <param name="lhs">The first Time.</param>
 /// <param name="rhs">The second Tie.</param>
 /// <returns><c>true</c> if the first value is less than the second.</returns>
 public static bool LessOrEqual(Time lhs, Time rhs)
 {
     return (lhs.CompareTo (rhs) <= 0);
 }
Beispiel #2
0
 /// <summary>
 /// Compares two <see cref="Time"/> instances to determine if the
 /// first is equal to or larger than the second.
 /// </summary>
 /// <param name="lhs">The first Time.</param>
 /// <param name="rhs">The second Time.</param>
 /// <returns><c>true</c> if the first value is greater than the second.</returns>
 public static bool GreaterOrEqual(Time lhs, Time rhs)
 {
     return (lhs.CompareTo (rhs) >= 0);
 }
Beispiel #3
0
 /// <summary>
 /// Determines if the value of a <see cref="Time"/> is less than
 /// the value of another.
 /// </summary>
 /// <param name="lhs">The <see cref="Time"/> to compare.</param>
 /// <param name="rhs">The <see cref="Time"/> to compare with.</param>
 /// <returns><c>true</c> if the first value is less than the second.</returns>
 public static bool Less(Time lhs, Time rhs)
 {
     return (lhs.CompareTo (rhs) < 0);
 }
Beispiel #4
0
 /// <summary>
 /// Determines if the value of a <see cref="Time"/> is greater than
 /// the value of another.
 /// </summary>
 /// <param name="lhs">The <see cref="Time"/> to compare.</param>
 /// <param name="rhs">The <see cref="Time"/> to compare with.</param>
 /// <returns><c>true</c> if the first value is greater than the second.</returns>
 public static bool Greater(Time lhs, Time rhs)
 {
     return (lhs.CompareTo (rhs) > 0);
 }