public void StartBuild() { if (filePath == "") { MessageBox.Show("Путь не указан"); return; } try { getTreeParameters(); TreeInfo info = new TreeInfo(); for (int i = 0; i < levelCount; i++) { StackPanel panel = (StackPanel)levels[i].Content; var levelType = (LevelType)((ComboBox)panel.Children[1]).SelectedItem; var popupType = (PopupLevelType)((ComboBox)panel.Children[3]).SelectedItem; NodeLevelInfo levelInfo = new NodeLevelInfo(levelType, popupType, i); info.AddNewLevelInfo(levelInfo); } info.nodesOnLevel = nodesOnLevel; info.topRequestCount = topRequestCount; info.levelCount = levelCount; builder = new TreeBuilder(topRequestCount, new CSVDataReader(filePath), info); TreeNode root = builder.GetTree(); MainWindow mainWindow = new MainWindow(root, info); mainWindow.Show(); window.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void AddNewLevelInfo(NodeLevelInfo levelInfo) { nodeLevels.Add(levelInfo); }