Opc.Ua.InstanceStateSnapshot.GetAttributeValue C# (CSharp) Method

GetAttributeValue() private method

Returns the value of the attribute for the specified child.
private GetAttributeValue ( ChildNode node, IList relativePath, int index, uint attributeId ) : object
node ChildNode The node.
relativePath IList The relative path.
index int The index.
attributeId uint The attribute id.
return object
        private object GetAttributeValue(
            ChildNode node,
            IList<QualifiedName> relativePath,
            int index, 
            uint attributeId)
        {
            if (index >= relativePath.Count)
            {
                if (node.NodeClass == NodeClass.Object && attributeId == Attributes.NodeId)
                {
                    return node.Value;
                }

                if (node.NodeClass == NodeClass.Variable && attributeId == Attributes.Value)
                {
                    return node.Value;
                }

                return null;
            }

            for (int ii = 0; ii < node.Children.Count; ii++)
            {
                if (node.Children[ii].BrowseName == relativePath[index])
                {
                    return GetAttributeValue(node.Children[ii], relativePath, index+1, attributeId);
                }
            }

            return null;
        }
        #endregion

Same methods

InstanceStateSnapshot::GetAttributeValue ( FilterContext context, Opc.Ua.NodeId typeDefinitionId, IList relativePath, uint attributeId, NumericRange indexRange ) : object