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

Cast() private method

Cast FilterOperator
private Cast ( FilterContext context, IFilterTarget target, ContentFilterElement element ) : object
context FilterContext
target IFilterTarget
element ContentFilterElement
return object
        private object Cast(FilterContext context, IFilterTarget target, ContentFilterElement element)
        {
            FilterOperand[] operands = GetOperands(element, 2);
            
            // get the value to cast.
            object value = GetValue(context, operands[0], target);

            if (value == null)
            {
                return null;
            }

            // get the datatype to cast to.
            NodeId datatype = GetValue(context, operands[1], target) as NodeId;

            if (datatype == null)
            {
                return null;
            }

            BuiltInType targetType = GetBuiltInType(datatype);
            
            // cast the value.
            return Cast(value, targetType);
        }
                

Same methods

ContentFilter::Cast ( object source, BuiltInType targetType ) : object
ContentFilter::Cast ( object source, BuiltInType sourceType, BuiltInType targetType ) : object