Hourglass.Timing.TimerOptions.FromTimerOptionsInfo C# (CSharp) Method

FromTimerOptionsInfo() public static method

Returns a TimerOptions for the specified TimerOptionsInfo, or null if the specified TimerOptionsInfo is null.
public static FromTimerOptionsInfo ( TimerOptionsInfo info ) : TimerOptions
info Hourglass.Serialization.TimerOptionsInfo A .
return TimerOptions
        public static TimerOptions FromTimerOptionsInfo(TimerOptionsInfo info)
        {
            return info != null ? new TimerOptions(info) : null;
        }

Usage Example

示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Timer"/> class.
        /// </summary>
        /// <param name="timerInfo">A <see cref="TimerInfo"/> representing the state of the <see
        /// cref="Timer"/>.</param>
        public Timer(TimerInfo timerInfo)
            : base(timerInfo)
        {
            this.timerStart = TimerStart.FromTimerStartInfo(timerInfo.TimerStart);
            this.options    = TimerOptions.FromTimerOptionsInfo(timerInfo.Options) ?? new TimerOptions();

            this.UpdateHourglassTimer();
        }