private ILocalNode FindInstanceDeclarationsInParent(
ILocalNode node,
List<QualifiedName> browsePath,
List<ILocalNode> declarations)
{
if (node == null)
{
return null;
}
ILocalNode typeDefinition = GetLocalNode(node.TypeDefinitionId) as ILocalNode;
if (typeDefinition != null)
{
FindInstanceDeclarationsInType(typeDefinition, browsePath, declarations);
}
browsePath.Insert(0, node.BrowseName);
IList<INode> parents = m_nodes.Find(node.NodeId, ReferenceTypeIds.HasModelParent, false, false);
foreach (INode parent in parents)
{
return FindInstanceDeclarationsInParent(parent as ILocalNode, browsePath, declarations);
}
return node;
}