Opc.Ua.BaseInstanceState.GetAttributeValue C# (CSharp) Method

GetAttributeValue() public method

public GetAttributeValue ( FilterContext context, Opc.Ua.NodeId typeDefinitionId, IList relativePath, uint attributeId, NumericRange indexRange ) : object
context FilterContext
typeDefinitionId Opc.Ua.NodeId
relativePath IList
attributeId uint
indexRange NumericRange
return object
        public virtual object GetAttributeValue(
            FilterContext context, 
            NodeId typeDefinitionId, 
            IList<QualifiedName> relativePath, 
            uint attributeId, 
            NumericRange indexRange)
        {
            // check the type definition.
            if (!NodeId.IsNull(typeDefinitionId) && typeDefinitionId != ObjectTypes.BaseEventType)
            {
                if (!context.TypeTree.IsTypeOf(TypeDefinitionId, typeDefinitionId))
                {
                    return null;
                }
            }

            // read the child attribute.
            DataValue dataValue = new DataValue();   

            ServiceResult result = ReadChildAttribute(
                null,
                relativePath,
                0,
                attributeId,
                dataValue);
            
            if (ServiceResult.IsBad(result))
            {
                return null;
            }

            // apply any index range.
            object value = dataValue.Value;

            if (value != null)
            {
                result = indexRange.ApplyRange(ref value);
                
                if (ServiceResult.IsBad(result))
                {
                    return null;
                }
            }

            // return the result.
            return value;
        }
        #endregion