public IList<MonitoredItemNotification> GetDataChanges(bool reverse)
{
List<MonitoredItemNotification> datachanges = new List<MonitoredItemNotification>();
for (int jj = 0; jj < m_notificationData.Count; jj++)
{
ExtensionObject extension = m_notificationData[jj];
if (ExtensionObject.IsNull(extension))
{
continue;
}
DataChangeNotification notification = extension.Body as DataChangeNotification;
if (notification == null)
{
continue;
}
if (reverse)
{
for (int ii = notification.MonitoredItems.Count-1; ii >= 0; ii--)
{
MonitoredItemNotification datachange = notification.MonitoredItems[ii];
if (datachange != null)
{
datachange.Message = this;
datachanges.Add(datachange);
}
}
}
else
{
for (int ii = 0; ii < notification.MonitoredItems.Count; ii++)
{
MonitoredItemNotification datachange = notification.MonitoredItems[ii];
if (datachange != null)
{
datachange.Message = this;
datachanges.Add(datachange);
}
}
}
}
return datachanges;
}