public void BrowseDown(Session session, string targetName)
{
TraceState("BrowseDown", targetName);
// find the id of the current element.
string itemId = null;
lock (m_lock)
{
if (m_browsePosition != null)
{
itemId = m_browsePosition.ItemId;
}
}
// try to fetch the child.
ComDaBrowseElement child = m_cache.FindChild(session, itemId, targetName);
if (child != null)
{
TraceState("child", child.ItemId, child.BrowseName, child.IsItem, child.HasChildren);
}
if (child == null || (!child.HasChildren && child.IsItem))
{
throw ComUtils.CreateComException(ResultIds.E_INVALIDARG);
}
// update the browse position.
lock (m_lock)
{
m_browsePosition = child;
}
}