public List <Subject> FindByClassroom(Classroom classroom)
        {
            List <Subject> resultList = new List <Subject>();

            List <string> toFind = classroom.InstalledSoftware;

            HashSet <string> hashSet = new HashSet <string>(toFind);

            //bool contained = this.Subjects[0].NeedsSoftware.All(i => hashSet.Contains(i));

            foreach (Subject s in this.Subjects)
            {
                //if (s.NeedsSoftware.Except(toFind).Any())
                if (s.NeedsSoftware.All(i => hashSet.Contains(i)))
                {
                    Console.WriteLine("sadrzi predmet: " + s.Name);
                    resultList.Add(s);
                }
            }
            return(resultList);
        }
Esempio n. 2
0
 /// <summary>
 /// Ne poziva se nikad?
 /// </summary>
 /// <param name="id"></param>
 /// <param name="header"></param>
 /// <param name="start"></param>
 /// <param name="end"></param>
 /// <param name="classroom"></param>
 /// <param name="subject"></param>
 public void Add(string id, string header, DateTime start, DateTime end, Classroom classroom, Subject subject)
 {
     AddTermin(new MyTermin(NextId(), header, start, end, classroom, subject));
 }
Esempio n. 3
0
 public MyTermin(string id, string header, DateTime start, DateTime end,
                 Classroom classroom, Subject subject) : this(header, start, end, classroom, subject)
 {
     this.Id = id;
 }
Esempio n. 4
0
 public MyTermin(string header, DateTime start, DateTime end,
                 Classroom classroom, Subject subject) : this(header, start, end)
 {
     this._inClassroom = classroom;
     this._forSubject  = subject;
 }
Esempio n. 5
0
 private ClassroomHandler()
 {
     classrooms        = new Dictionary <string, Classroom>();
     SelectedClassroom = null; // set default value
 }
Esempio n. 6
0
 public void SetSelectedClassroom(Classroom classRoom, MainWindow context)
 {
     SelectedClassroom = classRoom;
     context.NotifyAll("SelectedClassroom");
 }