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

ApplyBrowseFilters() private method

Returns true is the target meets the filter criteria.
private ApplyBrowseFilters ( IReference reference, BrowseDirection browseDirection, NodeId referenceTypeId, bool includeSubtypes ) : bool
reference IReference
browseDirection BrowseDirection
referenceTypeId NodeId
includeSubtypes bool
return bool
        private bool ApplyBrowseFilters(
            IReference      reference,
            BrowseDirection browseDirection,
            NodeId          referenceTypeId,
            bool            includeSubtypes)
        {
            // check browse direction.
            if (reference.IsInverse)
            {
                if (browseDirection == BrowseDirection.Forward)
                {
                    return false;
                }
            }
            else
            {
                if (browseDirection == BrowseDirection.Inverse)
                {
                    return false;
                }
            }

            // check reference type filter.
            if (!NodeId.IsNull(referenceTypeId))
            {
                if (reference.ReferenceTypeId != referenceTypeId)
                {
                    if (includeSubtypes)
                    {
                        if (m_server.TypeTree.IsTypeOf(reference.ReferenceTypeId, referenceTypeId))
                        {
                            return true;
                        }
                    }
                        
                    return false;
                }
            }
                   
            // include reference for now.
            return true;
        }
        #endregion