public UiaDbusElement GetOrCreateElement (string busName, string elementPath)
{
if (string.IsNullOrEmpty (elementPath) ||
string.IsNullOrEmpty (busName))
return null;
UiaDbusElement element;
lock (elementMapping) {
if (elementMapping.TryGetValue (new DbusElementTuple (busName, elementPath),
out element))
return element;
DCI.IAutomationElement dbusElement =
Bus.Session.GetObject<DCI.IAutomationElement> (busName,
new ObjectPath (elementPath));
element = CreateElement (dbusElement, busName, elementPath);
}
return element;
}