Ejemplo n.º 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();
 }
Ejemplo n.º 3
0
 public SimplePlaneTimePoint(IPlanePoint planePosition, ITimePoint timePosition) : base(planePosition)
 {
     _dateTimeValue = timePosition.AsDateTime();
 }
Ejemplo n.º 4
0
 public ITimePoint ProjectAt(ITimePoint targetTime)
 {
     return(new SimpleTimePoint(targetTime.AsDateTime()));
 }
Ejemplo n.º 5
0
 private static bool IsSameInstantAs(this ITimePoint me, ITimePoint other)
 {
     return(me.AsDateTime() == other.AsDateTime());
 }
Ejemplo n.º 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());
 }
Ejemplo n.º 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());
 }