Opc.Ua.Server.CoreNodeManager.FindInstanceDeclaration C# (CSharp) Method

FindInstanceDeclaration() public method

Returns the instance declarations that match the browse name.
This function recusively searches the fully inheirited type for matching instance declarations. It then follows the HasModelParent reference to find nested instance declarations in the fully inheirited type for the parent(s).
public FindInstanceDeclaration ( ILocalNode parent, QualifiedName browseName ) : ILocalNode
parent ILocalNode
browseName QualifiedName
return ILocalNode
        public ILocalNode FindInstanceDeclaration(ILocalNode parent, QualifiedName browseName)
        {     
            List<ILocalNode> declarations = new List<ILocalNode>();

            if (parent == null)
            {
                return null;
            }
            
            List<QualifiedName> browsePath = new List<QualifiedName>();
            browsePath.Add(browseName);

            FindInstanceDeclarationsInParent(parent, browsePath, declarations);

            if (declarations.Count == 0)
            {
                return null;
            }

            return declarations[declarations.Count-1];
        }