Opc.Ua.Com.Server.ComDaBrowseManager.BrowseDown C# (CSharp) Method

BrowseDown() public method

Moves the current browse position down.
public BrowseDown ( Session session, string targetName ) : void
session Opc.Ua.Client.Session The session.
targetName string Name of the target.
return void
        public void BrowseDown(Session session, string targetName)
        {
            TraceState("BrowseDown", targetName);

            // find the id of the current element.
            string itemId = null;

            lock (m_lock)
            {
                if (m_browsePosition != null)
                {
                    itemId = m_browsePosition.ItemId;
                }
            }

            // try to fetch the child.
            ComDaBrowseElement child = m_cache.FindChild(session, itemId, targetName);

            if (child != null)
            {
                TraceState("child", child.ItemId, child.BrowseName, child.IsItem, child.HasChildren);
            }

            if (child == null || (!child.HasChildren && child.IsItem))
            {
                throw ComUtils.CreateComException(ResultIds.E_INVALIDARG);
            }

            // update the browse position.
            lock (m_lock)
            {
                m_browsePosition = child;
            }
        }