Esempio n. 1
0
        /// <summary>
        /// Called when the receiver sends a status packet such as low battery or lost connection to us
        /// </summary>
        /// <param name="deviceStatus">The <see cref="LaJust.EIDSS.Communications.Entities.DeviceStatusEventArgs"/> instance containing the event data.</param>
        protected void OnStatusNotification(DeviceStatusEventArgs deviceStatus)
        {
            CompetitorModel competitor = this.ScoreKeeperService.Competitors.FirstOrDefault(c => c.DeviceId.Equals(deviceStatus.DeviceId));

            if (competitor != null)
            {
                competitor.DeviceStatus = deviceStatus.DeviceStatus;
            }
        }
        /// <summary>
        /// Raises the <see cref="E:BatteryLow"/> event.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="LaJust.EIDSS.Communications.Entities.DeviceStatusEventArgs"/> instance containing the event data.</param>
        protected virtual void OnDeviceStatusUpdate(object sender, DeviceStatusEventArgs e)
        {
            EventHandler <DeviceStatusEventArgs> handler = this.DeviceStatusUpdate;

            try
            {
                handler(this, e);
            }
            catch (Exception ex)
            {
                Trace.TraceError("{0}.OnDeviceStatusUpdate: {1}", CLASSNAME, ex.GetBaseException());
                throw;
            }
        }