if (!(value is DateTime)) {
throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDateTime"));
}
-
- long valueTicks = ((DateTime)value).InternalTicks;
- long ticks = InternalTicks;
- if (ticks > valueTicks) return 1;
- if (ticks < valueTicks) return -1;
- return 0;
+
+ return Compare(this, (DateTime)value);
}
public int CompareTo(DateTime value) {
- long valueTicks = value.InternalTicks;
- long ticks = InternalTicks;
- if (ticks > valueTicks) return 1;
- if (ticks < valueTicks) return -1;
- return 0;
+ return Compare(this, value);
}
// Returns the tick count corresponding to the given year, month, and day.