Example #1
0
        public JsImplTimeSpan Subtract(JsImplTimeSpan ts)
        {
            long num = _ticks - ts._ticks;

            if (_ticks >> 63 != ts._ticks >> 63 && _ticks >> 63 != num >> 63)
            {
                throw new System.OverflowException("Overflow_TimeSpanTooLong");
            }
            return(new JsImplTimeSpan(num));
        }
Example #2
0
 public static bool Equals(JsImplTimeSpan t1, JsImplTimeSpan t2)
 {
     if (t1.As <object>() != null && t2.As <object>() != null)
     {
         return(t1._ticks == t2._ticks);
     }
     else
     {
         return(t1.As <object>() == t2.As <object>());
     }
 }
Example #3
0
 public static int Compare(JsImplTimeSpan t1, JsImplTimeSpan t2)
 {
     if (t1._ticks > t2._ticks)
     {
         return(1);
     }
     if (t1._ticks < t2._ticks)
     {
         return(-1);
     }
     return(0);
 }
Example #4
0
        public int CompareTo(JsImplTimeSpan value)
        {
            long ticks = value._ticks;

            if (_ticks > ticks)
            {
                return(1);
            }
            if (_ticks < ticks)
            {
                return(-1);
            }
            return(0);
        }
Example #5
0
 public static JsImplTimeSpan FromSeconds(double value)
 {
     return(JsImplTimeSpan.Interval(value, 1000));
 }
Example #6
0
 public static JsImplTimeSpan FromMinutes(double value)
 {
     return(JsImplTimeSpan.Interval(value, 60000));
 }
Example #7
0
 public static JsImplTimeSpan FromMilliseconds(double value)
 {
     return(JsImplTimeSpan.Interval(value, 1));
 }
Example #8
0
 public static JsImplTimeSpan FromHours(double value)
 {
     return(JsImplTimeSpan.Interval(value, 3600000));
 }
Example #9
0
 public bool Equals(JsImplTimeSpan obj)
 {
     return(_ticks == obj._ticks);
 }
Example #10
0
 public static JsImplTimeSpan FromDays(double value)
 {
     return(JsImplTimeSpan.Interval(value, 86400000));
 }