示例#1
0
 private void OnMotionSensed(PIR sender, EventArgs e)
 {
     if (Program.CheckAndInvoke(this.MotionSensed, this.onMotionSensed, sender, e))
     {
         this.MotionSensed(sender, e);
     }
 }
示例#2
0
        /// <summary>
        /// Raises the <see cref="Motion_Sensed"/> event.
        /// </summary>
        /// <param name="sender">The <see cref="PIR"/> that raised the event.</param>
        /// <param name="Motion_SensorState">The state of the Motion_Sensor.</param>
        protected virtual void OnMotion_SensorEvent(PIR sender, Motion_SensorState Motion_SensorState)
        {
            if (this.onMotion_Sensor == null)
            {
                this.onMotion_Sensor = new Motion_SensorEventHandler(this.OnMotion_SensorEvent);
            }

            if (Program.CheckAndInvoke(this.Motion_Sensed, this.onMotion_Sensor, sender, Motion_SensorState))
            {
                switch (Motion_SensorState)
                {
                case Motion_SensorState.Busy:
                    this.Motion_Sensed(sender, Motion_SensorState);
                    break;
                }
            }
        }