Example #1
0
 void InitTree(BTree_INCC <int, Student> tree)
 {
     foreach (var line in File.ReadAllLines(@".\students.txt").Skip(1).Select(x => x.Split(';')))
     {
         var st = new Student(int.Parse(line[0]), line[1], line[2], line[3], line[4], int.Parse(line[5]));
         tree.Insert(st.id, st);
     }
 }
Example #2
0
        void InitBD(ObservableCollection <Student> students, BTree_INCC <int, Student> tree)
        {
            var lines = File.ReadAllLines(@".\students.txt");
            var st    = lines.Skip(1).Select(x => x.Split(';')).ToArray();

            for (int i = 0; i < st.Count(); i++)
            {
                students.Add(new Student(int.Parse(st[i][0]), st[i][1], st[i][2], st[i][3], st[i][4], int.Parse(st[i][5])));
            }
            InitTree(tree);
        }
Example #3
0
        public MainWindow()
        {
            InitializeComponent();

            tree = new BTree_INCC <int, Student>(100);

            InitTree(tree);

            studentsGrid.ItemsSource = tree;

            (FindName("cb") as ComboBox).SelectionChanged += ActionSelected;

            var facBox = FindName("cbFac") as ComboBox;

            InitFilterBoxes();
        }