public string GetItemId(Session session, string browseName)
{
TraceState("GetItemId", browseName);
// find the id of the current element.
string itemId = null;
lock (m_lock)
{
if (m_browsePosition != null)
{
itemId = m_browsePosition.ItemId;
}
}
// return the current element.
if (String.IsNullOrEmpty(browseName))
{
return itemId;
}
// try to fetch the child.
ComDaBrowseElement child = m_cache.FindChild(session, itemId, browseName);
if (child == null)
{
throw ComUtils.CreateComException(ResultIds.E_INVALIDARG);
}
// return child id.
return child.ItemId;
}