Пример #1
0
        /// <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>
        /// Sets all of the options from an instance of the <see cref="TimerOptionsInfo"/> class.
        /// </summary>
        /// <param name="info">A <see cref="TimerOptionsInfo"/>.</param>
        public void Set(TimerOptionsInfo info)
        {
            if (info == null)
            {
                throw new ArgumentNullException("info");
            }

            this.title            = info.Title;
            this.alwaysOnTop      = info.AlwaysOnTop;
            this.loopTimer        = info.LoopTimer;
            this.popUpWhenExpired = info.PopUpWhenExpired;
            this.closeWhenExpired = info.CloseWhenExpired;
            this.color            = Color.FromIdentifier(info.ColorIdentifier);
            this.sound            = Sound.FromIdentifier(info.SoundIdentifier);
            this.loopSound        = info.LoopSound;
            this.windowSize       = WindowSize.FromWindowSizeInfo(info.WindowSize);
        }
Пример #3
0
        /// <summary>
        /// Sets all of the options from an instance of the <see cref="TimerOptionsInfo"/> class.
        /// </summary>
        /// <param name="info">A <see cref="TimerOptionsInfo"/>.</param>
        public void Set(TimerOptionsInfo info)
        {
            if (info == null)
            {
                throw new ArgumentNullException("info");
            }

            this.title                  = info.Title;
            this.alwaysOnTop            = info.AlwaysOnTop;
            this.promptOnExit           = info.PromptOnExit;
            this.showProgressInTaskbar  = info.ShowProgressInTaskbar;
            this.doNotKeepComputerAwake = info.DoNotKeepComputerAwake;
            this.showTimeElapsed        = info.ShowTimeElapsed;
            this.loopTimer              = info.LoopTimer;
            this.popUpWhenExpired       = info.PopUpWhenExpired;
            this.closeWhenExpired       = info.CloseWhenExpired;
            this.shutDownWhenExpired    = info.ShutDownWhenExpired;
            //this.theme = Theme.FromIdentifier(info.ThemeIdentifier);
            this.sound           = Sound.FromIdentifier(info.SoundIdentifier);
            this.loopSound       = info.LoopSound;
            this.windowTitleMode = info.WindowTitleMode;
            this.windowSize      = WindowSize.FromWindowSizeInfo(info.WindowSize);
            this.lockInterface   = info.LockInterface;

            this.OnPropertyChanged(
                "Title",
                "AlwaysOnTop",
                "PromptOnExit",
                "ShowProgressInTaskbar",
                "DoNotKeepComputerAwake",
                "ShowTimeElapsed",
                "LoopTimer",
                "PopUpWhenExpired",
                "CloseWhenExpired",
                "ShutDownWhenExpired",
                "Theme",
                "Sound",
                "LoopSound",
                "WindowTitleMode",
                "WindowSize",
                "LockInterface");
        }
Пример #4
0
 /// <summary>
 /// Returns a <see cref="TimerOptions"/> for the specified <see cref="TimerOptionsInfo"/>, or <c>null</c> if
 /// the specified <see cref="TimerOptionsInfo"/> is <c>null</c>.
 /// </summary>
 /// <param name="info">A <see cref="TimerOptionsInfo"/>.</param>
 /// <returns>A <see cref="TimerOptions"/> for the specified <see cref="TimerOptionsInfo"/>, or <c>null</c> if
 /// the specified <see cref="TimerOptionsInfo"/> is <c>null</c>.</returns>
 public static TimerOptions FromTimerOptionsInfo(TimerOptionsInfo info)
 {
     return(info != null ? new TimerOptions(info) : null);
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TimerOptions"/> class from a <see cref="TimerOptionsInfo"/>.
 /// </summary>
 /// <param name="info">A <see cref="TimerOptionsInfo"/>.</param>
 public TimerOptions(TimerOptionsInfo info)
 {
     this.Set(info);
 }