public IList<ILocalNode> GetInstanceDeclarations(
NodeId typeId,
IList<QualifiedName> browsePath)
{
try
{
m_lock.Enter();
Dictionary<QualifiedName,ILocalNode> targets = new Dictionary<QualifiedName,ILocalNode>();
// find the source.
ILocalNode source = GetLocalNode(typeId) as ILocalNode;
if (source == null)
{
return new List<ILocalNode>();
}
// verify that the source is a type node.
if (!(source is IObjectType || source is IVariableType))
{
return new List<ILocalNode>();
}
// recursively collect targets of the browse path.
GetInstanceDeclarations(source, browsePath, targets);
// return the list of targets.
return new List<ILocalNode>(targets.Values);
}
finally
{
m_lock.Exit();
}
}