Used to implement custom type conversions specifically for DateTime objects.
Inheritance: Habanero.Base.DataMappers.DataMapper
コード例 #1
0
 public void TestFixtureSetup()
 {
     //Code that is executed before any test is run in this class. If multiple tests
     // are executed then it will still only be called once.
     _propDef = new PropDef("PropName", typeof (DateTime), PropReadWriteRule.ReadWrite, null);
     _dataMapper = new DateTimeDataMapper();
 }
コード例 #2
0
 private static DateTime GetDate(string dateString, DateTime initialDate)
 {
     object value;
     bool dateValueParsedOk = new DateTimeDataMapper().TryParsePropValue(dateString, out value);
     DateTime dateTime = initialDate;
     if (dateValueParsedOk)
     {
         if (value is DateTime)
         {
             return (DateTime) value;
         }
         if (value is IResolvableToValue)
         {
             dateTime = (DateTime) ((IResolvableToValue) value).ResolveToValue();
         }
     }
     return dateTime;
 }