Opc.Ua.ServerTest.TestBase.GetWriteableVariablesInHierarchy C# (CSharp) Method

GetWriteableVariablesInHierarchy() protected method

Collects all of the nodes in the hierarchies specified in the configuration file.
protected GetWriteableVariablesInHierarchy ( ) : bool
return bool
        protected bool GetWriteableVariablesInHierarchy()
        {
            // use folders labelled 'Static' if no explicit list provided.
            bool findStaticFolders = false;
            IList<NodeId> writeableNodes = Configuration.GetNodeList(Configuration.WriteableVariables, this.Session.NamespaceUris);

            if (writeableNodes.Count == 0)
            {
                findStaticFolders = true;
            }

            // collection writeable variables that don't change during the test.
            m_writeableVariables.Clear();

            foreach (Node node in AvailableNodes.Values)
            {
                if (findStaticFolders && node.BrowseName.Name == "Static")
                {
                    Log("Browsing children of '{0}'. NodeId = {1}", node, node.NodeId);
                    CollectVariables(node, m_writeableVariables);
                    writeableNodes.Add(node.NodeId);
                }
                else
                {
                    for (int ii = 0; ii < writeableNodes.Count; ii++)
                    {
                        if (writeableNodes[ii] == node.NodeId)
                        {
                            Log("Browsing children of '{0}'. NodeId = {1}", node, node.NodeId);
                            CollectVariables(node, m_writeableVariables);
                        }
                    }
                }
            }

            Log("GetWriteableVariables found {0} Variables", m_writeableVariables.Count);
            return writeableNodes.Count > 0;
        }