public IElement GetFocusedElement ()
{
foreach (string busName in GetUiaDbusNames ()) {
DCI.IApplication app =
Bus.Session.GetObject<DCI.IApplication> (busName,
new ObjectPath (DC.Constants.ApplicationPath));
if (app == null)
continue;
string elementPath = app.GetFocusedElementPath ();
if (!string.IsNullOrEmpty (elementPath))
return GetOrCreateElement (busName, elementPath);
}
return null;
}