예제 #1
0
파일: Timer.cs 프로젝트: YisenYu/Hourglass
        /// <summary>
        /// Returns the representation of the <see cref="TimerInfo"/> used for XML serialization.
        /// </summary>
        /// <returns>The representation of the <see cref="TimerInfo"/> used for XML serialization.</returns>
        public override TimerInfo ToTimerInfo()
        {
            TimerInfo timerInfo = base.ToTimerInfo();

            timerInfo.TimerStart = TimerStartInfo.FromTimerStart(this.TimerStart);
            timerInfo.Options    = TimerOptionsInfo.FromTimerOptions(this.Options);
            return(timerInfo);
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TimerStart"/> class.
        /// </summary>
        /// <param name="timerStartInfo">A <see cref="TimerStartInfo"/>.</param>
        private TimerStart(TimerStartInfo timerStartInfo)
        {
            if (timerStartInfo == null)
            {
                throw new ArgumentNullException("timerStartInfo");
            }

            this.timerStartToken = timerStartInfo.TimerStartToken;
        }
예제 #3
0
        /// <summary>
        /// Returns a <see cref="TimerStart"/> for a <see cref="TimerStartInfo"/>.
        /// </summary>
        /// <param name="timerStartInfo">A <see cref="TimerStartInfo"/>.</param>
        /// <returns>The <see cref="TimerStart"/> for the <see cref="TimerStartInfo"/>.</returns>
        public static TimerStart FromTimerStartInfo(TimerStartInfo timerStartInfo)
        {
            if (timerStartInfo == null)
            {
                return(null);
            }

            return(new TimerStart(timerStartInfo));
        }