Example #1
0
        public static object FromTimeSpan(object existing, DarkConfig.DocNode doc)
        {
            TimeSpan newSpan;
            bool     isSuccess = TimeSpan.TryParse(doc.StringValue, out newSpan);

            if (!isSuccess)
            {
                throw new ParseException("expected parsable timespan string " + doc.StringValue, null);
            }
            return(newSpan);
        }
Example #2
0
 public static object FromDateTime(object existing, DarkConfig.DocNode doc)
 {
     return(DateTime.Parse(doc.StringValue,
                           System.Globalization.CultureInfo.InvariantCulture));
 }