public void refreshUI() { ProjectManager pm = ProjectManager.GetInstance(); treeView1.Nodes.Clear(); results = new List <ResultItem>(); treeView1.Nodes.Add("Motor"); parseMotorDerivedParams("Motor"); treeView1.Nodes.Add("Static"); AbstractAnalyticalAnalyser aa = pm.analyticalAnalyser; AbstractStaticAnalyser sa = pm.staticAnalyser; parseComparisonResults("Static", aa == null ? null : aa.getResults(), sa == null ? null : sa.getResults()); foreach (String name in pm.GetAnalysisResultsNames()) { // add nodes to treeview of results String[] ss = name.Split('.', '\\'); TreeNodeCollection nodes = treeView1.Nodes;//first lv collection nodes for (int i = 0; i < ss.Length; i++) { if (nodes.ContainsKey(ss[i])) { nodes = treeView1.Nodes[ss[i]].Nodes;//get next level nodes collections } else { nodes = nodes.Add(ss[i], ss[i]).Nodes;//add ss[i] to itself and get its collection (of couse empty) } } // now parse the results data object result = pm.GetAnalysisResults(name); if (result == null) { continue; } if (result is AbstractFEMResults) { parseResults(name, (AbstractFEMResults)result); } } treeView1.ExpandAll(); showResultsInDGV(currentPath); }