Bamboo.Prevalence.AlarmClock.Pause C# (CSharp) Метод

Pause() публичный Метод

Pauses the clock. The property Now will keep on returning the same value until Resume or Recover gets called.
You should not call this method. It is used internally by the prevalence engine to execute a command as if in a specific moment in time.
public Pause ( ) : void
Результат void
		public void Pause()
		{
			if (!_paused)
			{	
				_paused = true;
				_now = DateTime.Now;
			}
		}

Usage Example

        /// <summary>
        /// Pauses the engine. When paused the engine will not
        /// accept any commands (<see cref="ExecuteCommand"/>
        /// will throw <see cref="PausedEngineException"/> instead).
        ///
        /// The engine never stops accepting queries.
        ///
        /// The engine will accept commands again after <see cref="Resume"/>.
        /// </summary>
        public void Pause()
        {
            if (_paused)
            {
                return;
            }

            _clock.Pause();
            _paused = true;
        }