private string[] CheckAreaNotificationProperty(ElkArea area, eElkAreaEventUpdateType update) { myNotificationDevices = myElkNotificationManager.notificationDevices; List <string> devicesToSend = new List <string>(); foreach (var userDevice in myNotificationDevices) { if (userDevice.Value.NotificationAreas.ContainsKey(area.GetAreaNumber)) { try { if (update == eElkAreaEventUpdateType.ArmedStatusChange && userDevice.Value.NotificationAreas[area.GetAreaNumber].ArmedStateChange == 1) { myPanel.SendDebug(String.Format("NotificationMessageHandler: OK To send Armed State message for {0} {1}", userDevice.Value.DeviceName, area)); devicesToSend.Add(userDevice.Value.DeviceName); } if (update == eElkAreaEventUpdateType.AlarmStateChange && userDevice.Value.NotificationAreas[area.GetAreaNumber].AlarmStateChange == 1) { myPanel.SendDebug(String.Format("NotificationMessageHandler: OK To send Alarm Status message for {0} {1}", userDevice.Value.DeviceName, area)); devicesToSend.Add(userDevice.Value.DeviceName); } } catch (Exception ex) { myPanel.SendDebug(String.Format("NotificationMessageHandler: Error checking area property {0} {1} {2} \r\n{3}", userDevice, update, ex.ToString())); } } } return(devicesToSend.ToArray()); }
protected virtual void OnElkAreaEvent(eElkAreaEventUpdateType updateType) { if (ElkAreaEvent != null) { ElkAreaEvent(this, new ElkAreaEventArgs() { Area = areaNumber, EventUpdateType = updateType }); } }