Example #1
0
        /// <summary>
        /// Sets all of the options from another instance of the <see cref="TimerOptions"/> class.
        /// </summary>
        /// <param name="options">A <see cref="TimerOptions"/>.</param>
        public void Set(TimerOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            this.title                  = options.title;
            this.alwaysOnTop            = options.alwaysOnTop;
            this.promptOnExit           = options.promptOnExit;
            this.showProgressInTaskbar  = options.showProgressInTaskbar;
            this.doNotKeepComputerAwake = options.doNotKeepComputerAwake;
            this.showTimeElapsed        = options.showTimeElapsed;
            this.loopTimer              = options.loopTimer;
            this.popUpWhenExpired       = options.popUpWhenExpired;
            this.closeWhenExpired       = options.closeWhenExpired;
            this.shutDownWhenExpired    = options.shutDownWhenExpired;
            //this.theme = options.theme;
            this.sound           = options.sound;
            this.loopSound       = options.loopSound;
            this.windowTitleMode = options.windowTitleMode;
            this.windowSize      = WindowSize.FromWindowSize(options.WindowSize);
            this.lockInterface   = options.lockInterface;

            this.OnPropertyChanged(
                "Title",
                "AlwaysOnTop",
                "PromptOnExit",
                "ShowProgressInTaskbar",
                "DoNotKeepComputerAwake",
                "ShowTimeElapsed",
                "LoopTimer",
                "PopUpWhenExpired",
                "CloseWhenExpired",
                "ShutDownWhenExpired",
                "Theme",
                "Sound",
                "LoopSound",
                "WindowTitleMode",
                "WindowSize",
                "LockInterface");
        }