Example #1
0
 public static bool TryConvert(TimeBase time, Type targetType, out object targetValue)
 {
     targetValue = null;
     if (targetType == typeof(TimeSpan))
     {
         targetValue = time.Time;
     }
     else if (targetType == typeof(uint))
     {
         targetValue = time.Ticks;
     }
     else if (targetType == typeof(int))
     {
         targetValue = (int)time.Ticks;
     }
     else if (targetType == typeof(long))
     {
         targetValue = time.Ticks;
     }
     else if (targetType == typeof(ulong))
     {
         targetValue = time.Ticks;
     }
     else if (targetType == typeof(string))
     {
         targetValue = time.ToString();
     }
     return(targetValue != null);
 }
Example #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (obj.GetType() != base.GetType())
            {
                return(false);
            }
            TimeBase base2 = (TimeBase)obj;

            return(this.internalTimeValue == base2.internalTimeValue);
        }