Beispiel #1
0
 /// <summary>The absolute value of the movement in time between first and second.</summary>
 public static IDuration Between(ITimePoint first, ITimePoint second)
 {
     if (first.IsAfterOrSameInstantAs(second))
     {
         return(FromTimeSpan(first.AsDateTime() - second.AsDateTime()));
     }
     return(FromTimeSpan(second.AsDateTime() - first.AsDateTime()));
 }
 public SimplePlaneTimePoint(IPlanePoint planePosition, ITimePoint timePosition) : base(planePosition)
 {
     _dateTimeValue = timePosition.AsDateTime();
 }
 public SimplePlaneTimePoint(IPlanePoint planePosition, ITimePoint timePosition) : base(planePosition)
 {
     _dateTimeValue = timePosition.AsDateTime();
 }
Beispiel #4
0
 public ITimePoint ProjectAt(ITimePoint targetTime)
 {
     return(new SimpleTimePoint(targetTime.AsDateTime()));
 }
Beispiel #5
0
 private static bool IsSameInstantAs(this ITimePoint me, ITimePoint other)
 {
     return(me.AsDateTime() == other.AsDateTime());
 }
Beispiel #6
0
 /// <summary>True if <paramref name="me"/> is placed after <paramref name="other"/> on the timeline.</summary>
 public static bool IsAfter(this ITimePoint me, ITimePoint other)
 {
     return(me.AsDateTime() > other.AsDateTime());
 }
Beispiel #7
0
 /// <summary>True if <paramref name="me"/> is placed before <paramref name="other"/> on the timeline.</summary>
 public static bool IsBefore(this ITimePoint me, ITimePoint other)
 {
     return(me.AsDateTime() < other.AsDateTime());
 }