Example #1
0
        public static JsImplTimeSpan FromMilliseconds(double value)
        {
            var ts = new JsImplTimeSpan();

            ts._TotalMilliseconds = value;
            return(ts);
        }
Example #2
0
        public JsImplTimeSpan Add(JsImplTimeSpan ts)
        {
            var num = _TotalMilliseconds + ts._TotalMilliseconds;

            //if (_ticks >> 63 == ts._ticks >> 63 && _ticks >> 63 != num >> 63)
            //{
            //    throw new System.OverflowException("Overflow_TimeSpanTooLong");
            //}
            return(JsImplTimeSpan.FromMilliseconds(num));
        }
Example #3
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 #4
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 #5
0
        public int CompareTo(JsImplTimeSpan value)
        {
            long ticks = value._ticks;

            if (_ticks > ticks)
            {
                return(1);
            }
            if (_ticks < ticks)
            {
                return(-1);
            }
            return(0);
        }
Example #6
0
 public static JsImplTimeSpan FromSeconds(double value)
 {
     return(JsImplTimeSpan.Interval(value, 1000));
 }
Example #7
0
 public JsImplTimeSpan Add(JsImplTimeSpan ts)
 {
     var num = _TotalMilliseconds + ts._TotalMilliseconds;
     //if (_ticks >> 63 == ts._ticks >> 63 && _ticks >> 63 != num >> 63)
     //{
     //    throw new System.OverflowException("Overflow_TimeSpanTooLong");
     //}
     return JsImplTimeSpan.FromMilliseconds(num);
 }
Example #8
0
 public int CompareTo(JsImplTimeSpan value)
 {
     long ticks = value._ticks;
     if (_ticks > ticks)
     {
         return 1;
     }
     if (_ticks < ticks)
     {
         return -1;
     }
     return 0;
 }
Example #9
0
 public static JsImplTimeSpan FromMinutes(double value)
 {
     return(JsImplTimeSpan.Interval(value, 60000));
 }
Example #10
0
 public static bool Equals(JsImplTimeSpan t1, JsImplTimeSpan t2)
 {
     return(t1._ticks == t2._ticks);
 }
Example #11
0
 public static JsImplTimeSpan FromHours(double value)
 {
     return(JsImplTimeSpan.Interval(value, 3600000));
 }
Example #12
0
 public static JsImplTimeSpan FromDays(double value)
 {
     return(JsImplTimeSpan.Interval(value, 86400000));
 }
Example #13
0
 public bool Equals(JsImplTimeSpan obj)
 {
     return(_ticks == obj._ticks);
 }
Example #14
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 #15
0
 public bool Equals(JsImplTimeSpan obj)
 {
     return _ticks == obj._ticks;
 }
Example #16
0
 public static bool Equals(JsImplTimeSpan t1, JsImplTimeSpan t2)
 {
     return t1._ticks == t2._ticks;
 }
Example #17
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 #18
0
 public static JsImplTimeSpan FromMilliseconds(double value)
 {
     var ts = new JsImplTimeSpan();
     ts._TotalMilliseconds = value;
     return ts;
 }