public void GetInstalledAPIList()
{
try
{
_installedAPIList = new List<APIClass>();
_installedNDKList = new List<APIClass>();
string[] dirPaths = new string[2];
dirPaths[0] = bbndkPathConst + @"\..\qconfig\";
dirPaths[1] = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\";
for (int i = 0; i < 2; i++)
{
string[] filePaths = Directory.GetFiles(dirPaths[i], "*.xml");
foreach (string file in filePaths)
{
try
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(file);
XmlNodeList name = xmlDoc.GetElementsByTagName("name");
XmlNodeList version = xmlDoc.GetElementsByTagName("version");
XmlNodeList hostpath = xmlDoc.GetElementsByTagName("host");
XmlNodeList targetpath = xmlDoc.GetElementsByTagName("target");
if (i == 0)
{
APIClass aclass = new APIClass(name.Item(0).InnerText, hostpath.Item(0).InnerText, targetpath.Item(0).InnerText, version.Item(0).InnerText);
_installedAPIList.Add(aclass);
}
else
{
APIClass aclass = new APIClass(name.Item(0).InnerText, hostpath.Item(0).InnerText, targetpath.Item(0).InnerText, version.Item(0) == null ? "2.1.0" : version.Item(0).InnerText);
_installedNDKList.Add(aclass);
}
}
catch
{
break;
}
}
}
}
catch (Exception ex)
{
}
}