public bool AddSessionName(string name) { if (SessionNames.Contains(name)) { return(false); } SessionNames.Add(name); //generate sessions with the new name foreach (var sessionType in SessionTypes) { Sessions.Add(new Session(name, sessionType)); } return(true); }
public bool RemoveSessionName(string sessionName) { if (!SessionNames.Contains(sessionName)) { return(false); } //remove sessions with the given type foreach (var s in Sessions.Where(s => s.Name == sessionName).ToArray()) { Sessions.Remove(s); } SessionNames.Remove(sessionName); return(true); }