Opc.Ua.Com.Client.AeTypeCache.LoadEventType C# (CSharp) Method

LoadEventType() public method

Fetches the event categories for the specified event type.
public LoadEventType ( ComAeClient client, int eventTypeId ) : void
client ComAeClient
eventTypeId int
return void
        public void LoadEventType(ComAeClient client, int eventTypeId)
        {
            int[] ids = null;
            string[] descriptions = null;

            try
            {
                client.GetEventCategories(eventTypeId, out ids, out descriptions);
            }
            catch (Exception e)
            {
                Utils.Trace(e, "Unexpected error fetching event categories.");
            }

            if (ids != null)
            {
                for (int ii = 0; ii < ids.Length; ii++)
                {
                    List<EventAttribute> attributes = LoadEventAttributes(client, eventTypeId, ids[ii]);

                    if (eventTypeId == OpcRcw.Ae.Constants.CONDITION_EVENT)
                    {
                        LoadConditionEvent(client, eventTypeId, ids[ii], descriptions[ii], attributes);
                        continue;
                    }

                    EventType eventType = new EventType();
                    eventType.EventTypeId = eventTypeId;
                    eventType.CategoryId = ids[ii];
                    eventType.Description = descriptions[ii];
                    eventType.ConditionName = null;
                    eventType.SubConditionNames = null;
                    eventType.Attributes = attributes;
                    DetermineMapping(eventType);
                    EventTypes.Add(eventType);
                }
            }
        }