Opc.Ua.Com.Client.ComDaClient.FindElement C# (CSharp) Method

FindElement() public method

Finds the branch or item.
public FindElement ( string itemId ) : DaElement
itemId string The item id.
return DaElement
        public DaElement FindElement(string itemId)
        {
            if (String.IsNullOrEmpty(itemId))
            {
                return null;
            }

            // check the cache.
            DaElement element = null;

            lock (m_cache)
            {
                if (m_cache.TryGetValue(itemId, out element))
                {
                    return element;
                }
            }
            
            // try extracting the name by parsing the item id.
            string name = null;

            if (m_configuration.ItemIdParser.Parse(this, m_configuration, itemId, out name))
            {
                element = CreateElement(itemId, name, null);
            }

            // need to do it the hard way by searching the address space.
            else
            {
                IDaElementBrowser browser = CreateBrowser(itemId);
                element = browser.Find(itemId, false);
                browser.Dispose();
            }

            // save element in the cache.
            if (element != null)
            {
                SaveElementInCache(element);
            }

            return element;
        }

Same methods

ComDaClient::FindElement ( string itemId, string name, string parentId ) : DaElement