public SessionHeaderViewModel(SessionPlace sessionPlace, Individual individual, SelectionModel selectionModel, Action showSession) { _sessionPlace = sessionPlace; _individual = individual; _selectionModel = selectionModel; _showSession = showSession; }
public void RemoveSchedule(SessionPlace sessionPlace) { foreach (Schedule schedule in CurrentSchedules .Where(s => s.SessionPlace == sessionPlace)) { Community.AddFact(new ScheduleRemove(schedule)); } }
public SessionDetailsViewModel(Slot slot, SessionPlace sessionPlace, ImageCache imageCache, SearchModel searchModel, Clock clock) { _slot = slot; _sessionPlace = sessionPlace; _imageCache = imageCache; _searchModel = searchModel; _clock = clock; }
public bool IsScheduled(SessionPlace sessionPlace) { var sessions = from attendee in Attendees from sp in attendee.ScheduledSessionPlaces select sp; return(sessions.Contains(sessionPlace)); }
public async Task RemoveScheduleAsync(SessionPlace sessionPlace) { foreach (var attendee in await Attendees.EnsureAsync()) { foreach (var schedule in await attendee.CurrentSchedules.EnsureAsync()) { if (schedule.SessionPlace == sessionPlace) { await Community.AddFactAsync(new ScheduleRemove(schedule)); } } } }
public async Task <Schedule> AddScheduleAsync(SessionPlace sessionPlace) { Attendee attendee = (await Attendees.EnsureAsync()).FirstOrDefault(); if (attendee == null) { attendee = await Community.AddFactAsync(new Attendee( sessionPlace.Session.Conference, Guid.NewGuid().ToString())); } await Community.AddFactAsync(new IndividualAttendee(this, attendee)); var slot = await Community.AddFactAsync(new Slot( attendee, sessionPlace.Place.PlaceTime)); return(await Community.AddFactAsync(new Schedule(slot, sessionPlace))); }
public object GetSessionDetailsViewModel(string sessionId) { Attendee attendee = _synchronizationService.Attendee; Guid sessionGuid = new Guid(sessionId); Session session = attendee.Conference.Sessions.Ensure().FirstOrDefault(s => s.Unique == sessionGuid); if (session == null) { return(null); } if (session.CurrentSessionPlaces.Ensure().Count() != 1) { return(null); } SessionPlace sessionPlace = session.CurrentSessionPlaces.Single(); Slot slot = attendee.NewSlot(sessionPlace.Place.PlaceTime); return(ForView.Wrap(new SessionDetailsViewModel(slot, sessionPlace, _imageCache, _searchModel, _clock))); }
public static bool CanDisplay(SessionPlace sessionPlace, string searchTerm) { if (string.IsNullOrEmpty(searchTerm)) { return(true); } bool hasSessionInfo = sessionPlace.Session.Name.Value != null && sessionPlace.Session.Speaker.Name != null && sessionPlace.Session.Track.Name != null && sessionPlace.Session.Description.Value.Any(); if (!hasSessionInfo) { return(false); } return (sessionPlace.Session.Speaker.Name.ToLower().Contains(searchTerm) || sessionPlace.Session.Name.Value.ToLower().Contains(searchTerm) || sessionPlace.Session.Track.Name.ToLower().Contains(searchTerm) || sessionPlace.Session.Description.Value.JoinSegments().ToLower().Contains(searchTerm)); }
public SessionViewModel(SessionPlace sessionPlace) { _sessionPlace = sessionPlace; }
public bool IsScheduled(SessionPlace sessionPlace) { return(CurrentSchedules.Any(s => s.SessionPlace == sessionPlace)); }
public void AddSchedule(SessionPlace sessionPlace) { Community.AddFact(new Schedule(this, sessionPlace)); }
public SessionViewModel(SessionPlace sessionPlace, Individual individual) { _sessionPlace = sessionPlace; _individual = individual; }
public TrackSessionViewModel(Slot slot, SessionPlace sessionPlace, ImageCache imageCache) { _slot = slot; _sessionPlace = sessionPlace; _imageCache = imageCache; }
public SessionHeaderViewModel(SessionPlace sessionPlace, SelectionModel selectionModel) { _sessionPlace = sessionPlace; _selectionModel = selectionModel; }