Opc.Ua.ContentFilter.OfType C# (CSharp) Method

OfType() private method

OfType FilterOperator
private OfType ( FilterContext context, IFilterTarget target, ContentFilterElement element ) : bool
context FilterContext
target IFilterTarget
element ContentFilterElement
return bool
        private bool OfType(FilterContext context, IFilterTarget target, ContentFilterElement element)
        {
            FilterOperand[] operands = GetOperands(element, 1);
            
            // get the desired type.
            NodeId typeDefinitionId = GetValue(context, operands[0], target) as NodeId;

            if (typeDefinitionId == null || target == null)
            {
                return false;
            }

            // check the type.
            try
            {
                return target.IsTypeOf(context, typeDefinitionId);
            }
            catch
            {
                return false;
            }
        }