public void EndGetAlarmSummaryOrEventRequest(IAsyncResult result, bool GetEvent, ref IList<BacnetGetEventInformationData> Alarms, out bool MoreEvent, out Exception ex)
{
MoreEvent = false;
BacnetAsyncResult res = (BacnetAsyncResult)result;
ex = res.Error;
if (ex == null && !res.WaitForDone(m_timeout))
ex = new Exception("Wait Timeout");
if (ex == null)
{
if (Services.DecodeAlarmSummaryOrEvent(res.Result, 0, res.Result.Length, GetEvent, ref Alarms, out MoreEvent) < 0)
ex = new Exception("Decode");
}
else
{
ex = new Exception("Service not available");
}
res.Dispose();
}