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

GetLocalNodes() public method

Returns a list of nodes which are targets of the specified references.
public GetLocalNodes ( NodeId sourceId, NodeId referenceTypeId, bool isInverse, bool includeSubtypes ) : IList
sourceId NodeId
referenceTypeId NodeId
isInverse bool
includeSubtypes bool
return IList
        public IList<ILocalNode> GetLocalNodes(
            NodeId        sourceId, 
            NodeId        referenceTypeId,
            bool          isInverse, 
            bool          includeSubtypes)
        {
            try
            {
                m_lock.Enter();

                List<ILocalNode> targets = new List<ILocalNode>();

                ILocalNode source = GetLocalNode(sourceId) as ILocalNode;

                if (source == null)
                {
                    return targets;
                }

                foreach (IReference reference in source.References.Find(referenceTypeId, isInverse, true, m_nodes.TypeTree))
                {                    
                    ILocalNode target = GetLocalNode(reference.TargetId) as ILocalNode;

                    if (target != null)
                    {
                        targets.Add(target);
                    }
                }

                return targets;
            }
            finally
            {
                m_lock.Exit();
            } 
        }