/// <summary> /// Raises the motion detection state changed event. /// </summary> /// <param name="e"> /// The event arguments. /// </param> protected virtual void OnMotionDetectionStateChanged(MotionDetectedEventArgs e) { if (e.MotionDetected) { this._lastMotion = DateTime.Now; } else { this._lastInactive = DateTime.Now; } if (this.MotionDetectionStateChanged != null) { this.MotionDetectionStateChanged(this, e); } }