Пример #1
0
 /// <summary>
 /// Private method to send notification 'onZoneStatusUpdate'
 /// </summary>
 /// <param name="e">Parameters received from underlying layer.</param>
 private void notifyZoneStatusUpdate(ConreteProtocolEventArgs e)
 {
     if (onZoneStatusUpdate != null)
     {
         try
         {
             ZoneState zoneState = new ZoneState(new Address(e.DeviceId, (int)e.Command.SourceId), (e.Command.PowerStatus == EZonePowerStatus.ZoneStatusON ? true : false),
                                                 NuvoEssentiaCommand.calcVolume2NuvoControl(e.Command.VolumeLevel), ZoneQuality.Online);
             onZoneStatusUpdate(this, new ProtocolZoneUpdatedEventArgs(new Address(e.DeviceId, (int)e.Command.ZoneId), zoneState, e));
         }
         catch (Exception ex)
         {
             _log.Fatal(m => m("Exception occured at forwarding event 'onZoneStatusUpdate' to Device {0} and Zone {1} (Command='{2}')! Exception={3}", e.DeviceId, e.Command.ZoneId, e.Command.ToString(), ex.ToString()));
         }
     }
 }