public void AddLunchSession(Session lunchSession) { var lunch = new Talk("Lunch") {Duration = lunchSession.Duration}; lunchSession.AddTalk(lunch); Sessions.Insert(1, lunchSession); }
public bool AddTalk(Talk talk) { foreach (var session in Sessions) { if (session.Available >= talk.Duration) { session.AddTalk(talk); return true; } } return false; }
public void AddTalk(Talk talk) { if (Available >= talk.Duration) { talk.Time = _startTime; _startTime += new TimeSpan(0, talk.Duration, 0); Talks.Add(talk); } else { throw new Exception("Cant add.."); } }
public void AddNetworkEvent(TimeSpan networkEventStartTime) { var lastSession = Sessions[Sessions.Count - 1]; var lastTalkEndTime = networkEventStartTime; if (lastSession.Talks != null && lastSession.Talks.Count > 0) { var lastTalk = lastSession.Talks[lastSession.Talks.Count - 1]; lastTalkEndTime = lastTalk.Time + new TimeSpan(0, lastTalk.Duration, 0); } if (lastTalkEndTime > networkEventStartTime) { networkEventStartTime = lastTalkEndTime; } var netWorkSession = new Session(networkEventStartTime, 0); var networkTalk = new Talk("Networking Event") {Duration = 0}; netWorkSession.AddTalk(networkTalk); Sessions.Add(netWorkSession); }