Exemplo n.º 1
0
 public override void add(object value)
 {
     if (value is TimeSpan)
     {
         BasicNanoTime.checkTimeSpanToNanoTime((TimeSpan)value);
         base.add(Utils.countNanoseconds((TimeSpan)value));
         return;
     }
     base.add(value);
 }
Exemplo n.º 2
0
        //set nanotime : 06:07:11.123456789
        public override void set(int index, string value)
        {
            TimeSpan ts = new TimeSpan();
            long     v  = 0;

            if (!long.TryParse(value, out v))
            {
                var tmp = value.Split('.');
                if (tmp.Length >= 2)
                {
                    long nano = 0;
                    if (long.TryParse(tmp[1], out nano))
                    {
                        if (TimeSpan.TryParse(tmp[0], out ts))
                        {
                            BasicNanoTime.checkTimeSpanToNanoTime(ts);
                            base.set(index, new BasicLong(Utils.countNanoseconds(ts) + nano));
                            return;
                        }
                    }
                }
            }
            base.set(index, value);
        }
Exemplo n.º 3
0
 public virtual void setNanoTime(int index, TimeSpan time)
 {
     BasicNanoTime.checkTimeSpanToNanoTime(time);
     setLong(index, Utils.countNanoseconds(time));
 }