Exemple #1
0
 /// <summary>
 /// Extracts an <see cref="Interval"/> from the data stored below the
 /// given context node.
 /// </summary>
 /// <param name="context">The context <see cref="XmlElement"/>.</param>
 /// <returns>An <see cref="Interval"/> constructed from the stored data.</returns>
 protected static Interval ToInterval(XmlElement context)
 {
     if (context != null)
     {
         try {
             return(new Interval(
                        ToInteger(XPath.Path(context, "periodMultiplier")),
                        Period.ForCode(ToToken(XPath.Path(context, "period")))));
         }
         catch (Exception) {
             return(null);
         }
     }
     return(null);
 }