public string GetQualifiedName(string targetName, bool isArea)
{
Session session = m_server.Session;
if (session == null)
{
throw ComUtils.CreateComException(ResultIds.E_FAIL);
}
lock (m_lock)
{
List<AeBrowseElement> elements = null;
// check if this is the first access.
if (isArea)
{
if (m_position.Areas == null)
{
Browse(true, String.Empty);
}
elements = m_position.Areas;
}
else
{
if (m_position.Sources == null)
{
Browse(false, String.Empty);
}
elements = m_position.Sources;
}
// find the target.
for (int ii = 0; ii < elements.Count; ii++)
{
if (elements[ii].BrowseText == targetName)
{
return elements[ii].ItemId;
}
}
throw ComUtils.CreateComException(ResultIds.E_INVALIDARG);
}
}