public IElement [] GetRootElements ()
{
List<IElement> dbusElements = new List<IElement> ();
foreach (string busName in GetUiaDbusNames ()) {
DCI.IApplication app =
Bus.Session.GetObject<DCI.IApplication> (busName,
new ObjectPath (DC.Constants.ApplicationPath));
if (app == null)
continue;
string [] rootElementPaths;
try {
rootElementPaths = app.GetRootElementPaths ();
} catch {
continue;
}
foreach (string elementPath in rootElementPaths) {
var rootElement = GetOrCreateElement (busName, elementPath);
if (rootElement != null)
dbusElements.Add (rootElement);
}
}
Log.Debug ("UiaDbusAutomationSource: GetRootElements count will be: " + dbusElements.Count);
return dbusElements.ToArray ();
}