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

GetItemId() public method

Gets the item id for the specified browse element.
public GetItemId ( Session session, string browseName ) : string
session Opc.Ua.Client.Session The session.
browseName string The name of the browse element.
return string
        public string GetItemId(Session session, string browseName)
        {
            TraceState("GetItemId", browseName);

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

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

            // return the current element.
            if (String.IsNullOrEmpty(browseName))
            {
                return itemId;
            }

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

            if (child == null)
            {
                throw ComUtils.CreateComException(ResultIds.E_INVALIDARG);
            }

            // return child id.
            return child.ItemId;
        }