/// <inheritdoc />
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            string asString = value as string;

            if (asString != null)
            {
                return(TimestampDelta.Parse(asString.Trim()));
            }

            return(base.ConvertFrom(context, culture, value));
        }
Beispiel #2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="TimeRange"/>
 ///     struct.
 /// </summary>
 /// <param name="startTime">
 ///     The start time of the range.
 /// </param>
 /// <param name="duration">
 ///     The duration of the range.
 /// </param>
 public TimeRange(Timestamp startTime, TimestampDelta duration)
 {
     this.startTime = startTime;
     this.endTime   = startTime + duration;
 }