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

SetChildValue() private method

Sets the value for a child. Adds it if it does not already exist.
private SetChildValue ( ChildNode node, Opc.Ua.QualifiedName browseName, NodeClass nodeClass, object value ) : void
node ChildNode The node.
browseName Opc.Ua.QualifiedName The BrowseName.
nodeClass NodeClass The node class.
value object The value.
return void
        private void SetChildValue(
            ChildNode node,
            QualifiedName browseName,
            NodeClass nodeClass,
            object value)
        {
            ChildNode child = null;

            if (node.Children != null)
            {
                for (int ii = 0; ii < node.Children.Count; ii++)
                {
                    child = node.Children[ii];

                    if (child.BrowseName == browseName)
                    {
                        break;
                    }

                    child = null;
                }
            }
            else
            {
                node.Children = new List<ChildNode>();
            }

            if (child == null)
            {
                child = new ChildNode();
                node.Children.Add(child);
            }

            child.BrowseName = browseName;
            child.NodeClass = nodeClass;
            child.Value = value;
        }

Same methods

InstanceStateSnapshot::SetChildValue ( Opc.Ua.QualifiedName browseName, NodeClass nodeClass, object value ) : void