Opc.Ua.NotificationMessage.GetEvents C# (CSharp) Method

GetEvents() public method

Returns the events contained in the notification message.
public GetEvents ( bool reverse ) : IList
reverse bool
return IList
        public IList<EventFieldList> GetEvents(bool reverse)
        {
            List<EventFieldList> events = new List<EventFieldList>();

            foreach (ExtensionObject extension in m_notificationData)
            {
                if (ExtensionObject.IsNull(extension))
                {
                    continue;
                }

                EventNotificationList notification = extension.Body as EventNotificationList;
                                
                if (notification == null)
                {
                    continue;
                }            
    
                if (reverse)
                {
                    for (int ii = notification.Events.Count-1; ii >= 0; ii--)
                    {
                        EventFieldList eventFields = notification.Events[ii];

                        if (eventFields != null)
                        {
                            eventFields.Message = this;
                            events.Add(eventFields);
                        }
                    }
                }
                else
                {
                    for (int ii = 0; ii < notification.Events.Count; ii++)
                    {
                        EventFieldList eventFields = notification.Events[ii];

                        if (eventFields != null)
                        {
                            eventFields.Message = this;
                            events.Add(eventFields);
                        }
                    }
                }
            }

            return events;
        }
        #endregion
NotificationMessage