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

CreateChildNode() private method

Creates a snapshot of a node.
private CreateChildNode ( ISystemContext context, BaseInstanceState state ) : ChildNode
context ISystemContext The context.
state BaseInstanceState The state.
return ChildNode
        private ChildNode CreateChildNode(ISystemContext context, BaseInstanceState state)
        {
            ChildNode node = new ChildNode();

            node.NodeClass  = state.NodeClass;
            node.BrowseName = state.BrowseName;

            BaseVariableState variable = state as BaseVariableState;

            if (variable != null)
            {
                if (!StatusCode.IsBad(variable.StatusCode))
                {
                    node.Value = Utils.Clone(variable.Value);
                }
            }

            BaseObjectState instance = state as BaseObjectState;

            if (instance != null)
            {
                node.Value = instance.NodeId;                    
            }

            node.Children = CreateChildNodes(context, state);

            return node;
        }