/// <summary> /// Refresh the screen /// </summary> public void RefreshScreen() { /// Get the NDK Path data getNDKPath(); /// Refresh the NDK List string[] dirPaths = new string[2]; dirPaths[0] = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + @"bbndk_vs\..\qconfig\"; dirPaths[1] = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\"; IList <NDKEntryClass> NDKList = new List <NDKEntryClass>(); for (int i = 0; i < 2; i++) { if (!Directory.Exists(dirPaths[i])) { continue; } string[] filePaths = Directory.GetFiles(dirPaths[i], "*.xml"); foreach (string file in filePaths) { try { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(file); string name = xmlDoc.GetElementsByTagName("name")[0].InnerText; string hostpath = xmlDoc.GetElementsByTagName("host")[0].InnerText; string targetpath = xmlDoc.GetElementsByTagName("target")[0].InnerText; NDKEntryClass NDKEntry = new NDKEntryClass(name, hostpath, targetpath); NDKList.Add(NDKEntry); if (NDKEntry.HostPath == HostPath) { NDKEntryClass = NDKEntry; } } catch { break; } } } NDKEntries = new CollectionView(NDKList); }
public SettingsData() { string[] filePaths = Directory.GetFiles(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\", "*.xml"); IList<NDKEntryClass> NDKList = new List<NDKEntryClass>(); foreach (string file in filePaths) { try { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(file); XmlNodeList name = xmlDoc.GetElementsByTagName("name"); XmlNodeList hostpath = xmlDoc.GetElementsByTagName("host"); XmlNodeList targetpath = xmlDoc.GetElementsByTagName("target"); NDKEntryClass NDKEntry = new NDKEntryClass(name[0].InnerText, hostpath[0].InnerText, targetpath[0].InnerText); NDKList.Add(NDKEntry); if (NDKEntry.HostPath == getNDKPath()) { NDKEntryClass = NDKEntry; } } catch { continue; } } _ndkEntries = new CollectionView(NDKList); }
/// <summary> /// Refresh the screen /// </summary> public void RefreshScreen() { /// Get the NDK Path data getNDKPath(); /// Refresh the NDK List string[] dirPaths = new string[2]; dirPaths[0] = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + @"bbndk_vs\..\qconfig\"; dirPaths[1] = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Research In Motion\BlackBerry Native SDK\qconfig\"; IList<NDKEntryClass> NDKList = new List<NDKEntryClass>(); for (int i = 0; i < 2; i++) { if (!Directory.Exists(dirPaths[i])) continue; string[] filePaths = Directory.GetFiles(dirPaths[i], "*.xml"); foreach (string file in filePaths) { try { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(file); string name = xmlDoc.GetElementsByTagName("name")[0].InnerText; string hostpath = xmlDoc.GetElementsByTagName("host")[0].InnerText; string targetpath = xmlDoc.GetElementsByTagName("target")[0].InnerText; NDKEntryClass NDKEntry = new NDKEntryClass(name, hostpath, targetpath); NDKList.Add(NDKEntry); if (NDKEntry.HostPath == HostPath) { NDKEntryClass = NDKEntry; } } catch { break; } } } NDKEntries = new CollectionView(NDKList); }