/// <summary>
/// Returns the value of the attribute for the specified child.
/// </summary>
/// <param name="context">The context to use when evaluating the operand.</param>
/// <param name="typeDefinitionId">The type of the instance.</param>
/// <param name="relativePath">The path from the instance to the node which defines the attribute.</param>
/// <param name="attributeId">The attribute to return.</param>
/// <param name="indexRange">The sub-set of an array value to return.</param>
/// <returns>
/// The attribute value. Returns null if the attribute does not exist.
/// </returns>
public object GetAttributeValue(
FilterContext context,
NodeId typeDefinitionId,
IList <QualifiedName> relativePath,
uint attributeId,
NumericRange indexRange)
{
if (!NodeId.IsNull(typeDefinitionId))
{
if (!context.TypeTree.IsTypeOf(m_typeDefinitionId, typeDefinitionId))
{
return(null);
}
}
object value = GetAttributeValue(
m_snapshot,
relativePath,
0,
attributeId);
if (indexRange != NumericRange.Empty)
{
StatusCode error = indexRange.ApplyRange(ref value);
if (StatusCode.IsBad(error))
{
value = null;
}
}
return(value);
}