private AeBrowseElement Find(Session session, string itemId, bool isArea)
{
// check if it has been cached.
AeBrowseElement target = null;
if (m_cache.TryGetValue(itemId, out target))
{
if (target.IsArea == isArea)
{
return target;
}
return null;
}
// find the first parent that is already cached.
Stack<string> names = new Stack<string>();
AeBrowseElement root = FindRoot(itemId, names);
// browse for the node in the server.
try
{
return Find(session, itemId, root, names, isArea);
}
catch
{
return null;
}
}