RIM.VSNDK_Package.Settings.Models.SettingsData.RefreshScreen C# (CSharp) Method

RefreshScreen() public method

Refresh the screen
public RefreshScreen ( ) : void
return void
        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);
        }