public FullScheduleCellViewModel ( IRepository repository, Session session, Agenda agenda, Slot slot, IEnumerable<string> trackFilters ) { this._repository = repository; this._slot = slot; this._agenda = agenda; Session = session; Title = session.Title; Location = session.Location; // Track = session.Track; IsOptional = slot.SessionIds.Skip(1).Any(); IsSelected = IsOptional && agenda.IsSelected (slot.StartTime, session.Id); Track = !string.IsNullOrEmpty (session.Track) ? session.Track : string.IsNullOrEmpty (session.Title) ? "None" : // check title for registration session.Title == "Registration" ? session.Title : // check title for any breaks session.Title == "Break" || session.Title == "Breakfast" || session.Title == "Lunch" || session.Title == "Afternoon Break" || session.Title == "Party" ? "MealBreak" : "NoTrack"; }
static Session SessionForSlot (Slot slot, Agenda agenda, IEnumerable<Session> sessions) { //Console.WriteLine ("Slot: " + slot.StartTime + " Agenda: " + agenda.Id); return !slot.SessionIds.Skip (1).Any () ? sessions.Single (session => session.Id == slot.SessionIds.First ()) : sessions.FirstOrDefault (session => agenda.IsSelected (slot.StartTime, session.Id)); }