private void addItem() { String line; if ((line = sr.ReadLine()) != null) { var array = line.ToString().Split('\t'); List <string> data = new List <string>(); foreach (string item in array) { if (item != "\n") { data.Add(item); } } AnalysisTableItem temp = new AnalysisTableItem(data); ItemList.Add(temp); TableView.Dispatcher.BeginInvoke(DispatcherPriority.Background, new AddItemDelegate(addItem)); } else { sr.Close(); MainWindow temp = (MainWindow)Application.Current.MainWindow; temp.Mips.IsEnabled = true; } }
private List <AnalysisTableItem> ReadTable() { string sourceFolder = Storage.getStoragePath("Source"); string tableFilePath = Path.Combine(sourceFolder, "analysis.table"); StreamReader sr = new StreamReader(tableFilePath, Encoding.Default); sr.ReadLine(); string line; while ((line = sr.ReadLine()) != null) { var array = line.ToString().Split('\t'); List <string> data = new List <string>(); foreach (string item in array) { if (item != "\n") { data.Add(item); } } AnalysisTableItem temp = new AnalysisTableItem(data); ItemList.Add(temp); } sr.Close(); return(ItemList); }