GetEventAttributes() public method

Gets the event attributes.
public GetEventAttributes ( int categoryId, int &attributeIds, string &descriptions, short &datatypes ) : bool
categoryId int The category id.
attributeIds int The attribute ids.
descriptions string The descriptions.
datatypes short The datatypes.
return bool
コード例 #1
0
        /// <summary>
        /// Fetches the attributes for the category from the AE server.
        /// </summary>
        private List <EventAttribute> LoadEventAttributes(ComAeClient client, int eventTypeId, int categoryId)
        {
            List <EventAttribute> attributes = new List <EventAttribute>();

            int[]    ids          = null;
            string[] descriptions = null;
            short[]  dataTypes    = null;

            try
            {
                client.GetEventAttributes(categoryId, out ids, out descriptions, out dataTypes);
            }
            catch (Exception e)
            {
                Utils.Trace(e, "Unexpected error fetching event attributes.");
                ids = null;
            }

            if (ids != null)
            {
                for (int ii = 0; ii < ids.Length; ii++)
                {
                    EventAttribute attribute = new EventAttribute();
                    attribute.Id          = ids[ii];
                    attribute.Description = descriptions[ii];
                    attribute.VarType     = dataTypes[ii];
                    attributes.Add(attribute);
                }
            }

            return(attributes);
        }
コード例 #2
0
ファイル: AeTypeCache.cs プロジェクト: OPCFoundation/UA-.NET
        /// <summary>
        /// Fetches the attributes for the category from the AE server.
        /// </summary>
        private List<EventAttribute> LoadEventAttributes(ComAeClient client, int eventTypeId, int categoryId)
        {
            List<EventAttribute> attributes = new List<EventAttribute>();

            int[] ids = null;
            string[] descriptions = null;
            short[] dataTypes = null;

            try
            {
                client.GetEventAttributes(categoryId, out ids, out descriptions, out dataTypes);
            }
            catch (Exception e)
            {
                Utils.Trace(e, "Unexpected error fetching event attributes.");
                ids = null;
            }

            if (ids != null)
            {
                for (int ii = 0; ii < ids.Length; ii++)
                {
                    EventAttribute attribute = new EventAttribute();
                    attribute.Id = ids[ii];
                    attribute.Description = descriptions[ii];
                    attribute.VarType = dataTypes[ii];
                    attributes.Add(attribute);
                }
            }

            return attributes;
        }