Пример #1
0
        /// <summary>
        /// Adds the given activation span to the event, in which it's
        /// supposed to be active.
        /// </summary>
        /// <param name="span"></param>
        public void AddActivationSpan(ActivationSpan span)
        {
            lock (_activationSpans)
                _activationSpans.Add(span);

            var now = DateTime.Now;

            // Active time
            if (now >= span.Start && now < span.End)
            {
                this.Start();
            }
            // Inactive time
            else
            {
                this.End();
            }
        }
Пример #2
0
		/// <summary>
		/// Adds the given activation span to the event, in which it's
		/// supposed to be active.
		/// </summary>
		/// <param name="span"></param>
		public void AddActivationSpan(ActivationSpan span)
		{
			lock (_activationSpans)
				_activationSpans.Add(span);

			var now = DateTime.Now;

			// Active time
			if (now >= span.Start && now < span.End)
			{
				this.Start();
			}
			// Inactive time
			else
			{
				this.End();
			}
		}