Opc.Ua.VariableTypeNode.Read C# (CSharp) Method

Read() protected method

Reads the value of an attribute.
protected Read ( uint attributeId ) : object
attributeId uint The attribute id.
return object
        protected override object Read(uint attributeId)
        {
            switch (attributeId)
            {
                case Attributes.DataType:        return m_dataType;
                case Attributes.ValueRank:       return m_valueRank;
                    
                // values are copied when the are written so then can be safely returned.
                case Attributes.Value:
                {
                    return m_value.Value;
                }

                case Attributes.ArrayDimensions:
                {
                    if (m_arrayDimensions == null || m_arrayDimensions.Count == 0)
                    {
                        return StatusCodes.BadAttributeIdInvalid;
                    }

                    return m_arrayDimensions.ToArray();
                }
            }

            return base.Read(attributeId);
        }