Exemplo n.º 1
0
 public static bool TryConvert(DateBase date, Type targetType, out object targetValue)
 {
     targetValue = null;
     if (targetType == typeof(DateTime))
     {
         targetValue = date.Date;
     }
     else if (targetType == typeof(uint))
     {
         targetValue = date.Ticks;
     }
     else if (targetType == typeof(long))
     {
         targetValue = date.Ticks;
     }
     else if (targetType == typeof(string))
     {
         targetValue = date.ToString();
     }
     return(targetValue != null);
 }