public Add_Software(Classroom.OpSystem os) { current_sw = new Software(); added = new List <int>(); InitializeComponent(); if (os.Equals(Classroom.OpSystem.Windows)) { lin.Visibility = Visibility.Hidden; } else if (os.Equals(Classroom.OpSystem.Linux)) { win.Visibility = Visibility.Hidden; lin.IsChecked = true; } }
public Choose_Software(Classroom.OpSystem a) { this.DataContext = this; exitDemoMode.InputGestures.Add(new KeyGesture(Key.Escape)); this.Closing += new CancelEventHandler(Window_Closing); os = a; InitializeComponent(); all = new ObservableCollection <Software>(); added = new ObservableCollection <Software>(); if (chosen_software.Count() == 0) { foreach (Software sw in MainWindow.allSoftware) { if (a.Equals(Classroom.OpSystem.WindowsAndLinux) || sw.Os.Equals(a) || sw.Os.Equals(Classroom.OpSystem.WindowsAndLinux)) { all.Add(sw); } } } else { foreach (Software sw in MainWindow.allSoftware) { if (a.Equals(Classroom.OpSystem.WindowsAndLinux) || sw.Os.Equals(a) || sw.Os.Equals(Classroom.OpSystem.WindowsAndLinux)) { if (chosen_software.Contains(sw)) { added.Add(sw); } else { all.Add(sw); } } } } addedSoftwareDG.ItemsSource = added; allSoftwareDG.ItemsSource = all; }